2008-03-09 14:11:42 +00:00
|
|
|
/*
|
2001-10-10 21:49:15 +00:00
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS kernel
|
|
|
|
* FILE: ntoskrnl/cc/pin.c
|
|
|
|
* PURPOSE: Implements cache managers pinning interface
|
2005-01-26 13:58:37 +00:00
|
|
|
*
|
2016-05-26 12:09:05 +00:00
|
|
|
* PROGRAMMERS: ?
|
|
|
|
Pierre Schweitzer (pierre@reactos.org)
|
2001-10-10 21:49:15 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
|
2004-08-15 16:39:12 +00:00
|
|
|
#include <ntoskrnl.h>
|
2001-10-10 21:49:15 +00:00
|
|
|
#define NDEBUG
|
2008-08-30 16:31:06 +00:00
|
|
|
#include <debug.h>
|
2001-10-10 21:49:15 +00:00
|
|
|
|
|
|
|
/* GLOBALS *******************************************************************/
|
|
|
|
|
2003-01-11 15:22:31 +00:00
|
|
|
extern NPAGED_LOOKASIDE_LIST iBcbLookasideList;
|
2001-10-10 21:49:15 +00:00
|
|
|
|
2018-02-24 12:35:17 +00:00
|
|
|
/* Counters:
|
|
|
|
* - Number of calls to CcMapData that could wait
|
|
|
|
* - Number of calls to CcMapData that couldn't wait
|
2018-02-24 12:47:15 +00:00
|
|
|
* - Number of calls to CcPinRead that could wait
|
|
|
|
* - Number of calls to CcPinRead that couldn't wait
|
2018-10-13 20:50:49 +00:00
|
|
|
* - Number of calls to CcPinMappedDataCount
|
2018-02-24 12:35:17 +00:00
|
|
|
*/
|
2018-02-24 12:28:45 +00:00
|
|
|
ULONG CcMapDataWait = 0;
|
|
|
|
ULONG CcMapDataNoWait = 0;
|
2018-02-24 12:47:15 +00:00
|
|
|
ULONG CcPinReadWait = 0;
|
|
|
|
ULONG CcPinReadNoWait = 0;
|
2018-10-13 20:50:49 +00:00
|
|
|
ULONG CcPinMappedDataCount = 0;
|
2018-02-24 12:28:45 +00:00
|
|
|
|
2003-01-11 15:22:31 +00:00
|
|
|
/* FUNCTIONS *****************************************************************/
|
2001-10-10 21:49:15 +00:00
|
|
|
|
2018-10-11 21:15:01 +00:00
|
|
|
static
|
|
|
|
PINTERNAL_BCB
|
|
|
|
NTAPI
|
|
|
|
CcpFindBcb(
|
|
|
|
IN PROS_SHARED_CACHE_MAP SharedCacheMap,
|
|
|
|
IN PLARGE_INTEGER FileOffset,
|
|
|
|
IN ULONG Length,
|
|
|
|
IN BOOLEAN Pinned)
|
|
|
|
{
|
|
|
|
PINTERNAL_BCB Bcb;
|
|
|
|
BOOLEAN Found = FALSE;
|
|
|
|
PLIST_ENTRY NextEntry;
|
|
|
|
|
|
|
|
for (NextEntry = SharedCacheMap->BcbList.Flink;
|
|
|
|
NextEntry != &SharedCacheMap->BcbList;
|
|
|
|
NextEntry = NextEntry->Flink)
|
|
|
|
{
|
|
|
|
Bcb = CONTAINING_RECORD(NextEntry, INTERNAL_BCB, BcbEntry);
|
|
|
|
|
|
|
|
if (Bcb->PFCB.MappedFileOffset.QuadPart <= FileOffset->QuadPart &&
|
|
|
|
(Bcb->PFCB.MappedFileOffset.QuadPart + Bcb->PFCB.MappedLength) >=
|
|
|
|
(FileOffset->QuadPart + Length))
|
|
|
|
{
|
|
|
|
if ((Pinned && Bcb->PinCount > 0) || (!Pinned && Bcb->PinCount == 0))
|
|
|
|
{
|
|
|
|
Found = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return (Found ? Bcb : NULL);
|
|
|
|
}
|
|
|
|
|
2018-09-09 09:14:42 +00:00
|
|
|
static
|
2010-12-28 14:49:53 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
2018-09-09 09:14:42 +00:00
|
|
|
CcpMapData(
|
2018-10-05 19:01:02 +00:00
|
|
|
IN PROS_SHARED_CACHE_MAP SharedCacheMap,
|
2012-12-19 11:11:34 +00:00
|
|
|
IN PLARGE_INTEGER FileOffset,
|
|
|
|
IN ULONG Length,
|
|
|
|
IN ULONG Flags,
|
2018-10-13 20:46:10 +00:00
|
|
|
OUT PROS_VACB *pVacb,
|
2012-12-19 11:11:34 +00:00
|
|
|
OUT PVOID *pBuffer)
|
2001-10-10 21:49:15 +00:00
|
|
|
{
|
2018-10-27 07:30:22 +00:00
|
|
|
LONGLONG ReadOffset, BaseOffset;
|
2010-12-28 14:49:53 +00:00
|
|
|
BOOLEAN Valid;
|
2014-04-12 09:31:07 +00:00
|
|
|
PROS_VACB Vacb;
|
2010-12-28 14:49:53 +00:00
|
|
|
NTSTATUS Status;
|
2018-01-13 20:27:29 +00:00
|
|
|
LONGLONG ROffset;
|
2005-05-09 01:38:29 +00:00
|
|
|
|
2018-01-13 20:27:29 +00:00
|
|
|
ReadOffset = FileOffset->QuadPart;
|
2008-01-19 17:24:52 +00:00
|
|
|
|
2014-04-12 11:19:38 +00:00
|
|
|
DPRINT("SectionSize %I64x, FileSize %I64x\n",
|
|
|
|
SharedCacheMap->SectionSize.QuadPart,
|
2014-04-12 10:59:48 +00:00
|
|
|
SharedCacheMap->FileSize.QuadPart);
|
2005-05-09 01:38:29 +00:00
|
|
|
|
2013-09-30 19:40:09 +00:00
|
|
|
if (ReadOffset % VACB_MAPPING_GRANULARITY + Length > VACB_MAPPING_GRANULARITY)
|
2002-07-17 21:04:57 +00:00
|
|
|
{
|
2014-11-29 21:43:39 +00:00
|
|
|
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx -> FALSE\n",
|
2018-10-05 19:01:02 +00:00
|
|
|
SharedCacheMap->FileObject, FileOffset, Length, Flags);
|
2010-12-28 14:49:53 +00:00
|
|
|
return FALSE;
|
2002-07-17 21:04:57 +00:00
|
|
|
}
|
2012-12-19 11:11:34 +00:00
|
|
|
|
[NTOSKRNL] Warn about unimplemented feature in CcMapData() (in all callers)
Currently, our CcMapData() behavior (same goes for CcPinRead()) is broken
and is the total opposite of what Windows kernel does. By default, the later
will let you map a view in memory without even attempting to bring its
data in memory. On first access, there will be a fault and memory will
be read from the hardware and brought to memory. If you want to force read
on mapping/pinning, you have to set the MAP_NO_READ (or PIN_NO_READ) flag
where kernel will fault on your behalf (hence the need for MAP_WAIT/PIN_WAIT).
On ReactOS, by default, on mapping (and thus pinning), we will force a view
read so that data is in memory. The way our cache memory is managed at the
moment seems not to allow to fault on invalid access and if we don't force
read, the memory content will just be zeroed.
So trying to match Windows behavior, by default, now CcMapData() will enforce
the MAP_NO_READ flag and warn once about this behavior change.
2018-08-31 17:43:04 +00:00
|
|
|
if (!BooleanFlagOn(Flags, MAP_NO_READ))
|
|
|
|
{
|
|
|
|
static int Warned = 0;
|
|
|
|
|
|
|
|
SetFlag(Flags, MAP_NO_READ);
|
|
|
|
if (!Warned)
|
|
|
|
{
|
|
|
|
DPRINT1("Mapping/pinning with no read not implemented. Forcing read, might fail if wait not allowed\n");
|
|
|
|
Warned++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-27 07:30:22 +00:00
|
|
|
/* Properly round offset and call internal helper for getting a VACB */
|
2013-09-30 19:40:09 +00:00
|
|
|
ROffset = ROUND_DOWN(ReadOffset, VACB_MAPPING_GRANULARITY);
|
2018-10-27 07:30:22 +00:00
|
|
|
Status = CcRosGetVacb(SharedCacheMap,
|
|
|
|
ROffset,
|
|
|
|
&BaseOffset,
|
|
|
|
pBuffer,
|
|
|
|
&Valid,
|
|
|
|
&Vacb);
|
2010-12-28 14:49:53 +00:00
|
|
|
if (!NT_SUCCESS(Status))
|
2002-07-17 21:04:57 +00:00
|
|
|
{
|
2014-11-29 21:43:39 +00:00
|
|
|
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx -> FALSE\n",
|
2018-10-05 19:01:02 +00:00
|
|
|
SharedCacheMap->FileObject, FileOffset, Length, Flags);
|
2016-07-10 14:46:37 +00:00
|
|
|
ExRaiseStatus(Status);
|
2010-12-28 14:49:53 +00:00
|
|
|
return FALSE;
|
2002-07-17 21:04:57 +00:00
|
|
|
}
|
2012-12-19 11:11:34 +00:00
|
|
|
|
[NTOSKRNL] Warn about unimplemented feature in CcMapData() (in all callers)
Currently, our CcMapData() behavior (same goes for CcPinRead()) is broken
and is the total opposite of what Windows kernel does. By default, the later
will let you map a view in memory without even attempting to bring its
data in memory. On first access, there will be a fault and memory will
be read from the hardware and brought to memory. If you want to force read
on mapping/pinning, you have to set the MAP_NO_READ (or PIN_NO_READ) flag
where kernel will fault on your behalf (hence the need for MAP_WAIT/PIN_WAIT).
On ReactOS, by default, on mapping (and thus pinning), we will force a view
read so that data is in memory. The way our cache memory is managed at the
moment seems not to allow to fault on invalid access and if we don't force
read, the memory content will just be zeroed.
So trying to match Windows behavior, by default, now CcMapData() will enforce
the MAP_NO_READ flag and warn once about this behavior change.
2018-08-31 17:43:04 +00:00
|
|
|
if (!Valid && BooleanFlagOn(Flags, MAP_NO_READ))
|
2002-07-17 21:04:57 +00:00
|
|
|
{
|
[NTOSKRNL] Warn about unimplemented feature in CcMapData() (in all callers)
Currently, our CcMapData() behavior (same goes for CcPinRead()) is broken
and is the total opposite of what Windows kernel does. By default, the later
will let you map a view in memory without even attempting to bring its
data in memory. On first access, there will be a fault and memory will
be read from the hardware and brought to memory. If you want to force read
on mapping/pinning, you have to set the MAP_NO_READ (or PIN_NO_READ) flag
where kernel will fault on your behalf (hence the need for MAP_WAIT/PIN_WAIT).
On ReactOS, by default, on mapping (and thus pinning), we will force a view
read so that data is in memory. The way our cache memory is managed at the
moment seems not to allow to fault on invalid access and if we don't force
read, the memory content will just be zeroed.
So trying to match Windows behavior, by default, now CcMapData() will enforce
the MAP_NO_READ flag and warn once about this behavior change.
2018-08-31 17:43:04 +00:00
|
|
|
if (!BooleanFlagOn(Flags, MAP_WAIT))
|
2010-12-28 14:49:53 +00:00
|
|
|
{
|
2014-04-12 10:59:48 +00:00
|
|
|
CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE);
|
2014-11-29 21:43:39 +00:00
|
|
|
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx -> FALSE\n",
|
2018-10-05 19:01:02 +00:00
|
|
|
SharedCacheMap->FileObject, FileOffset, Length, Flags);
|
2010-12-28 14:49:53 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2012-12-19 11:11:34 +00:00
|
|
|
|
2016-07-10 14:46:37 +00:00
|
|
|
Status = CcReadVirtualAddress(Vacb);
|
|
|
|
if (!NT_SUCCESS(Status))
|
2010-12-28 14:49:53 +00:00
|
|
|
{
|
2014-04-12 10:59:48 +00:00
|
|
|
CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE);
|
2014-11-29 21:43:39 +00:00
|
|
|
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx -> FALSE\n",
|
2018-10-05 19:01:02 +00:00
|
|
|
SharedCacheMap->FileObject, FileOffset, Length, Flags);
|
2016-07-10 14:46:37 +00:00
|
|
|
ExRaiseStatus(Status);
|
2012-12-19 11:11:34 +00:00
|
|
|
return FALSE;
|
2010-12-28 14:49:53 +00:00
|
|
|
}
|
2002-07-17 21:04:57 +00:00
|
|
|
}
|
2005-07-05 00:57:47 +00:00
|
|
|
|
2018-01-13 20:27:29 +00:00
|
|
|
*pBuffer = (PUCHAR)*pBuffer + ReadOffset % VACB_MAPPING_GRANULARITY;
|
2018-10-13 20:46:10 +00:00
|
|
|
*pVacb = Vacb;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2018-10-28 19:48:01 +00:00
|
|
|
static
|
|
|
|
VOID
|
|
|
|
CcpDereferenceBcb(
|
|
|
|
IN PROS_SHARED_CACHE_MAP SharedCacheMap,
|
|
|
|
IN PINTERNAL_BCB Bcb)
|
|
|
|
{
|
|
|
|
ULONG RefCount;
|
|
|
|
KIRQL OldIrql;
|
|
|
|
|
|
|
|
KeAcquireSpinLock(&SharedCacheMap->BcbSpinLock, &OldIrql);
|
|
|
|
RefCount = --Bcb->RefCount;
|
|
|
|
if (RefCount == 0)
|
|
|
|
{
|
|
|
|
RemoveEntryList(&Bcb->BcbEntry);
|
|
|
|
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
|
|
|
|
|
|
|
ASSERT(Bcb->PinCount == 0);
|
2019-04-17 20:23:57 +00:00
|
|
|
/*
|
|
|
|
* Don't mark dirty, if it was dirty,
|
|
|
|
* the VACB was already marked as such
|
|
|
|
* following the call to CcSetDirtyPinnedData
|
|
|
|
*/
|
2018-10-28 19:48:01 +00:00
|
|
|
CcRosReleaseVacb(SharedCacheMap,
|
|
|
|
Bcb->Vacb,
|
|
|
|
TRUE,
|
2019-04-17 20:23:57 +00:00
|
|
|
FALSE,
|
2018-10-28 19:48:01 +00:00
|
|
|
FALSE);
|
|
|
|
|
|
|
|
ExDeleteResourceLite(&Bcb->Lock);
|
|
|
|
ExFreeToNPagedLookasideList(&iBcbLookasideList, Bcb);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-13 20:46:10 +00:00
|
|
|
static
|
|
|
|
PVOID
|
|
|
|
CcpGetAppropriateBcb(
|
|
|
|
IN PROS_SHARED_CACHE_MAP SharedCacheMap,
|
|
|
|
IN PROS_VACB Vacb,
|
|
|
|
IN PLARGE_INTEGER FileOffset,
|
|
|
|
IN ULONG Length,
|
|
|
|
IN ULONG PinFlags,
|
|
|
|
IN BOOLEAN ToPin)
|
|
|
|
{
|
|
|
|
KIRQL OldIrql;
|
|
|
|
BOOLEAN Result;
|
|
|
|
PINTERNAL_BCB iBcb, DupBcb;
|
|
|
|
|
2010-12-28 14:49:53 +00:00
|
|
|
iBcb = ExAllocateFromNPagedLookasideList(&iBcbLookasideList);
|
|
|
|
if (iBcb == NULL)
|
2002-07-17 21:04:57 +00:00
|
|
|
{
|
2014-04-12 10:59:48 +00:00
|
|
|
CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
|
2018-10-13 20:46:10 +00:00
|
|
|
return NULL;
|
2002-07-17 21:04:57 +00:00
|
|
|
}
|
2012-12-19 11:11:34 +00:00
|
|
|
|
2013-09-30 20:06:18 +00:00
|
|
|
RtlZeroMemory(iBcb, sizeof(*iBcb));
|
2010-12-28 14:49:53 +00:00
|
|
|
iBcb->PFCB.NodeTypeCode = 0xDE45; /* Undocumented (CAPTIVE_PUBLIC_BCB_NODETYPECODE) */
|
|
|
|
iBcb->PFCB.NodeByteSize = sizeof(PUBLIC_BCB);
|
|
|
|
iBcb->PFCB.MappedLength = Length;
|
|
|
|
iBcb->PFCB.MappedFileOffset = *FileOffset;
|
2014-04-12 09:31:07 +00:00
|
|
|
iBcb->Vacb = Vacb;
|
2018-10-05 17:43:10 +00:00
|
|
|
iBcb->PinCount = 0;
|
2010-12-28 14:49:53 +00:00
|
|
|
iBcb->RefCount = 1;
|
2016-05-26 12:09:05 +00:00
|
|
|
ExInitializeResourceLite(&iBcb->Lock);
|
2012-12-19 11:11:34 +00:00
|
|
|
|
2018-10-13 20:46:10 +00:00
|
|
|
KeAcquireSpinLock(&SharedCacheMap->BcbSpinLock, &OldIrql);
|
|
|
|
|
|
|
|
/* Check if we raced with another BCB creation */
|
|
|
|
DupBcb = CcpFindBcb(SharedCacheMap, FileOffset, Length, ToPin);
|
|
|
|
/* Yes, and we've lost */
|
|
|
|
if (DupBcb != NULL)
|
2018-10-05 19:01:02 +00:00
|
|
|
{
|
2018-10-28 19:48:01 +00:00
|
|
|
/* We will return that BCB */
|
|
|
|
++DupBcb->RefCount;
|
2018-10-13 20:46:10 +00:00
|
|
|
Result = TRUE;
|
2018-10-28 19:48:01 +00:00
|
|
|
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
2018-10-13 20:46:10 +00:00
|
|
|
|
|
|
|
if (ToPin)
|
|
|
|
{
|
|
|
|
if (BooleanFlagOn(PinFlags, PIN_EXCLUSIVE))
|
|
|
|
{
|
|
|
|
Result = ExAcquireResourceExclusiveLite(&iBcb->Lock, BooleanFlagOn(PinFlags, PIN_WAIT));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Result = ExAcquireSharedStarveExclusive(&iBcb->Lock, BooleanFlagOn(PinFlags, PIN_WAIT));
|
|
|
|
}
|
|
|
|
|
2018-10-28 19:48:01 +00:00
|
|
|
if (Result)
|
|
|
|
{
|
|
|
|
DupBcb->PinCount++;
|
|
|
|
}
|
|
|
|
else
|
2018-10-13 20:46:10 +00:00
|
|
|
{
|
2018-10-28 19:48:01 +00:00
|
|
|
CcpDereferenceBcb(SharedCacheMap, DupBcb);
|
2018-10-13 20:46:10 +00:00
|
|
|
DupBcb = NULL;
|
|
|
|
}
|
|
|
|
}
|
2018-10-05 19:01:02 +00:00
|
|
|
|
2018-10-28 19:48:01 +00:00
|
|
|
if (DupBcb != NULL)
|
2018-10-05 19:01:02 +00:00
|
|
|
{
|
2018-10-28 19:48:01 +00:00
|
|
|
/* Delete the loser */
|
|
|
|
CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
|
|
|
|
ExDeleteResourceLite(&iBcb->Lock);
|
|
|
|
ExFreeToNPagedLookasideList(&iBcbLookasideList, iBcb);
|
2018-10-13 20:46:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Return the winner - no need to update buffer address, it's
|
|
|
|
* relative to the VACB, which is unchanged.
|
|
|
|
*/
|
|
|
|
iBcb = DupBcb;
|
|
|
|
}
|
|
|
|
/* Nope, insert ourselves */
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ToPin)
|
|
|
|
{
|
|
|
|
iBcb->PinCount++;
|
|
|
|
|
|
|
|
if (BooleanFlagOn(PinFlags, PIN_EXCLUSIVE))
|
|
|
|
{
|
|
|
|
Result = ExAcquireResourceExclusiveLite(&iBcb->Lock, BooleanFlagOn(PinFlags, PIN_WAIT));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Result = ExAcquireSharedStarveExclusive(&iBcb->Lock, BooleanFlagOn(PinFlags, PIN_WAIT));
|
|
|
|
}
|
|
|
|
|
|
|
|
ASSERT(Result);
|
|
|
|
}
|
|
|
|
|
|
|
|
InsertTailList(&SharedCacheMap->BcbList, &iBcb->BcbEntry);
|
2018-10-28 19:48:01 +00:00
|
|
|
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
2018-10-13 20:46:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return iBcb;
|
|
|
|
}
|
|
|
|
|
|
|
|
static
|
|
|
|
BOOLEAN
|
|
|
|
CcpPinData(
|
|
|
|
IN PROS_SHARED_CACHE_MAP SharedCacheMap,
|
|
|
|
IN PLARGE_INTEGER FileOffset,
|
|
|
|
IN ULONG Length,
|
|
|
|
IN ULONG Flags,
|
|
|
|
OUT PVOID * Bcb,
|
|
|
|
OUT PVOID * Buffer)
|
|
|
|
{
|
|
|
|
PINTERNAL_BCB NewBcb;
|
|
|
|
BOOLEAN Result;
|
|
|
|
PROS_VACB Vacb;
|
|
|
|
KIRQL OldIrql;
|
2018-10-23 19:48:01 +00:00
|
|
|
ULONG MapFlags;
|
2018-10-13 20:46:10 +00:00
|
|
|
|
|
|
|
KeAcquireSpinLock(&SharedCacheMap->BcbSpinLock, &OldIrql);
|
|
|
|
NewBcb = CcpFindBcb(SharedCacheMap, FileOffset, Length, TRUE);
|
2018-10-11 21:15:01 +00:00
|
|
|
|
2018-10-13 20:46:10 +00:00
|
|
|
if (NewBcb != NULL)
|
|
|
|
{
|
2018-10-28 19:48:01 +00:00
|
|
|
++NewBcb->RefCount;
|
|
|
|
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
2018-10-13 20:46:10 +00:00
|
|
|
|
|
|
|
if (BooleanFlagOn(Flags, PIN_EXCLUSIVE))
|
|
|
|
{
|
|
|
|
Result = ExAcquireResourceExclusiveLite(&NewBcb->Lock, BooleanFlagOn(Flags, PIN_WAIT));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Result = ExAcquireSharedStarveExclusive(&NewBcb->Lock, BooleanFlagOn(Flags, PIN_WAIT));
|
|
|
|
}
|
2018-10-11 21:15:01 +00:00
|
|
|
|
2018-10-13 20:46:10 +00:00
|
|
|
if (!Result)
|
|
|
|
{
|
2018-10-28 19:48:01 +00:00
|
|
|
CcpDereferenceBcb(SharedCacheMap, NewBcb);
|
|
|
|
NewBcb = NULL;
|
2018-10-11 21:15:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-10-28 19:48:01 +00:00
|
|
|
NewBcb->PinCount++;
|
2018-10-13 20:46:10 +00:00
|
|
|
*Bcb = NewBcb;
|
|
|
|
*Buffer = (PUCHAR)NewBcb->Vacb->BaseAddress + FileOffset->QuadPart % VACB_MAPPING_GRANULARITY;
|
2018-10-05 19:01:02 +00:00
|
|
|
}
|
2018-10-13 20:46:10 +00:00
|
|
|
|
|
|
|
return Result;
|
2018-10-11 21:15:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2018-10-28 19:48:01 +00:00
|
|
|
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
|
|
|
|
2018-10-13 20:46:10 +00:00
|
|
|
if (BooleanFlagOn(Flags, PIN_IF_BCB))
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2018-10-23 19:48:01 +00:00
|
|
|
MapFlags = Flags & PIN_WAIT;
|
|
|
|
if (BooleanFlagOn(Flags, PIN_NO_READ))
|
|
|
|
{
|
|
|
|
SetFlag(MapFlags, MAP_NO_READ);
|
|
|
|
}
|
|
|
|
|
|
|
|
Result = CcpMapData(SharedCacheMap, FileOffset, Length, MapFlags, &Vacb, Buffer);
|
2018-10-13 20:46:10 +00:00
|
|
|
if (Result)
|
|
|
|
{
|
|
|
|
NewBcb = CcpGetAppropriateBcb(SharedCacheMap, Vacb, FileOffset, Length, Flags, TRUE);
|
|
|
|
if (NewBcb == NULL)
|
|
|
|
{
|
|
|
|
CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
|
|
|
|
Result = FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*Bcb = NewBcb;
|
|
|
|
}
|
|
|
|
}
|
2018-10-05 19:01:02 +00:00
|
|
|
}
|
|
|
|
|
2018-10-13 20:46:10 +00:00
|
|
|
return Result;
|
2018-10-05 19:01:02 +00:00
|
|
|
}
|
|
|
|
|
2018-09-09 09:14:42 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
CcMapData (
|
|
|
|
IN PFILE_OBJECT FileObject,
|
|
|
|
IN PLARGE_INTEGER FileOffset,
|
|
|
|
IN ULONG Length,
|
|
|
|
IN ULONG Flags,
|
|
|
|
OUT PVOID *pBcb,
|
|
|
|
OUT PVOID *pBuffer)
|
|
|
|
{
|
|
|
|
BOOLEAN Ret;
|
2018-10-05 19:01:02 +00:00
|
|
|
KIRQL OldIrql;
|
|
|
|
PINTERNAL_BCB iBcb;
|
2018-10-13 20:46:10 +00:00
|
|
|
PROS_VACB Vacb;
|
2018-10-05 19:01:02 +00:00
|
|
|
PROS_SHARED_CACHE_MAP SharedCacheMap;
|
2018-09-09 09:14:42 +00:00
|
|
|
|
|
|
|
DPRINT("CcMapData(FileObject 0x%p, FileOffset %I64x, Length %lu, Flags 0x%lx,"
|
|
|
|
" pBcb 0x%p, pBuffer 0x%p)\n", FileObject, FileOffset->QuadPart,
|
|
|
|
Length, Flags, pBcb, pBuffer);
|
|
|
|
|
2018-10-05 19:01:02 +00:00
|
|
|
ASSERT(FileObject);
|
|
|
|
ASSERT(FileObject->SectionObjectPointer);
|
|
|
|
ASSERT(FileObject->SectionObjectPointer->SharedCacheMap);
|
|
|
|
|
|
|
|
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
|
|
|
|
ASSERT(SharedCacheMap);
|
|
|
|
|
2018-09-09 09:14:42 +00:00
|
|
|
if (Flags & MAP_WAIT)
|
|
|
|
{
|
|
|
|
++CcMapDataWait;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
++CcMapDataNoWait;
|
|
|
|
}
|
|
|
|
|
2018-10-05 19:01:02 +00:00
|
|
|
KeAcquireSpinLock(&SharedCacheMap->BcbSpinLock, &OldIrql);
|
|
|
|
iBcb = CcpFindBcb(SharedCacheMap, FileOffset, Length, FALSE);
|
|
|
|
|
|
|
|
if (iBcb == NULL)
|
|
|
|
{
|
2018-10-28 19:48:01 +00:00
|
|
|
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
|
|
|
|
2018-10-13 20:46:10 +00:00
|
|
|
Ret = CcpMapData(SharedCacheMap, FileOffset, Length, Flags, &Vacb, pBuffer);
|
|
|
|
if (Ret)
|
|
|
|
{
|
|
|
|
iBcb = CcpGetAppropriateBcb(SharedCacheMap, Vacb, FileOffset, Length, 0, FALSE);
|
|
|
|
if (iBcb == NULL)
|
|
|
|
{
|
|
|
|
CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE);
|
|
|
|
Ret = FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*pBcb = iBcb;
|
|
|
|
}
|
|
|
|
}
|
2018-10-05 19:01:02 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
++iBcb->RefCount;
|
2018-10-28 19:48:01 +00:00
|
|
|
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
|
|
|
|
2018-10-05 19:01:02 +00:00
|
|
|
*pBcb = iBcb;
|
|
|
|
*pBuffer = (PUCHAR)iBcb->Vacb->BaseAddress + FileOffset->QuadPart % VACB_MAPPING_GRANULARITY;
|
|
|
|
Ret = TRUE;
|
|
|
|
}
|
2018-09-09 09:14:42 +00:00
|
|
|
|
|
|
|
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx -> %d Bcb=%p\n",
|
|
|
|
FileObject, FileOffset, Length, Flags, Ret, *pBcb);
|
|
|
|
return Ret;
|
|
|
|
}
|
|
|
|
|
2003-07-10 06:27:13 +00:00
|
|
|
/*
|
2004-06-21 04:11:44 +00:00
|
|
|
* @unimplemented
|
2003-07-10 06:27:13 +00:00
|
|
|
*/
|
2004-06-21 04:11:44 +00:00
|
|
|
BOOLEAN
|
2008-11-29 20:47:48 +00:00
|
|
|
NTAPI
|
2004-06-21 04:11:44 +00:00
|
|
|
CcPinMappedData (
|
2012-12-19 11:11:34 +00:00
|
|
|
IN PFILE_OBJECT FileObject,
|
|
|
|
IN PLARGE_INTEGER FileOffset,
|
|
|
|
IN ULONG Length,
|
|
|
|
IN ULONG Flags,
|
|
|
|
OUT PVOID * Bcb)
|
2001-10-10 21:49:15 +00:00
|
|
|
{
|
2018-08-26 20:04:46 +00:00
|
|
|
BOOLEAN Result;
|
2018-10-13 20:46:10 +00:00
|
|
|
PVOID Buffer;
|
2018-08-26 19:49:05 +00:00
|
|
|
PINTERNAL_BCB iBcb;
|
2016-05-26 11:50:42 +00:00
|
|
|
PROS_SHARED_CACHE_MAP SharedCacheMap;
|
|
|
|
|
2018-08-31 17:48:03 +00:00
|
|
|
CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%p Length=%lu Flags=0x%lx\n",
|
2014-11-29 21:43:39 +00:00
|
|
|
FileObject, FileOffset, Length, Flags);
|
|
|
|
|
2016-05-26 11:50:42 +00:00
|
|
|
ASSERT(FileObject);
|
|
|
|
ASSERT(FileObject->SectionObjectPointer);
|
|
|
|
ASSERT(FileObject->SectionObjectPointer->SharedCacheMap);
|
|
|
|
|
|
|
|
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
|
|
|
|
ASSERT(SharedCacheMap);
|
2018-09-01 10:39:05 +00:00
|
|
|
if (!SharedCacheMap->PinAccess)
|
|
|
|
{
|
|
|
|
DPRINT1("FIXME: Pinning a file with no pin access!\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2016-05-26 11:50:42 +00:00
|
|
|
|
2018-08-26 19:49:05 +00:00
|
|
|
iBcb = *Bcb;
|
|
|
|
|
2018-10-13 20:50:49 +00:00
|
|
|
++CcPinMappedDataCount;
|
|
|
|
|
2018-10-13 20:46:10 +00:00
|
|
|
Result = CcpPinData(SharedCacheMap, FileOffset, Length, Flags, Bcb, &Buffer);
|
|
|
|
if (Result)
|
2018-08-26 20:56:25 +00:00
|
|
|
{
|
2018-10-13 20:46:10 +00:00
|
|
|
CcUnpinData(iBcb);
|
2018-08-26 20:56:25 +00:00
|
|
|
}
|
|
|
|
|
2018-08-26 20:04:46 +00:00
|
|
|
return Result;
|
2004-06-21 04:11:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
BOOLEAN
|
2008-11-29 20:47:48 +00:00
|
|
|
NTAPI
|
2004-06-21 04:11:44 +00:00
|
|
|
CcPinRead (
|
2012-12-19 11:11:34 +00:00
|
|
|
IN PFILE_OBJECT FileObject,
|
|
|
|
IN PLARGE_INTEGER FileOffset,
|
|
|
|
IN ULONG Length,
|
|
|
|
IN ULONG Flags,
|
|
|
|
OUT PVOID * Bcb,
|
|
|
|
OUT PVOID * Buffer)
|
2004-06-21 04:11:44 +00:00
|
|
|
{
|
2018-10-05 19:01:02 +00:00
|
|
|
PROS_SHARED_CACHE_MAP SharedCacheMap;
|
|
|
|
|
2014-11-29 21:43:39 +00:00
|
|
|
CCTRACE(CC_API_DEBUG, "FileOffset=%p FileOffset=%p Length=%lu Flags=0x%lx\n",
|
|
|
|
FileObject, FileOffset, Length, Flags);
|
|
|
|
|
2018-10-05 19:01:02 +00:00
|
|
|
ASSERT(FileObject);
|
|
|
|
ASSERT(FileObject->SectionObjectPointer);
|
|
|
|
ASSERT(FileObject->SectionObjectPointer->SharedCacheMap);
|
|
|
|
|
|
|
|
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
|
|
|
|
ASSERT(SharedCacheMap);
|
2018-10-13 20:46:10 +00:00
|
|
|
if (!SharedCacheMap->PinAccess)
|
|
|
|
{
|
|
|
|
DPRINT1("FIXME: Pinning a file with no pin access!\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2018-10-05 19:01:02 +00:00
|
|
|
|
2018-02-24 12:47:15 +00:00
|
|
|
if (Flags & PIN_WAIT)
|
|
|
|
{
|
|
|
|
++CcPinReadWait;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
++CcPinReadNoWait;
|
|
|
|
}
|
|
|
|
|
2018-10-13 20:46:10 +00:00
|
|
|
return CcpPinData(SharedCacheMap, FileOffset, Length, Flags, Bcb, Buffer);
|
2004-06-21 04:11:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
BOOLEAN
|
2008-11-29 20:47:48 +00:00
|
|
|
NTAPI
|
2004-06-21 04:11:44 +00:00
|
|
|
CcPreparePinWrite (
|
2012-12-19 11:11:34 +00:00
|
|
|
IN PFILE_OBJECT FileObject,
|
|
|
|
IN PLARGE_INTEGER FileOffset,
|
|
|
|
IN ULONG Length,
|
|
|
|
IN BOOLEAN Zero,
|
|
|
|
IN ULONG Flags,
|
|
|
|
OUT PVOID * Bcb,
|
|
|
|
OUT PVOID * Buffer)
|
2004-06-21 04:11:44 +00:00
|
|
|
{
|
2014-11-29 21:43:39 +00:00
|
|
|
CCTRACE(CC_API_DEBUG, "FileOffset=%p FileOffset=%p Length=%lu Zero=%d Flags=0x%lx\n",
|
|
|
|
FileObject, FileOffset, Length, Zero, Flags);
|
|
|
|
|
2012-12-19 11:11:34 +00:00
|
|
|
/*
|
|
|
|
* FIXME: This is function is similar to CcPinRead, but doesn't
|
|
|
|
* read the data if they're not present. Instead it should just
|
2014-11-15 22:47:51 +00:00
|
|
|
* prepare the VACBs and zero them out if Zero != FALSE.
|
2012-12-19 11:11:34 +00:00
|
|
|
*
|
|
|
|
* For now calling CcPinRead is better than returning error or
|
|
|
|
* just having UNIMPLEMENTED here.
|
|
|
|
*/
|
|
|
|
return CcPinRead(FileObject, FileOffset, Length, Flags, Bcb, Buffer);
|
2001-10-10 21:49:15 +00:00
|
|
|
}
|
|
|
|
|
2003-07-10 06:27:13 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2008-11-29 20:47:48 +00:00
|
|
|
VOID NTAPI
|
2012-12-19 11:11:34 +00:00
|
|
|
CcSetDirtyPinnedData (
|
|
|
|
IN PVOID Bcb,
|
|
|
|
IN PLARGE_INTEGER Lsn)
|
2001-10-10 21:49:15 +00:00
|
|
|
{
|
2012-12-19 11:11:34 +00:00
|
|
|
PINTERNAL_BCB iBcb = Bcb;
|
2014-11-29 21:43:39 +00:00
|
|
|
|
|
|
|
CCTRACE(CC_API_DEBUG, "Bcb=%p Lsn=%p\n",
|
|
|
|
Bcb, Lsn);
|
|
|
|
|
2018-04-29 18:34:28 +00:00
|
|
|
if (!iBcb->Vacb->Dirty)
|
|
|
|
{
|
|
|
|
CcRosMarkDirtyVacb(iBcb->Vacb);
|
|
|
|
}
|
2001-10-10 21:49:15 +00:00
|
|
|
}
|
|
|
|
|
2004-06-21 04:11:44 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2008-11-29 20:47:48 +00:00
|
|
|
VOID NTAPI
|
2012-12-19 11:11:34 +00:00
|
|
|
CcUnpinData (
|
|
|
|
IN PVOID Bcb)
|
2004-06-21 04:11:44 +00:00
|
|
|
{
|
2014-11-29 21:43:39 +00:00
|
|
|
CCTRACE(CC_API_DEBUG, "Bcb=%p\n", Bcb);
|
|
|
|
|
2016-05-26 12:09:05 +00:00
|
|
|
CcUnpinDataForThread(Bcb, (ERESOURCE_THREAD)PsGetCurrentThread());
|
2004-06-21 04:11:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
VOID
|
2008-11-29 20:47:48 +00:00
|
|
|
NTAPI
|
2004-06-21 04:11:44 +00:00
|
|
|
CcUnpinDataForThread (
|
2012-12-19 11:11:34 +00:00
|
|
|
IN PVOID Bcb,
|
|
|
|
IN ERESOURCE_THREAD ResourceThreadId)
|
2004-06-21 04:11:44 +00:00
|
|
|
{
|
2016-03-20 18:33:54 +00:00
|
|
|
PINTERNAL_BCB iBcb = Bcb;
|
2018-10-28 19:48:01 +00:00
|
|
|
PROS_SHARED_CACHE_MAP SharedCacheMap;
|
2016-03-20 18:33:54 +00:00
|
|
|
|
2014-11-29 21:43:39 +00:00
|
|
|
CCTRACE(CC_API_DEBUG, "Bcb=%p ResourceThreadId=%lu\n", Bcb, ResourceThreadId);
|
|
|
|
|
2018-10-05 17:43:10 +00:00
|
|
|
if (iBcb->PinCount != 0)
|
2016-03-20 18:33:54 +00:00
|
|
|
{
|
2016-05-26 12:09:05 +00:00
|
|
|
ExReleaseResourceForThreadLite(&iBcb->Lock, ResourceThreadId);
|
2018-10-05 17:43:10 +00:00
|
|
|
iBcb->PinCount--;
|
2016-03-20 18:33:54 +00:00
|
|
|
}
|
|
|
|
|
2018-10-28 19:48:01 +00:00
|
|
|
SharedCacheMap = iBcb->Vacb->SharedCacheMap;
|
|
|
|
CcpDereferenceBcb(SharedCacheMap, iBcb);
|
2004-06-21 04:11:44 +00:00
|
|
|
}
|
2004-08-25 15:08:29 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
VOID
|
2008-11-29 20:47:48 +00:00
|
|
|
NTAPI
|
2004-08-25 15:08:29 +00:00
|
|
|
CcRepinBcb (
|
2012-12-19 11:11:34 +00:00
|
|
|
IN PVOID Bcb)
|
2004-08-25 15:08:29 +00:00
|
|
|
{
|
2012-12-19 11:11:34 +00:00
|
|
|
PINTERNAL_BCB iBcb = Bcb;
|
2014-11-29 21:43:39 +00:00
|
|
|
|
|
|
|
CCTRACE(CC_API_DEBUG, "Bcb=%p\n", Bcb);
|
|
|
|
|
2012-12-19 11:11:34 +00:00
|
|
|
iBcb->RefCount++;
|
2004-08-25 15:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
VOID
|
2008-11-29 20:47:48 +00:00
|
|
|
NTAPI
|
2004-08-25 15:08:29 +00:00
|
|
|
CcUnpinRepinnedBcb (
|
2012-12-19 11:11:34 +00:00
|
|
|
IN PVOID Bcb,
|
|
|
|
IN BOOLEAN WriteThrough,
|
|
|
|
IN PIO_STATUS_BLOCK IoStatus)
|
2004-08-25 15:08:29 +00:00
|
|
|
{
|
2012-12-19 11:11:34 +00:00
|
|
|
PINTERNAL_BCB iBcb = Bcb;
|
2018-09-02 12:37:47 +00:00
|
|
|
KIRQL OldIrql;
|
|
|
|
PROS_SHARED_CACHE_MAP SharedCacheMap;
|
2004-08-25 15:08:29 +00:00
|
|
|
|
2014-11-29 21:43:39 +00:00
|
|
|
CCTRACE(CC_API_DEBUG, "Bcb=%p WriteThrough=%d\n", Bcb, WriteThrough);
|
|
|
|
|
2018-10-28 19:48:01 +00:00
|
|
|
SharedCacheMap = iBcb->Vacb->SharedCacheMap;
|
2012-12-19 23:49:13 +00:00
|
|
|
IoStatus->Status = STATUS_SUCCESS;
|
2018-10-28 19:48:01 +00:00
|
|
|
|
|
|
|
KeAcquireSpinLock(&SharedCacheMap->BcbSpinLock, &OldIrql);
|
2012-12-19 11:11:34 +00:00
|
|
|
if (--iBcb->RefCount == 0)
|
2004-08-25 15:08:29 +00:00
|
|
|
{
|
2018-10-28 19:48:01 +00:00
|
|
|
RemoveEntryList(&iBcb->BcbEntry);
|
|
|
|
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
|
|
|
|
2012-12-19 11:11:34 +00:00
|
|
|
IoStatus->Information = 0;
|
|
|
|
if (WriteThrough)
|
2004-08-25 15:08:29 +00:00
|
|
|
{
|
2014-04-12 09:31:07 +00:00
|
|
|
if (iBcb->Vacb->Dirty)
|
2004-08-25 15:08:29 +00:00
|
|
|
{
|
2014-04-12 09:31:07 +00:00
|
|
|
IoStatus->Status = CcRosFlushVacb(iBcb->Vacb);
|
2004-08-25 15:08:29 +00:00
|
|
|
}
|
2012-12-19 11:11:34 +00:00
|
|
|
else
|
2004-08-25 15:08:29 +00:00
|
|
|
{
|
2012-12-19 11:11:34 +00:00
|
|
|
IoStatus->Status = STATUS_SUCCESS;
|
2004-08-25 15:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
2012-12-19 11:11:34 +00:00
|
|
|
else
|
2004-08-25 15:08:29 +00:00
|
|
|
{
|
2012-12-19 11:11:34 +00:00
|
|
|
IoStatus->Status = STATUS_SUCCESS;
|
2004-08-25 15:08:29 +00:00
|
|
|
}
|
|
|
|
|
2018-10-05 17:43:10 +00:00
|
|
|
if (iBcb->PinCount != 0)
|
2016-05-26 12:09:05 +00:00
|
|
|
{
|
|
|
|
ExReleaseResourceLite(&iBcb->Lock);
|
2018-10-05 17:43:10 +00:00
|
|
|
iBcb->PinCount--;
|
|
|
|
ASSERT(iBcb->PinCount == 0);
|
2016-05-26 12:09:05 +00:00
|
|
|
}
|
2018-03-17 10:56:25 +00:00
|
|
|
|
2019-04-17 20:23:57 +00:00
|
|
|
/*
|
|
|
|
* Don't mark dirty, if it was dirty,
|
|
|
|
* the VACB was already marked as such
|
|
|
|
* following the call to CcSetDirtyPinnedData
|
|
|
|
*/
|
2018-03-17 10:56:25 +00:00
|
|
|
CcRosReleaseVacb(iBcb->Vacb->SharedCacheMap,
|
|
|
|
iBcb->Vacb,
|
|
|
|
TRUE,
|
2019-04-17 20:23:57 +00:00
|
|
|
FALSE,
|
2018-03-17 10:56:25 +00:00
|
|
|
FALSE);
|
|
|
|
|
2016-05-26 12:09:05 +00:00
|
|
|
ExDeleteResourceLite(&iBcb->Lock);
|
2012-12-19 11:11:34 +00:00
|
|
|
ExFreeToNPagedLookasideList(&iBcbLookasideList, iBcb);
|
2004-08-25 15:08:29 +00:00
|
|
|
}
|
2018-10-28 19:48:01 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
|
|
|
}
|
2004-08-25 15:08:29 +00:00
|
|
|
}
|