mirror of
https://github.com/reactos/reactos.git
synced 2025-06-20 07:36:05 +00:00
[RTL] Implement RtlGetProcessHeaps
This commit is contained in:
parent
0ba94c83b5
commit
b8cdd1a879
3 changed files with 32 additions and 15 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue