mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[RTL] Implement RtlGetProcessHeaps
This commit is contained in:
+2
-15
@@ -3756,7 +3756,7 @@ BOOLEAN NTAPI RtlValidateHeap(
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
* @unimplemented
|
||||
*/
|
||||
NTSTATUS NTAPI
|
||||
RtlEnumProcessHeaps(PHEAP_ENUMERATION_ROUTINE HeapEnumerationRoutine,
|
||||
@@ -3766,21 +3766,8 @@ RtlEnumProcessHeaps(PHEAP_ENUMERATION_ROUTINE HeapEnumerationRoutine,
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
ULONG NTAPI
|
||||
RtlGetProcessHeaps(ULONG count,
|
||||
HANDLE *heaps)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
* @unimplemented
|
||||
*/
|
||||
BOOLEAN NTAPI
|
||||
RtlValidateProcessHeaps(VOID)
|
||||
|
||||
@@ -339,6 +339,7 @@ BOOLEAN NTAPI
|
||||
RtlpValidateHeapHeaders(PHEAP Heap, BOOLEAN Recalculate);
|
||||
|
||||
/* heapdbg.c */
|
||||
NTSYSAPI
|
||||
HANDLE NTAPI
|
||||
RtlDebugCreateHeap(ULONG Flags,
|
||||
PVOID Addr,
|
||||
|
||||
@@ -127,3 +127,32 @@ RtlInitializeHeapManager(VOID)
|
||||
RtlInitializeCriticalSection(&RtlpProcessHeapsListLock);
|
||||
}
|
||||
|
||||
ULONG NTAPI
|
||||
RtlGetProcessHeaps(_In_ ULONG HeapCount, _Out_cap_(HeapCount) HANDLE *HeapArray)
|
||||
{
|
||||
PPEB Peb = RtlGetCurrentPeb();
|
||||
|
||||
RtlEnterCriticalSection(&RtlpProcessHeapsListLock);
|
||||
ULONG nHeaps = Peb->NumberOfHeaps;
|
||||
|
||||
_SEH2_TRY
|
||||
{
|
||||
if (HeapArray)
|
||||
{
|
||||
for (ULONG n = 0; n < min(nHeaps, HeapCount); ++n)
|
||||
{
|
||||
HeapArray[n] = Peb->ProcessHeaps[n];
|
||||
}
|
||||
}
|
||||
}
|
||||
_SEH2_FINALLY
|
||||
{
|
||||
RtlLeaveCriticalSection(&RtlpProcessHeapsListLock);
|
||||
}
|
||||
_SEH2_END;
|
||||
|
||||
/* TODO: Add RtlpDphPageHeapList here */
|
||||
|
||||
return nHeaps;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user