summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows/winutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/windows/winutil.c')
-rw-r--r--src/osd/windows/winutil.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/osd/windows/winutil.c b/src/osd/windows/winutil.c
index adc78c36c75..c34e358492b 100644
--- a/src/osd/windows/winutil.c
+++ b/src/osd/windows/winutil.c
@@ -92,7 +92,7 @@ BOOL win_is_gui_application(void)
is_first_time = FALSE;
// get the current module
- module = GetModuleHandle(NULL);
+ module = GetModuleHandleUni();
if (!module)
return FALSE;
image_ptr = (BYTE*) module;
@@ -122,3 +122,14 @@ BOOL win_is_gui_application(void)
}
return is_gui_frontend;
}
+
+//-------------------------------------------------
+// Universal way to get module handle
+//-------------------------------------------------
+
+HMODULE WINAPI GetModuleHandleUni()
+{
+ MEMORY_BASIC_INFORMATION mbi;
+ VirtualQuery((LPCVOID)GetModuleHandleUni, &mbi, sizeof(mbi));
+ return (HMODULE)mbi.AllocationBase;
+}