ntdll: Fail loudly if RtlActivateActivationContextEx fails to allocate memory.

Many built-in callers of ActivateActCtx() just assume that it will
always succeed.  If it ever fails, then DeactivateActCtx() will notice
that the cookie is invalid and raise an exception anyway.
This commit is contained in:
Jinoh Kang 2023-07-13 23:17:11 +09:00 committed by Alexandre Julliard
parent e77a9eda74
commit 86893ce299

View file

@ -5423,9 +5423,7 @@ NTSTATUS WINAPI RtlActivateActivationContextEx( ULONG flags, TEB *teb, HANDLE ha
ACTIVATION_CONTEXT_STACK *actctx_stack = teb->ActivationContextStackPointer;
RTL_ACTIVATION_CONTEXT_STACK_FRAME *frame;
if (!(frame = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*frame) )))
return STATUS_NO_MEMORY;
frame = RtlAllocateHeap( GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, sizeof(*frame) );
frame->Previous = actctx_stack->ActiveFrame;
frame->ActivationContext = handle;
frame->Flags = 0;