src,deps: replace LoadLibrary by LoadLibraryW
authorCheng Zhao <zcbenz@gmail.com>
Wed, 31 Dec 2014 20:38:08 +0000 (12:38 -0800)
committerBen Noordhuis <info@bnoordhuis.nl>
Tue, 12 May 2015 08:47:51 +0000 (10:47 +0200)
On Windows, when compiling with `UNICODE` defined, `LoadLibrary` becomes
`LoadLibraryW`. When an ASCII string is passed to that function it
crashes.

PR-URL: https://github.com/iojs/io.js/pull/226
Reviewed-By: Bert Belder <bertbelder@gmail.com>
deps/cares/src/ares_library_init.c

index 770e7c2..9114f62 100644 (file)
@@ -45,7 +45,7 @@ static int ares_win32_init(void)
 #ifdef USE_WINSOCK
 
   hnd_iphlpapi = 0;
-  hnd_iphlpapi = LoadLibrary("iphlpapi.dll");
+  hnd_iphlpapi = LoadLibraryW(L"iphlpapi.dll");
   if (!hnd_iphlpapi)
     return ARES_ELOADIPHLPAPI;
 
@@ -73,7 +73,7 @@ static int ares_win32_init(void)
    */
 
   hnd_advapi32 = 0;
-  hnd_advapi32 = LoadLibrary("advapi32.dll");
+  hnd_advapi32 = LoadLibraryW(L"advapi32.dll");
   if (hnd_advapi32)
     {
       ares_fpSystemFunction036 = (fpSystemFunction036_t)