mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-01 12:53:37 +00:00
win32u: Support wow64 in NtAllocateVirtualMemory calls.
This commit is contained in:
parent
2b6647cdd5
commit
149e750240
|
@ -112,8 +112,8 @@ static DC_ATTR *alloc_dc_attr(void)
|
|||
{
|
||||
SIZE_T size = system_info.AllocationGranularity;
|
||||
bucket->entries = NULL;
|
||||
if (!NtAllocateVirtualMemory( GetCurrentProcess(), (void **)&bucket->entries, 0, &size,
|
||||
MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE ))
|
||||
if (!NtAllocateVirtualMemory( GetCurrentProcess(), (void **)&bucket->entries, zero_bits(),
|
||||
&size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE ))
|
||||
{
|
||||
bucket->next_free = NULL;
|
||||
bucket->next_unused = bucket->entries + 1;
|
||||
|
|
|
@ -1548,8 +1548,8 @@ HBITMAP WINAPI NtGdiCreateDIBSection( HDC hdc, HANDLE section, DWORD offset, con
|
|||
{
|
||||
SIZE_T size = bmp->dib.dsBmih.biSizeImage;
|
||||
offset = 0;
|
||||
if (NtAllocateVirtualMemory( GetCurrentProcess(), &bmp->dib.dsBm.bmBits, 0, &size,
|
||||
MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE ))
|
||||
if (NtAllocateVirtualMemory( GetCurrentProcess(), &bmp->dib.dsBm.bmBits, zero_bits(),
|
||||
&size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE ))
|
||||
goto error;
|
||||
}
|
||||
bmp->dib.dshSection = section;
|
||||
|
|
|
@ -566,8 +566,8 @@ static void init_gdi_shared(void)
|
|||
{
|
||||
SIZE_T size = sizeof(*gdi_shared);
|
||||
|
||||
if (NtAllocateVirtualMemory( GetCurrentProcess(), (void **)&gdi_shared, 0, &size,
|
||||
MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE ))
|
||||
if (NtAllocateVirtualMemory( GetCurrentProcess(), (void **)&gdi_shared, zero_bits(),
|
||||
&size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE ))
|
||||
return;
|
||||
next_unused = gdi_shared->Handles + FIRST_GDI_HANDLE;
|
||||
|
||||
|
|
|
@ -494,6 +494,15 @@ static inline BOOL is_win9x(void)
|
|||
return NtCurrentTeb()->Peb->OSPlatformId == VER_PLATFORM_WIN32s;
|
||||
}
|
||||
|
||||
static inline ULONG_PTR zero_bits(void)
|
||||
{
|
||||
#ifdef _WIN64
|
||||
return !NtCurrentTeb()->WowTebOffset ? 0 : 0x7fffffff;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline const char *debugstr_us( const UNICODE_STRING *us )
|
||||
{
|
||||
if (!us) return "<null>";
|
||||
|
|
Loading…
Reference in a new issue