Commit 0d213639 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

winevulkan: Set zero_bits correctly for large address aware applications on Wow64.

parent f93d7114
...@@ -41,10 +41,7 @@ static BOOL use_external_memory(void) ...@@ -41,10 +41,7 @@ static BOOL use_external_memory(void)
return is_wow64(); return is_wow64();
} }
static ULONG_PTR zero_bits(void) static ULONG_PTR zero_bits = 0;
{
return is_wow64() ? 0x7fffffff : 0;
}
#define wine_vk_count_struct(s, t) wine_vk_count_struct_((void *)s, VK_STRUCTURE_TYPE_##t) #define wine_vk_count_struct(s, t) wine_vk_count_struct_((void *)s, VK_STRUCTURE_TYPE_##t)
static uint32_t wine_vk_count_struct_(void *s, VkStructureType t) static uint32_t wine_vk_count_struct_(void *s, VkStructureType t)
...@@ -471,6 +468,14 @@ NTSTATUS init_vulkan(void *args) ...@@ -471,6 +468,14 @@ NTSTATUS init_vulkan(void *args)
return STATUS_UNSUCCESSFUL; return STATUS_UNSUCCESSFUL;
} }
if (is_wow64())
{
SYSTEM_BASIC_INFORMATION info;
NtQuerySystemInformation(SystemEmulationBasicInformation, &info, sizeof(info), NULL);
zero_bits = (ULONG_PTR)info.HighestUserAddress | 0x7fffffff;
}
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
...@@ -1519,7 +1524,7 @@ VkResult wine_vkAllocateMemory(VkDevice handle, const VkMemoryAllocateInfo *allo ...@@ -1519,7 +1524,7 @@ VkResult wine_vkAllocateMemory(VkDevice handle, const VkMemoryAllocateInfo *allo
if (!once++) if (!once++)
FIXME("Using VK_EXT_external_memory_host\n"); FIXME("Using VK_EXT_external_memory_host\n");
if (NtAllocateVirtualMemory(GetCurrentProcess(), &mapping, zero_bits(), &alloc_size, if (NtAllocateVirtualMemory(GetCurrentProcess(), &mapping, zero_bits, &alloc_size,
MEM_COMMIT, PAGE_READWRITE)) MEM_COMMIT, PAGE_READWRITE))
{ {
ERR("NtAllocateVirtualMemory failed\n"); ERR("NtAllocateVirtualMemory failed\n");
......
Markdown is supported
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