mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
- Fix one more leak when converting from non-gui to GUI thread stack.
svn path=/trunk/; revision=20839
This commit is contained in:
@@ -358,6 +358,26 @@ NoStack:
|
||||
|
||||
.endfunc
|
||||
|
||||
/*++
|
||||
* @name KeSwitchKernelStack
|
||||
*
|
||||
* The KeSwitchKernelStack routine switches from the current thread's stack
|
||||
* to the new specified base and limit.
|
||||
*
|
||||
* @param StackBase
|
||||
* Pointer to the new Stack Base of the thread.
|
||||
*
|
||||
* @param StackLimit
|
||||
* Pointer to the new Stack Limit of the thread.
|
||||
*
|
||||
* @return The previous Stack Limit of the thread.
|
||||
*
|
||||
* @remark This routine should typically only be used when converting from a
|
||||
* non-GUI to a GUI Thread. The caller is responsible for freeing the
|
||||
* previous stack. The new stack values MUST be valid before calling
|
||||
* this routine.
|
||||
*
|
||||
*--*/
|
||||
.globl _KeSwitchKernelStack@8
|
||||
.func KeSwitchKernelStack@8
|
||||
_KeSwitchKernelStack@8:
|
||||
@@ -400,7 +420,7 @@ _KeSwitchKernelStack@8:
|
||||
pop edi
|
||||
|
||||
/* Save old stack base and get new limit/base */
|
||||
mov eax, [edx+KTHREAD_STACK_BASE]
|
||||
mov eax, [edx+KTHREAD_STACK_LIMIT]
|
||||
mov ecx, [esp+12]
|
||||
mov esi, [esp+16]
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ PspDeleteThread(PVOID ObjectBody)
|
||||
if(Thread->Tcb.Win32Thread != NULL) ExFreePool (Thread->Tcb.Win32Thread);
|
||||
|
||||
/* Release the Kernel Stack */
|
||||
MmDeleteKernelStack((PVOID)Thread->Tcb.StackLimit, Thread->Tcb.StackLimit);
|
||||
MmDeleteKernelStack((PVOID)Thread->Tcb.StackLimit, Thread->Tcb.LargeStack);
|
||||
|
||||
/* Dereference the Process */
|
||||
ObDereferenceObject(Process);
|
||||
|
||||
@@ -122,7 +122,7 @@ PsConvertToGuiThread(VOID)
|
||||
KeLeaveCriticalRegion();
|
||||
|
||||
/* Delete the old stack */
|
||||
//MmDeleteKernelStack(OldStack, FALSE);
|
||||
MmDeleteKernelStack(OldStack, FALSE);
|
||||
}
|
||||
|
||||
/* This check is bizare. Check out win32k later */
|
||||
|
||||
Reference in New Issue
Block a user