Dan Kegel dank@kegel.com writes:
@@ -467,6 +475,156 @@ static void test_HeapQueryInformation(void) ok(info == 0 || info == 1 || info == 2, "expected 0, 1 or 2, got %u\n", info); }
+static LPVOID (WINAPI * pRtlAllocateHeap)(HANDLE,ULONG,ULONG); +static HANDLE (WINAPI * pRtlCreateHeap)(ULONG,PVOID,SIZE_T,SIZE_T,PVOID,PRTL_HEAP_DEFINITION); +static HANDLE (WINAPI * pRtlDestroyHeap)(HANDLE); +static NTSTATUS (WINAPI * pRtlFreeHeap)(HANDLE, ULONG, PVOID); +static ULONG (WINAPI * pRtlGetNtGlobalFlags)(void); +static LPVOID (WINAPI * pRtlReAllocateHeap)(HANDLE, ULONG, PVOID, ULONG); +static SIZE_T (WINAPI * pRtlSizeHeap)( HANDLE, ULONG, LPCVOID); +static BOOLEAN (WINAPI * pRtlValidateHeap)(HANDLE, ULONG, LPCVOID);
+static HMODULE hntdll;
Now that it's in kernel32 you should of course use the kernel32 heap functions instead.
@@ -348,7 +349,10 @@ HANDLE thread_init(void) peb->NtGlobalFlag = get_global_flag();
/* create the process heap */
- if (!(peb->ProcessHeap = RtlCreateHeap( HEAP_GROWABLE, NULL, 0, 0, NULL, NULL )))
- heapflags = HEAP_GROWABLE;
- if (peb->NtGlobalFlag & FLG_HEAP_ENABLE_FREE_CHECK)
heapflags |= HEAP_FREE_CHECKING_ENABLED;
- if (!(peb->ProcessHeap = RtlCreateHeap( heapflags, NULL, 0, 0, NULL, NULL )))
Is there any reason for not doing this for all created heaps, instead of just the main one?