Skip to content

Commit 08d0866

Browse files
zcbenzbnoordhuis
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: nodejs#226 Reviewed-By: Bert Belder <[email protected]>
1 parent 0f850f7 commit 08d0866

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
@@ -45,7 +45,7 @@ static int ares_win32_init(void)
4545
#ifdef USE_WINSOCK
4646

4747
hnd_iphlpapi = 0;
48-
hnd_iphlpapi = LoadLibrary("iphlpapi.dll");
48+
hnd_iphlpapi = LoadLibraryW(L"iphlpapi.dll");
4949
if (!hnd_iphlpapi)
5050
return ARES_ELOADIPHLPAPI;
5151

@@ -73,7 +73,7 @@ static int ares_win32_init(void)
7373
*/
7474

7575
hnd_advapi32 = 0;
76-
hnd_advapi32 = LoadLibrary("advapi32.dll");
76+
hnd_advapi32 = LoadLibraryW(L"advapi32.dll");
7777
if (hnd_advapi32)
7878
{
7979
ares_fpSystemFunction036 = (fpSystemFunction036_t)

0 commit comments

Comments
 (0)