Skip to content

Commit

Permalink
src,deps: replace LoadLibrary by LoadLibraryW
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
zcbenz authored and indutny committed Feb 8, 2016
1 parent 1258b01 commit cfafba6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deps/cares/src/ares_library_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,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;

Expand Down Expand Up @@ -78,7 +78,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)
Expand Down

0 comments on commit cfafba6

Please sign in to comment.