% December 1996 %
% %
% %
-% Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
#include "MagickCore/log.h"
#include "MagickCore/magick.h"
#include "MagickCore/memory_.h"
+#include "MagickCore/nt-base.h"
+#include "MagickCore/nt-base-private.h"
#include "MagickCore/resource_.h"
#include "MagickCore/resource-private.h"
#include "MagickCore/timer.h"
% process.
%
*/
-MagickExport int Exit(int status)
+MagickPrivate int Exit(int status)
{
if (IsWindows95())
TerminateProcess(GetCurrentProcess(),(unsigned int) status);
return(0);
}
\f
-#if !defined(__MINGW32__)
+#if !defined(__MINGW32__) && !defined(__MINGW64__)
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% o time_zone: the time zone.
%
*/
-MagickExport int gettimeofday (struct timeval *time_value,
+MagickPrivate int gettimeofday (struct timeval *time_value,
struct timezone *time_zone)
{
#define EpochFiletime MagickLLConstant(116444736000000000)
% int IsWindows95()
%
*/
-MagickExport int IsWindows95()
+MagickPrivate int IsWindows95()
{
OSVERSIONINFO
version_info;
% o argv: the wide-character command line arguments.
%
*/
-MagickExport char **NTArgvToUTF8(const int argc,wchar_t **argv)
+MagickPrivate char **NTArgvToUTF8(const int argc,wchar_t **argv)
{
char
**utf8;
% o entry: Specifies a pointer to a DIR structure.
%
*/
-MagickExport int NTCloseDirectory(DIR *entry)
+MagickPrivate int NTCloseDirectory(DIR *entry)
{
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
assert(entry != (DIR *) NULL);
% o handle: Specifies a handle to a previously loaded dynamic module.
%
*/
-MagickExport int NTCloseLibrary(void *handle)
+MagickPrivate int NTCloseLibrary(void *handle)
{
if (IsWindows95())
return(FreeLibrary((HINSTANCE) handle));
return(FALSE);
}
-MagickExport int NTControlHandler(void)
+MagickPrivate int NTControlHandler(void)
{
return(SetConsoleCtrlHandler((PHANDLER_ROUTINE) ControlHandler,TRUE));
}
% double NTElapsedTime(void)
%
*/
-MagickExport double NTElapsedTime(void)
+MagickPrivate double NTElapsedTime(void)
{
union
{
% o description: Specifies any description to the reason.
%
*/
-MagickExport void NTErrorHandler(const ExceptionType severity,
+MagickPrivate void NTErrorHandler(const ExceptionType severity,
const char *reason,const char *description)
{
char
% int NTExitLibrary(void)
%
*/
-MagickExport int NTExitLibrary(void)
+MagickPrivate int NTExitLibrary(void)
{
return(0);
}
% random: the random data is returned here.
%
*/
-MagickExport MagickBooleanType NTGatherRandomData(const size_t length,
+MagickPrivate MagickBooleanType NTGatherRandomData(const size_t length,
unsigned char *random)
{
#if defined(MAGICKCORE_CIPHER_SUPPORT) && defined(_MSC_VER) && (_MSC_VER > 1200)
% o extent: the maximum extent of the path.
%
*/
-MagickExport MagickBooleanType NTGetExecutionPath(char *path,
+MagickPrivate MagickBooleanType NTGetExecutionPath(char *path,
const size_t extent)
{
GetModuleFileName(0,path,(DWORD) extent);
% const char *NTGetLibraryError(void)
%
*/
-MagickExport const char *NTGetLibraryError(void)
+MagickPrivate const char *NTGetLibraryError(void)
{
static char
last_error[MaxTextExtent];
% path: the module path is returned here.
%
*/
-MagickExport MagickBooleanType NTGetModulePath(const char *module,char *path)
+MagickPrivate MagickBooleanType NTGetModulePath(const char *module,char *path)
{
char
module_path[MaxTextExtent];
static BOOL NTIs64BitPlatform()
{
-#if defined(_WIN64)
+#if defined(_WIN64) || !defined(KEY_WOW64_32KEY)
return(TRUE);
#else
BOOL is64=FALSE;
*value='\0';
if (product_family == NULL)
{
+ flags=0;
+#if defined(KEY_WOW64_32KEY)
flags=NTIs64BitPlatform() ? KEY_WOW64_64KEY : 0;
- (void) NTLocateGhostscript(flags,&product_family,&major_version,&minor_version);
+#endif
+ (void) NTLocateGhostscript(flags,&product_family,&major_version,
+ &minor_version);
if (product_family == NULL)
{
if (flags!=0)
{
- /* We are running on a 64 bit platform - check for a 32 bit Ghostscript, too */
+ /*
+ We are running on a 64 bit platform - check for a 32 bit Ghostscript.
+ */
+ flags=0;
+#if defined(KEY_WOW64_32KEY)
flags=KEY_WOW64_32KEY;
- (void) NTLocateGhostscript(flags,&product_family,&major_version,&minor_version);
- }
+#endif
+ (void) NTLocateGhostscript(flags,&product_family,&major_version,
+ &minor_version);
+ }
}
else
is_64_bit_version=NTIs64BitPlatform();
return(FALSE);
}
-MagickExport int NTGhostscriptDLL(char *path,int length)
+MagickPrivate int NTGhostscriptDLL(char *path,int length)
{
static char
dll[MaxTextExtent] = { "" };
% const GhostInfo *NTGhostscriptDLLVectors(void)
%
*/
-MagickExport const GhostInfo *NTGhostscriptDLLVectors(void)
+MagickPrivate const GhostInfo *NTGhostscriptDLLVectors(void)
{
if (NTGhostscriptLoadDLL() == FALSE)
return((GhostInfo *) NULL);
% o length: length of buffer.
%
*/
-MagickExport int NTGhostscriptEXE(char *path,int length)
+MagickPrivate int NTGhostscriptEXE(char *path,int length)
{
register char
*p;
% o length: length of the path buffer.
%
*/
-MagickExport int NTGhostscriptFonts(char *path,int length)
+MagickPrivate int NTGhostscriptFonts(char *path,int length)
{
char
buffer[MaxTextExtent],
% int NTGhostscriptLoadDLL(void)
%
*/
-MagickExport int NTGhostscriptLoadDLL(void)
+MagickPrivate int NTGhostscriptLoadDLL(void)
{
char
path[MaxTextExtent];
% int NTGhostscriptUnLoadDLL(void)
%
*/
-MagickExport int NTGhostscriptUnLoadDLL(void)
+MagickPrivate int NTGhostscriptUnLoadDLL(void)
{
int
status;
% int NTInitializeLibrary(void)
%
*/
-MagickExport int NTInitializeLibrary(void)
+MagickPrivate int NTInitializeLibrary(void)
{
return(0);
}
%
% The format of the NTMapMemory method is:
%
-% MagickExport void *NTMapMemory(char *address,size_t length,int protection,
+% MagickPrivate void *NTMapMemory(char *address,size_t length,int protection,
% int access,int file,MagickOffsetType offset)
%
*/
-MagickExport void *NTMapMemory(char *address,size_t length,int protection,
+MagickPrivate void *NTMapMemory(char *address,size_t length,int protection,
int flags,int file,MagickOffsetType offset)
{
DWORD
% o entry: Specifies a pointer to a DIR structure.
%
*/
-MagickExport DIR *NTOpenDirectory(const char *path)
+MagickPrivate DIR *NTOpenDirectory(const char *path)
{
char
file_specification[MaxTextExtent];
#endif
}
-MagickExport void *NTOpenLibrary(const char *filename)
+MagickPrivate void *NTOpenLibrary(const char *filename)
{
#define MaxPathElements 31
% o entry: Specifies a pointer to a DIR structure.
%
*/
-MagickExport struct dirent *NTReadDirectory(DIR *entry)
+MagickPrivate struct dirent *NTReadDirectory(DIR *entry)
{
int
status;
% "LibPath", "CoderModulesPath", "FilterModulesPath", "SharePath".
%
*/
-MagickExport unsigned char *NTRegistryKeyLookup(const char *subkey)
+MagickPrivate unsigned char *NTRegistryKeyLookup(const char *subkey)
{
char
package_key[MaxTextExtent];
% o error: MagickTrue the event is an error.
%
*/
-MagickExport MagickBooleanType NTReportEvent(const char *event,
+MagickPrivate MagickBooleanType NTReportEvent(const char *event,
const MagickBooleanType error)
{
const char
% o id: Specifies a string that identifies the resource.
%
*/
-MagickExport unsigned char *NTResourceToBlob(const char *id)
+MagickPrivate unsigned char *NTResourceToBlob(const char *id)
{
char
path[MaxTextExtent];
% stream.
%
*/
-MagickExport void NTSeekDirectory(DIR *entry,ssize_t position)
+MagickPrivate void NTSeekDirectory(DIR *entry,ssize_t position)
{
(void) position;
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
% for DLL's that can be dynamically loaded.
%
*/
-MagickExport int NTSetSearchPath(const char *path)
+MagickPrivate int NTSetSearchPath(const char *path)
{
#if defined(MAGICKCORE_LTDL_DELEGATE)
lt_dlsetsearchpath(path);
% o flags: Option flags (ignored for Windows).
%
*/
-MagickExport int NTSyncMemory(void *address,size_t length,int flags)
+MagickPrivate int NTSyncMemory(void *address,size_t length,int flags)
{
(void) flags;
if (FlushViewOfFile(address,length) == MagickFalse)
% o command: This string is the command to execute.
%
*/
-MagickExport int NTSystemCommand(const char *command)
+MagickPrivate int NTSystemCommand(const char *command)
{
char
local_command[MaxTextExtent];
% o name: _SC_PAGE_SIZE or _SC_PHYS_PAGES.
%
*/
-MagickExport ssize_t NTSystemConfiguration(int name)
+MagickPrivate ssize_t NTSystemConfiguration(int name)
{
switch (name)
{
status;
GlobalMemoryStatus(&status);
- return((ssize_t) status.dwTotalPhys/system_info.dwPageSize);
+ return((ssize_t) status.dwTotalPhys/system_info.dwPageSize/4);
}
status.dwLength=sizeof(status);
if (module(&status) == 0)
return(0L);
- return((ssize_t) status.ullTotalPhys/system_info.dwPageSize);
+ return((ssize_t) status.ullTotalPhys/system_info.dwPageSize/4);
}
case _SC_OPEN_MAX:
return(2048);
% o entry: Specifies a pointer to a DIR structure.
%
*/
-MagickExport ssize_t NTTellDirectory(DIR *entry)
+MagickPrivate ssize_t NTTellDirectory(DIR *entry)
{
assert(entry != (DIR *) NULL);
return(0);
% o length: the file length.
%
*/
-MagickExport int NTTruncateFile(int file,off_t length)
+MagickPrivate int NTTruncateFile(int file,off_t length)
{
DWORD
file_pointer;
% o length: the length of the binary large object.
%
*/
-MagickExport int NTUnmapMemory(void *map,size_t length)
+MagickPrivate int NTUnmapMemory(void *map,size_t length)
{
(void) length;
if (UnmapViewOfFile(map) == 0)
% double NTUserTime(void)
%
*/
-MagickExport double NTUserTime(void)
+MagickPrivate double NTUserTime(void)
{
DWORD
status;
% o description: Specifies any description to the reason.
%
*/
-MagickExport void NTWarningHandler(const ExceptionType severity,
+MagickPrivate void NTWarningHandler(const ExceptionType severity,
const char *reason,const char *description)
{
char