From: Dirk Lemstra Date: Sun, 24 Dec 2017 16:49:16 +0000 (+0100) Subject: Workaround for issue when loading libraries with installed support. X-Git-Tag: 7.0.7-16~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30abff02e54876f1c0a7c7c22671808df2b17668;p=imagemagick Workaround for issue when loading libraries with installed support. --- diff --git a/MagickCore/nt-base.c b/MagickCore/nt-base.c index b4ee8b460..cb76cb2eb 100644 --- a/MagickCore/nt-base.c +++ b/MagickCore/nt-base.c @@ -2804,6 +2804,28 @@ MagickPrivate void NTWindowsGenesis(void) _ASSERTE(_CrtCheckMemory()); } #endif +#if defined(MAGICKCORE_INSTALLED_SUPPORT) + { + unsigned char + *path; + + path=NTRegistryKeyLookup("LibPath"); + if (path != (unsigned char *) NULL) + { + size_t + length; + + wchar_t + lib_path[MagickPathExtent]; + + length=MultiByteToWideChar(CP_UTF8,0,(char *) path,-1,lib_path, + MagickPathExtent); + if (length != 0) + SetDllDirectoryW(lib_path); + path=(unsigned char *) RelinquishMagickMemory(path); + } + } +#endif } /*