mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
Keep usermode stack 4-byte aligned
svn path=/trunk/; revision=13227
This commit is contained in:
parent
e9c80bcd6f
commit
c377a52fa4
1 changed files with 2 additions and 1 deletions
|
@ -292,7 +292,8 @@ NtW32Call (IN ULONG RoutineIndex,
|
|||
memcpy((char*)NewStack + StackSize - sizeof(KTRAP_FRAME) - sizeof(FX_SAVE_AREA),
|
||||
Thread->Tcb.TrapFrame, sizeof(KTRAP_FRAME) - (4 * sizeof(DWORD)));
|
||||
NewFrame = (PKTRAP_FRAME)((char*)NewStack + StackSize - sizeof(KTRAP_FRAME) - sizeof(FX_SAVE_AREA));
|
||||
NewFrame->Esp -= (ArgumentLength + (4 * sizeof(ULONG)));
|
||||
/* We need the stack pointer to remain 4-byte aligned */
|
||||
NewFrame->Esp -= (((ArgumentLength + 3) & (~ 0x3)) + (4 * sizeof(ULONG)));
|
||||
NewFrame->Eip = (ULONG)LdrpGetSystemDllCallbackDispatcher();
|
||||
UserEsp = (PULONG)NewFrame->Esp;
|
||||
UserEsp[0] = 0; /* Return address. */
|
||||
|
|
Loading…
Reference in a new issue