mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:52:57 +00:00
[NTOSKRNL] On session last reference removal, dereference LUID device map
This commit is contained in:
parent
ad80715b1a
commit
5ecc05003d
1 changed files with 26 additions and 2 deletions
|
@ -392,7 +392,7 @@ SepRmReferenceLogonSession(
|
||||||
if (RtlEqualLuid(&CurrentSession->LogonId, LogonLuid))
|
if (RtlEqualLuid(&CurrentSession->LogonId, LogonLuid))
|
||||||
{
|
{
|
||||||
/* Reference the session */
|
/* Reference the session */
|
||||||
CurrentSession->ReferenceCount += 1;
|
++CurrentSession->ReferenceCount;
|
||||||
DPRINT("ReferenceCount: %lu\n", CurrentSession->ReferenceCount);
|
DPRINT("ReferenceCount: %lu\n", CurrentSession->ReferenceCount);
|
||||||
|
|
||||||
/* Release the database lock */
|
/* Release the database lock */
|
||||||
|
@ -409,10 +409,21 @@ SepRmReferenceLogonSession(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
SepCleanupLUIDDeviceMapDirectory(
|
||||||
|
PLUID LogonLuid)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
SepRmDereferenceLogonSession(
|
SepRmDereferenceLogonSession(
|
||||||
PLUID LogonLuid)
|
PLUID LogonLuid)
|
||||||
{
|
{
|
||||||
|
ULONG RefCount;
|
||||||
|
PDEVICE_MAP DeviceMap;
|
||||||
PSEP_LOGON_SESSION_REFERENCES CurrentSession;
|
PSEP_LOGON_SESSION_REFERENCES CurrentSession;
|
||||||
|
|
||||||
DPRINT("SepRmDereferenceLogonSession(%08lx:%08lx)\n",
|
DPRINT("SepRmDereferenceLogonSession(%08lx:%08lx)\n",
|
||||||
|
@ -430,12 +441,25 @@ SepRmDereferenceLogonSession(
|
||||||
if (RtlEqualLuid(&CurrentSession->LogonId, LogonLuid))
|
if (RtlEqualLuid(&CurrentSession->LogonId, LogonLuid))
|
||||||
{
|
{
|
||||||
/* Dereference the session */
|
/* Dereference the session */
|
||||||
CurrentSession->ReferenceCount -= 1;
|
RefCount = --CurrentSession->ReferenceCount;
|
||||||
DPRINT("ReferenceCount: %lu\n", CurrentSession->ReferenceCount);
|
DPRINT("ReferenceCount: %lu\n", CurrentSession->ReferenceCount);
|
||||||
|
|
||||||
/* Release the database lock */
|
/* Release the database lock */
|
||||||
KeReleaseGuardedMutex(&SepRmDbLock);
|
KeReleaseGuardedMutex(&SepRmDbLock);
|
||||||
|
|
||||||
|
/* We're done with the session */
|
||||||
|
if (RefCount == 0)
|
||||||
|
{
|
||||||
|
/* Get rid of the LUID device map */
|
||||||
|
DeviceMap = CurrentSession->pDeviceMap;
|
||||||
|
if (DeviceMap != NULL)
|
||||||
|
{
|
||||||
|
CurrentSession->pDeviceMap = NULL;
|
||||||
|
SepCleanupLUIDDeviceMapDirectory(LogonLuid);
|
||||||
|
ObfDereferenceDeviceMap(DeviceMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue