mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 12:36:51 +00:00
[NTOS:KE] Fix stack alignment issues
This commit is contained in:
parent
2a2d0903bf
commit
69e8cb635a
2 changed files with 24 additions and 5 deletions
|
@ -66,7 +66,7 @@ KiInitializeUserApc(
|
|||
_SEH2_TRY
|
||||
{
|
||||
/* Probe the context */
|
||||
ProbeForWrite(Context, sizeof(CONTEXT), 16);
|
||||
ProbeForWrite(Context, sizeof(CONTEXT), 16);
|
||||
|
||||
/* Convert the current trap frame to a context */
|
||||
Context->ContextFlags = CONTEXT_FULL | CONTEXT_DEBUG_REGISTERS;
|
||||
|
@ -253,8 +253,11 @@ KeUserModeCallback(
|
|||
/* Enter a SEH Block */
|
||||
_SEH2_TRY
|
||||
{
|
||||
/* Calculate and align the stack size */
|
||||
UserArguments = (PUCHAR)ALIGN_DOWN_POINTER_BY(OldStack - ArgumentLength, sizeof(PVOID));
|
||||
/* Calculate and align the stack. This is unaligned by 8 bytes, since the following
|
||||
UCALLOUT_FRAME compensates for that and on entry we already have a full stack
|
||||
frame with home space for the next call, i.e. we are already inside the function
|
||||
body and the stack needs to be 16 byte aligned. */
|
||||
UserArguments = (PUCHAR)ALIGN_DOWN_POINTER_BY(OldStack - ArgumentLength, 16) - 8;
|
||||
|
||||
/* The callout frame is below the arguments */
|
||||
CalloutFrame = ((PUCALLOUT_FRAME)UserArguments) - 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue