/*
Set client name and execution path.
*/
- (void) GetExecutionPath(execution_path,MaxTextExtent);
+#if defined(MAGICKCORE_WINDOWS_SUPPORT)
+ if ((path != (const char *) NULL) && (IsPathAccessible(path) != MagickFalse))
+#else
if ((path != (const char *) NULL) && (*path == *DirectorySeparator) &&
(IsPathAccessible(path) != MagickFalse))
+#endif
(void) CopyMagickString(execution_path,path,MaxTextExtent);
+ else
+ (void) GetExecutionPath(execution_path,MaxTextExtent);
GetPathComponent(execution_path,TailPath,filename);
(void) SetClientName(filename);
GetPathComponent(execution_path,HeadPath,execution_path);
% and DLL_PROCESS_DETACH.
%
*/
-#if defined(_DLL) && defined( ProvideDllMain )
+#if defined(_DLL) && defined(ProvideDllMain)
BOOL WINAPI DllMain(HINSTANCE handle,DWORD reason,LPVOID lpvReserved)
{
switch (reason)
wchar_t
*wide_path;
+ MagickCoreGenesis((const char *) NULL,MagickFalse);
wide_path=(wchar_t *) AcquireQuantumMemory(MaxTextExtent,
sizeof(*wide_path));
if (wide_path == (wchar_t *) NULL)
module_path[count+1]='\0';
break;
}
- MagickCoreGenesis(module_path,MagickFalse);
path=(char *) AcquireQuantumMemory(16UL*MaxTextExtent,sizeof(*path));
if (path == (char *) NULL)
{
wchar_t
wide_path[MaxTextExtent];
- (void) GetModuleFileNameW(0,wide_path,(DWORD) extent);
+ (void) GetModuleFileNameW((HMODULE) NULL,wide_path,(DWORD) extent);
(void) WideCharToMultiByte(CP_UTF8,0,wide_path,-1,path,(int) extent,NULL,
NULL);
return(MagickTrue);