mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +00:00
[NTOS:MM] MiDereferenceSession: return as soon as session is destroyed
This leads to some simplifications in the following code.
This commit is contained in:
parent
dd08ae2c0f
commit
eac0afc6fe
1 changed files with 6 additions and 9 deletions
|
@ -364,10 +364,11 @@ MiDereferenceSession(VOID)
|
||||||
{
|
{
|
||||||
/* No more references left, kill the session completely */
|
/* No more references left, kill the session completely */
|
||||||
MiDereferenceSessionFinal();
|
MiDereferenceSessionFinal();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if tis is the session leader or the last process in the session */
|
/* Check if this is the session leader */
|
||||||
if ((Process->Vm.Flags.SessionLeader) || (ReferenceCount == 0))
|
if (Process->Vm.Flags.SessionLeader)
|
||||||
{
|
{
|
||||||
/* Get the global session address before we kill the session mapping */
|
/* Get the global session address before we kill the session mapping */
|
||||||
SessionGlobal = MmSessionSpace->GlobalVirtualAddress;
|
SessionGlobal = MmSessionSpace->GlobalVirtualAddress;
|
||||||
|
@ -377,13 +378,9 @@ MiDereferenceSession(VOID)
|
||||||
BYTES_TO_PAGES(MmSessionSize) * sizeof(MMPDE));
|
BYTES_TO_PAGES(MmSessionSize) * sizeof(MMPDE));
|
||||||
KeFlushEntireTb(FALSE, FALSE);
|
KeFlushEntireTb(FALSE, FALSE);
|
||||||
|
|
||||||
/* Is this the session leader? */
|
/* Clean up the references here. */
|
||||||
if (Process->Vm.Flags.SessionLeader)
|
ASSERT(Process->Session == NULL);
|
||||||
{
|
MiReleaseProcessReferenceToSessionDataPage(SessionGlobal);
|
||||||
/* Clean up the references here. */
|
|
||||||
ASSERT(Process->Session == NULL);
|
|
||||||
MiReleaseProcessReferenceToSessionDataPage(SessionGlobal);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset the current process' session flag */
|
/* Reset the current process' session flag */
|
||||||
|
|
Loading…
Reference in a new issue