Commit f7be0cf6 authored by Luca Bacci's avatar Luca Bacci Committed by Jehan
Browse files

Use LoadLibraryW ()

parent c98ffb7e
......@@ -285,7 +285,7 @@ gimp_backtrace_start (void)
HMODULE hModule;
DWORD options;
hModule = LoadLibraryA ("mgwhelp.dll");
hModule = LoadLibraryW (L"mgwhelp.dll");
#define INIT_PROC(name) \
G_STMT_START \
......
......@@ -216,7 +216,7 @@ gimp_input_device_store_init (GimpInputDeviceStore *store)
return;
}
if ((dinput8 = LoadLibrary ("dinput8.dll")) == NULL)
if ((dinput8 = LoadLibraryW (L"dinput8.dll")) == NULL)
{
g_set_error_literal (&store->error, GIMP_MODULE_ERROR, GIMP_MODULE_FAILED,
"Could not load dinput8.dll");
......
......@@ -61,7 +61,7 @@ LoadRequiredDwmFunctions (void)
{
if (dwmApi) return TRUE;
dwmApi = LoadLibrary ("dwmapi");
dwmApi = LoadLibraryW (L"dwmapi");
if (! dwmApi) return FALSE;
DwmGetWindowAttribute = (DWMGETWINDOWATTRIBUTE) GetProcAddress (dwmApi, "DwmGetWindowAttribute");
......
......@@ -112,7 +112,7 @@ BOOL LoadMagnificationLibrary(void)
{
if (magnificationLibrary) return TRUE;
magnificationLibrary = LoadLibrary("Magnification");
magnificationLibrary = LoadLibraryW(L"Magnification");
if (!magnificationLibrary) return FALSE;
MagInitialize = (MAGINITIALIZE)GetProcAddress(magnificationLibrary,"MagInitialize");
......
......@@ -1207,7 +1207,7 @@ BOOL
InitInstance (HINSTANCE hInstance,
int nCmdShow)
{
HINSTANCE User32Library = LoadLibrary ("user32.dll");
HINSTANCE User32Library = LoadLibraryW (L"user32.dll");
if (User32Library)
{
......
......@@ -9,6 +9,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <glib/glib.h>
#ifndef MAXPATHLEN
# define MAXPATHLEN 1024
#endif
......@@ -44,8 +46,17 @@ typedef void (*FARPROC)();
}
static HMODULE dl_attach(const char *module) {
HMODULE dll = LoadLibrary(module);
if (!dll) display_w32_error_msg(module);
wchar_t *module_utf16 = g_utf8_to_utf16 (module, -1, NULL, NULL, NULL);
HMODULE dll = NULL;
if (!module_utf16)
return NULL;
dll = LoadLibraryW (module_utf16);
if (!dll)
display_w32_error_msg (module);
free (module_utf16);
return dll;
}
......
......@@ -25,6 +25,7 @@
#include "twain.h"
/* The DLL to be loaded for TWAIN support */
#define TWAIN_DLL_NAME_W L"TWAIN_32.DLL"
#define TWAIN_DLL_NAME "TWAIN_32.DLL"
#define DEBUG_LOGFILE "c:\\twain.log"
#define DUMP_FILE "C:\\TWAINCAP.BIN"
......
......@@ -92,7 +92,7 @@ twainIsAvailable(void)
}
/* Attempt to load the library */
hDLL = LoadLibrary(TWAIN_DLL_NAME);
hDLL = LoadLibraryW (TWAIN_DLL_NAME_W);
if (hDLL == NULL)
return FALSE;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment