gwin32: Always use unicode APIs

Instead of the legacy ANSI ones. This also means GLib behaves correctly
when built with unicode preprocessor defines.
This commit is contained in:
Ole André Vadla Ravnås
2018-08-15 22:25:08 +02:00
parent 01b77666bc
commit 0ab51f8d4e
8 changed files with 85 additions and 57 deletions

View File

@@ -39,20 +39,20 @@ static void
lookup_funcs (void)
{
HMODULE winhttp = NULL;
char winhttp_dll[MAX_PATH + 100];
WCHAR winhttp_dll[MAX_PATH + 100];
int n;
if (lookup_done)
return;
n = GetSystemDirectory (winhttp_dll, MAX_PATH);
n = GetSystemDirectoryW (winhttp_dll, MAX_PATH);
if (n > 0 && n < MAX_PATH)
{
if (winhttp_dll[n-1] != '\\' &&
winhttp_dll[n-1] != '/')
strcat (winhttp_dll, "\\");
strcat (winhttp_dll, "winhttp.dll");
winhttp = LoadLibrary (winhttp_dll);
if (winhttp_dll[n-1] != L'\\' &&
winhttp_dll[n-1] != L'/')
wcscat (winhttp_dll, L"\\");
wcscat (winhttp_dll, L"winhttp.dll");
winhttp = LoadLibraryW (winhttp_dll);
}
if (winhttp != NULL)