Project

General

Profile

Bug #9208 ยป 001-win32-console.patch

snaury (Alexey Borzenkov), 12/04/2013 05:17 AM

View differences:

win32/win32.c
#ifdef _WIN32_WCE
return FALSE;
#else
const void *const func = WriteConsoleW;
HMODULE k;
FARPROC func;
MEMORY_BASIC_INFORMATION m;
k = GetModuleHandle("kernel32");
if (!k) return FALSE;
func = GetProcAddress(k, "WriteConsoleW");
if (!func) return FALSE;
memset(&m, 0, sizeof(m));
if (!VirtualQuery(func, &m, sizeof(m))) {
return FALSE;
}
k = GetModuleHandle("kernel32.dll");
if (!k) return FALSE;
return (HMODULE)m.AllocationBase != k;
#endif
}
    (1-1/1)