From: Rémi Bernon rbernon@codeweavers.com
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/kernelbase/memory.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/kernelbase/memory.c b/dlls/kernelbase/memory.c index 9490626a40a..cac456d01be 100644 --- a/dlls/kernelbase/memory.c +++ b/dlls/kernelbase/memory.c @@ -640,9 +640,24 @@ struct rtl_heap_entry */ BOOL WINAPI DECLSPEC_HOTPATCH HeapWalk( HANDLE heap, PROCESS_HEAP_ENTRY *entry ) { - struct rtl_heap_entry rtl_entry = {.lpData = entry->lpData}; + struct rtl_heap_entry rtl_entry = {0}; NTSTATUS status;
+ if (!entry) return set_ntstatus( STATUS_INVALID_PARAMETER ); + + rtl_entry.lpData = entry->lpData; + rtl_entry.cbData = entry->cbData; + rtl_entry.cbOverhead = entry->cbOverhead; + rtl_entry.iRegionIndex = entry->iRegionIndex; + + if (entry->wFlags & PROCESS_HEAP_ENTRY_BUSY) + rtl_entry.wFlags |= RTL_HEAP_ENTRY_BUSY; + if (entry->wFlags & PROCESS_HEAP_REGION) + rtl_entry.wFlags |= RTL_HEAP_ENTRY_REGION; + if (entry->wFlags & PROCESS_HEAP_UNCOMMITTED_RANGE) + rtl_entry.wFlags |= RTL_HEAP_ENTRY_UNCOMMITTED; + memcpy( &rtl_entry.Region, &entry->u.Region, sizeof(entry->u.Region) ); + if (!(status = RtlWalkHeap( heap, &rtl_entry ))) { entry->lpData = rtl_entry.lpData;