Skip to content

Commit b46f3b8

Browse files
zcbenzrvagg
authored andcommitted
src,deps: replace LoadLibrary by LoadLibraryW
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes `LoadLibraryW`. When an ASCII string is passed to that function it crashes. PR-URL: #226 Reviewed-By: Bert Belder <[email protected]>
1 parent f1a0827 commit b46f3b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

deps/cares/src/ares_library_init.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static int ares_win32_init(void)
5050
#ifdef USE_WINSOCK
5151

5252
hnd_iphlpapi = 0;
53-
hnd_iphlpapi = LoadLibrary("iphlpapi.dll");
53+
hnd_iphlpapi = LoadLibraryW(L"iphlpapi.dll");
5454
if (!hnd_iphlpapi)
5555
return ARES_ELOADIPHLPAPI;
5656

@@ -78,7 +78,7 @@ static int ares_win32_init(void)
7878
*/
7979

8080
hnd_advapi32 = 0;
81-
hnd_advapi32 = LoadLibrary("advapi32.dll");
81+
hnd_advapi32 = LoadLibraryW(L"advapi32.dll");
8282
if (hnd_advapi32)
8383
{
8484
ares_fpSystemFunction036 = (fpSystemFunction036_t)

0 commit comments

Comments
 (0)