- Fix one more leak when converting from non-gui to GUI thread stack.

svn path=/trunk/; revision=20839
This commit is contained in:
Alex Ionescu
2006-01-13 22:23:31 +00:00
parent 65ef48820e
commit d03c6f0016
3 changed files with 23 additions and 3 deletions
+21 -1
View File
@@ -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]
+1 -1
View File
@@ -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);
+1 -1
View File
@@ -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 */