mirror of
https://github.com/reactos/reactos.git
synced 2025-06-27 10:19:44 +00:00
[RTL] Capture parameters with using SEH. Fixes new test for ntdll:RtlAllocateHeap
svn path=/trunk/; revision=72802
This commit is contained in:
parent
92e7c0979a
commit
28e32eb784
1 changed files with 18 additions and 3 deletions
|
@ -1256,8 +1256,23 @@ RtlCreateHeap(ULONG Flags,
|
||||||
Flags &= HEAP_CREATE_VALID_MASK;
|
Flags &= HEAP_CREATE_VALID_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: Capture parameters, once we decide to use SEH */
|
/* Capture parameters */
|
||||||
if (!Parameters) Parameters = &SafeParams;
|
if (Parameters)
|
||||||
|
{
|
||||||
|
_SEH2_TRY
|
||||||
|
{
|
||||||
|
/* If size of structure correct, then copy it */
|
||||||
|
if (Parameters->Length == sizeof(RTL_HEAP_PARAMETERS))
|
||||||
|
RtlCopyMemory(&SafeParams, Parameters, sizeof(RTL_HEAP_PARAMETERS));
|
||||||
|
}
|
||||||
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
{
|
||||||
|
_SEH2_YIELD(return NULL);
|
||||||
|
}
|
||||||
|
_SEH2_END;
|
||||||
|
}
|
||||||
|
|
||||||
|
Parameters = &SafeParams;
|
||||||
|
|
||||||
/* Check global flags */
|
/* Check global flags */
|
||||||
if (NtGlobalFlags & FLG_HEAP_DISABLE_COALESCING)
|
if (NtGlobalFlags & FLG_HEAP_DISABLE_COALESCING)
|
||||||
|
@ -1960,7 +1975,7 @@ RtlAllocateHeap(IN PVOID HeapPtr,
|
||||||
/* Add settable user flags, if any */
|
/* Add settable user flags, if any */
|
||||||
EntryFlags |= (Flags & HEAP_SETTABLE_USER_FLAGS) >> 4;
|
EntryFlags |= (Flags & HEAP_SETTABLE_USER_FLAGS) >> 4;
|
||||||
|
|
||||||
Index = AllocationSize >> HEAP_ENTRY_SHIFT;
|
Index = AllocationSize >> HEAP_ENTRY_SHIFT;
|
||||||
|
|
||||||
/* Acquire the lock if necessary */
|
/* Acquire the lock if necessary */
|
||||||
if (!(Flags & HEAP_NO_SERIALIZE))
|
if (!(Flags & HEAP_NO_SERIALIZE))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue