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 <bertbelder@gmail.com>
  • Loading branch information
zcbenz authored and rvagg committed Feb 9, 2016
1 parent f1a0827 commit b46f3b8
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 b46f3b8

Please sign in to comment.