diff --git a/src/dl.c b/src/dl.c index b13f9d4..4a1b0c1 100644 --- a/src/dl.c +++ b/src/dl.c @@ -148,7 +148,14 @@ xmlSecCryptoDLLibraryCreate(const xmlChar* name) { #endif /* XMLSEC_DL_LIBLTDL */ #ifdef XMLSEC_DL_WIN32 - lib->handle = LoadLibraryA((char*)lib->filename); +#if !defined(WINAPI_FAMILY) || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP + lib->handle = LoadLibraryA((char*)lib->filename); +#else + LPTSTR wcLib = NULL; + wcLib = xmlSecWin32ConvertUtf8ToTstr((char*)lib->filename); + if (wcLib) + lib->handle = LoadPackagedLibrary(wcLib, 0); +#endif if(lib->handle == NULL) { xmlSecIOError("LoadLibraryA", lib->filename, NULL); xmlSecCryptoDLLibraryDestroy(lib);