Project

General

Profile

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

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

View differences:

win32/win32.c
5863 5863
#ifdef _WIN32_WCE
5864 5864
    return FALSE;
5865 5865
#else
5866
    const void *const func = WriteConsoleW;
5867 5866
    HMODULE k;
5867
    FARPROC func;
5868 5868
    MEMORY_BASIC_INFORMATION m;
5869 5869

  
5870
    k = GetModuleHandle("kernel32");
5871
    if (!k) return FALSE;
5872
    func = GetProcAddress(k, "WriteConsoleW");
5873
    if (!func) return FALSE;
5870 5874
    memset(&m, 0, sizeof(m));
5871 5875
    if (!VirtualQuery(func, &m, sizeof(m))) {
5872 5876
	return FALSE;
5873 5877
    }
5874
    k = GetModuleHandle("kernel32.dll");
5875
    if (!k) return FALSE;
5876 5878
    return (HMODULE)m.AllocationBase != k;
5877 5879
#endif
5878 5880
}