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 bnoordhuis committed May 12, 2015
1 parent 0f850f7 commit 08d0866
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 @@ -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;

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

0 comments on commit 08d0866

Please sign in to comment.