ReactOS  0.4.15-dev-3165-gdf6fff7
newcc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _NOCC_BCB
 
struct  _NOCC_CACHE_MAP
 

Macros

#define CcpFlushCache(M, F, L, I, D)   _CcpFlushCache(M,F,L,I,D,__FILE__,__LINE__)
 
#define KEBUGCHECKCC
 
#define CACHE_SINGLE_FILE_MAX   (16)
 
#define CACHE_OVERALL_SIZE   (32 * 1024 * 1024)
 
#define CACHE_STRIPE   VACB_MAPPING_GRANULARITY
 
#define CACHE_SHIFT   18
 
#define CACHE_NUM_SECTIONS   (CACHE_OVERALL_SIZE / CACHE_STRIPE)
 
#define CACHE_ROUND_UP(x)   (((x) + (CACHE_STRIPE-1)) & ~(CACHE_STRIPE-1))
 
#define CACHE_ROUND_DOWN(x)   ((x) & ~(CACHE_STRIPE-1))
 
#define INVALID_CACHE   ((ULONG)~0)
 
#define CcpLock()   _CcpLock(__FILE__,__LINE__)
 
#define CcpUnlock()   _CcpUnlock(__FILE__,__LINE__)
 

Typedefs

typedef struct _NOCC_BCB NOCC_BCB
 
typedef struct _NOCC_BCBPNOCC_BCB
 
typedef struct _NOCC_CACHE_MAP NOCC_CACHE_MAP
 
typedef struct _NOCC_CACHE_MAPPNOCC_CACHE_MAP
 

Functions

VOID NTAPI CcPfInitializePrefetcher (VOID)
 
VOID NTAPI CcMdlReadComplete2 (IN PFILE_OBJECT FileObject, IN PMDL MemoryDescriptorList)
 
VOID NTAPI CcMdlWriteComplete2 (IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain)
 
VOID NTAPI CcInitView (VOID)
 
BOOLEAN NTAPI CcpUnpinData (PNOCC_BCB Bcb, BOOLEAN ActuallyRelease)
 
VOID NTAPI CcShutdownSystem (VOID)
 
VOID NTAPI CcInitCacheZeroPage (VOID)
 
BOOLEAN NTAPI CcFlushImageSection (PSECTION_OBJECT_POINTERS SectionObjectPointer, MMFLUSH_TYPE FlushType)
 
VOID NTAPI _CcpFlushCache (IN PNOCC_CACHE_MAP Map, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, OUT OPTIONAL PIO_STATUS_BLOCK IoStatus, BOOLEAN Delete, const char *File, int Line)
 
BOOLEAN NTAPI CcGetFileSizes (PFILE_OBJECT FileObject, PCC_FILE_SIZES FileSizes)
 
ULONG NTAPI CcpCountCacheSections (PNOCC_CACHE_MAP Map)
 
BOOLEAN NTAPI CcpAcquireFileLock (PNOCC_CACHE_MAP Map)
 
VOID NTAPI CcpReleaseFileLock (PNOCC_CACHE_MAP Map)
 
VOID _CcpLock (const char *file, int line)
 
VOID _CcpUnlock (const char *file, int line)
 
VOID CcpReferenceCache (ULONG Sector)
 
VOID CcpDereferenceCache (ULONG Sector, BOOLEAN Immediate)
 
BOOLEAN NTAPI CcpMapData (IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG Flags, OUT PVOID *BcbResult, OUT PVOID *Buffer)
 
BOOLEAN NTAPI CcpPinMappedData (IN PNOCC_CACHE_MAP Map, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG Flags, IN OUT PVOID *Bcb)
 
ULONG MmGetReferenceCountPageWithoutLock (PFN_NUMBER Page)
 

Variables

NOCC_BCB CcCacheSections [CACHE_NUM_SECTIONS]
 
PRTL_BITMAP CcCacheBitmap
 
FAST_MUTEX CcMutex
 
KEVENT CcDeleteEvent
 
ULONG CcCacheClockHand
 
LIST_ENTRY CcPendingUnmap
 
KEVENT CcpLazyWriteEvent
 

Macro Definition Documentation

◆ CACHE_NUM_SECTIONS

#define CACHE_NUM_SECTIONS   (CACHE_OVERALL_SIZE / CACHE_STRIPE)

Definition at line 125 of file newcc.h.

◆ CACHE_OVERALL_SIZE

#define CACHE_OVERALL_SIZE   (32 * 1024 * 1024)

Definition at line 122 of file newcc.h.

◆ CACHE_ROUND_DOWN

#define CACHE_ROUND_DOWN (   x)    ((x) & ~(CACHE_STRIPE-1))

Definition at line 127 of file newcc.h.

◆ CACHE_ROUND_UP

#define CACHE_ROUND_UP (   x)    (((x) + (CACHE_STRIPE-1)) & ~(CACHE_STRIPE-1))

Definition at line 126 of file newcc.h.

◆ CACHE_SHIFT

#define CACHE_SHIFT   18

Definition at line 124 of file newcc.h.

◆ CACHE_SINGLE_FILE_MAX

#define CACHE_SINGLE_FILE_MAX   (16)

Definition at line 121 of file newcc.h.

◆ CACHE_STRIPE

#define CACHE_STRIPE   VACB_MAPPING_GRANULARITY

Definition at line 123 of file newcc.h.

◆ CcpFlushCache

#define CcpFlushCache (   M,
  F,
  L,
  I,
  D 
)    _CcpFlushCache(M,F,L,I,D,__FILE__,__LINE__)

Definition at line 91 of file newcc.h.

◆ CcpLock

#define CcpLock ( )    _CcpLock(__FILE__,__LINE__)

Definition at line 138 of file newcc.h.

◆ CcpUnlock

#define CcpUnlock ( )    _CcpUnlock(__FILE__,__LINE__)

Definition at line 139 of file newcc.h.

◆ INVALID_CACHE

#define INVALID_CACHE   ((ULONG)~0)

Definition at line 128 of file newcc.h.

◆ KEBUGCHECKCC

#define KEBUGCHECKCC
Value:
KEBUGCHECKEX(CACHE_MANAGER, \
(*(ULONG*)(__FILE__ + sizeof(__FILE__) - 4) << 16) | \
(__LINE__ & 0xFFFF), 0, 0, 0)
unsigned int ULONG
Definition: retypes.h:1

Definition at line 114 of file newcc.h.

Typedef Documentation

◆ NOCC_BCB

◆ NOCC_CACHE_MAP

◆ PNOCC_BCB

◆ PNOCC_CACHE_MAP

Function Documentation

◆ _CcpFlushCache()

VOID NTAPI _CcpFlushCache ( IN PNOCC_CACHE_MAP  Map,
IN OPTIONAL PLARGE_INTEGER  FileOffset,
IN ULONG  Length,
OUT OPTIONAL PIO_STATUS_BLOCK  IoStatus,
BOOLEAN  Delete,
const char File,
int  Line 
)

Definition at line 142 of file cachesub.c.

149 {
150  PNOCC_BCB Bcb = NULL;
151  LARGE_INTEGER LowerBound, UpperBound;
152  PLIST_ENTRY ListEntry;
153  IO_STATUS_BLOCK IOSB;
154 
155  RtlZeroMemory(&IOSB, sizeof(IO_STATUS_BLOCK));
156 
157  DPRINT("CcFlushCache (while file) (%s:%d)\n", File, Line);
158 
159  if (FileOffset && Length)
160  {
161  LowerBound.QuadPart = FileOffset->QuadPart;
162  UpperBound.QuadPart = LowerBound.QuadPart + Length;
163  }
164  else
165  {
166  LowerBound.QuadPart = 0;
167  UpperBound.QuadPart = 0x7fffffffffffffffull;
168  }
169 
170  CcpLock();
171  ListEntry = Map->AssociatedBcb.Flink;
172 
173  while (ListEntry != &Map->AssociatedBcb)
174  {
175  Bcb = CONTAINING_RECORD(ListEntry, NOCC_BCB, ThisFileList);
177 
178  if (Bcb->FileOffset.QuadPart + Bcb->Length >= LowerBound.QuadPart &&
179  Bcb->FileOffset.QuadPart < UpperBound.QuadPart)
180  {
181  DPRINT("Bcb #%x (@%08x%08x)\n",
183  Bcb->FileOffset.u.HighPart, Bcb->FileOffset.u.LowPart);
184 
185  Bcb->RefCount++;
186  CcpUnlock();
187  MiFlushMappedSection(Bcb->BaseAddress,
188  &Bcb->FileOffset,
189  &Map->FileSizes.FileSize,
190  Bcb->Dirty);
191  CcpLock();
192  Bcb->RefCount--;
193 
194  Bcb->Dirty = FALSE;
195 
196  ListEntry = ListEntry->Flink;
197  if (Delete && Bcb->RefCount < 2)
198  {
199  Bcb->RefCount = 1;
201  }
202  else
203  {
205  }
206  }
207  else
208  {
209  ListEntry = ListEntry->Flink;
211  }
212 
213  DPRINT("End loop\n");
214  }
215  CcpUnlock();
216 
217  if (IoStatus) *IoStatus = IOSB;
218 }
BOOLEAN NTAPI CcpUnpinData(PNOCC_BCB Bcb, BOOLEAN ActuallyRelease)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:411
#define CcpLock()
Definition: newcc.h:138
#define TRUE
Definition: types.h:120
VOID CcpReferenceCache(ULONG Sector)
Definition: pinsup.c:368
Definition: newcc.h:3
NOCC_BCB CcCacheSections[CACHE_NUM_SECTIONS]
Definition: pinsup.c:98
#define FALSE
Definition: types.h:117
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define MiFlushMappedSection(A, O, S, D)
Definition: newmm.h:333
Definition: ncftp.h:79
Definition: typedefs.h:119
VOID CcpDereferenceCache(ULONG Sector, BOOLEAN Immediate)
Definition: pinsup.c:213
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:159
#define NULL
Definition: types.h:112
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:155
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define CcpUnlock()
Definition: newcc.h:139
Definition: File.h:15
#define DPRINT
Definition: sndvol32.h:71
BOOL Delete(LPCTSTR ServiceName)
Definition: delete.c:12
LONGLONG QuadPart
Definition: typedefs.h:114

◆ _CcpLock()

VOID _CcpLock ( const char file,
int  line 
)

Definition at line 112 of file pinsup.c.

114 {
115  //DPRINT("<<<---<<< CC In Mutex(%s:%d %x)!\n", file, line, PsGetCurrentThread());
117 }
FAST_MUTEX CcMutex
Definition: pinsup.c:101
VOID FASTCALL ExAcquireFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:23

◆ _CcpUnlock()

VOID _CcpUnlock ( const char file,
int  line 
)

Definition at line 120 of file pinsup.c.

122 {
124  //DPRINT(">>>--->>> CC Exit Mutex!\n", file, line);
125 }
FAST_MUTEX CcMutex
Definition: pinsup.c:101
VOID FASTCALL ExReleaseFastMutex(IN PFAST_MUTEX FastMutex)
Definition: fmutex.c:31

◆ CcFlushImageSection()

BOOLEAN NTAPI CcFlushImageSection ( PSECTION_OBJECT_POINTERS  SectionObjectPointer,
MMFLUSH_TYPE  FlushType 
)

Definition at line 245 of file cachesub.c.

247 {
249  PNOCC_BCB Bcb;
251  IO_STATUS_BLOCK IOSB;
252  BOOLEAN Result = TRUE;
253 
254  if (!Map) return TRUE;
255 
256  for (Entry = Map->AssociatedBcb.Flink;
257  Entry != &Map->AssociatedBcb;
258  Entry = Entry->Flink)
259  {
260  Bcb = CONTAINING_RECORD(Entry, NOCC_BCB, ThisFileList);
261 
262  if (!Bcb->Dirty) continue;
263 
264  switch (FlushType)
265  {
266  case MmFlushForDelete:
268  &Bcb->FileOffset,
269  Bcb->Length,
270  FALSE);
271  break;
272  case MmFlushForWrite:
274  &Bcb->FileOffset,
275  Bcb->Length,
276  &IOSB);
277  break;
278  }
279  }
280 
281  return Result;
282 }
BOOLEAN NTAPI CcPurgeCacheSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN UninitializeCacheMaps)
Definition: fssup.c:386
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:411
VOID NTAPI CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, OUT OPTIONAL PIO_STATUS_BLOCK IoStatus)
Definition: cachesub.c:222
#define TRUE
Definition: types.h:120
if(dx==0 &&dy==0)
Definition: linetemp.h:174
Definition: newcc.h:3
_Must_inspect_result_ _In_ PDEVICE_OBJECT _In_ PSECTION_OBJECT_POINTERS SectionObjectPointer
Definition: fsrtlfuncs.h:1368
#define FALSE
Definition: types.h:117
unsigned char BOOLEAN
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
LIST_ENTRY AssociatedBcb
Definition: newcc.h:29
IN PFCB IN FAT_FLUSH_TYPE FlushType
Definition: fatprocs.h:1080
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
Definition: typedefs.h:119
base of all file and directory entries
Definition: entries.h:82
struct _NOCC_CACHE_MAP * PNOCC_CACHE_MAP

◆ CcGetFileSizes()

BOOLEAN NTAPI CcGetFileSizes ( PFILE_OBJECT  FileObject,
PCC_FILE_SIZES  FileSizes 
)

◆ CcInitCacheZeroPage()

VOID NTAPI CcInitCacheZeroPage ( VOID  )

Definition at line 56 of file copy.c.

58 {
60 
62  //MI_SET_PROCESS2(PsGetCurrentProcess()->ImageFileName);
64  if (!NT_SUCCESS(Status))
65  {
66  DbgPrint("Can't allocate CcZeroPage.\n");
67  KeBugCheck(CACHE_MANAGER);
68  }
70 }
#define DbgPrint
Definition: hal.h:12
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI MmRequestPageMemoryConsumer(ULONG Consumer, BOOLEAN MyWait, PPFN_NUMBER AllocatedPage)
Definition: balance.c:280
#define MC_SYSTEM
Definition: mm.h:104
VOID NTAPI MiZeroPhysicalPage(IN PFN_NUMBER PageFrameIndex)
Definition: pfnlist.c:122
DECLSPEC_NORETURN VOID NTAPI KeBugCheck(ULONG BugCheckCode)
Definition: bug.c:1427
#define MI_SET_USAGE(x)
Definition: mm.h:306
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static PFN_NUMBER CcZeroPage
Definition: copy.c:19

Referenced by CcInitView().

◆ CcInitView()

VOID NTAPI CcInitView ( VOID  )

Definition at line 1355 of file view.c.

1357 {
1358  DPRINT("CcInitView()\n");
1359 
1366  NULL,
1367  NULL,
1368  0,
1369  sizeof(INTERNAL_BCB),
1370  TAG_BCB,
1371  20);
1373  NULL,
1374  NULL,
1375  0,
1376  sizeof(ROS_SHARED_CACHE_MAP),
1378  20);
1380  NULL,
1381  NULL,
1382  0,
1383  sizeof(ROS_VACB),
1384  TAG_VACB,
1385  20);
1386 
1388 }
Definition: cc.h:206
#define TAG_VACB
Definition: tag.h:5
static NPAGED_LOOKASIDE_LIST VacbLookasideList
Definition: view.c:46
#define TAG_BCB
Definition: nodetype.h:157
static LIST_ENTRY VacbLruListHead
Definition: view.c:42
#define TAG_SHARED_CACHE_MAP
Definition: tag.h:6
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
LIST_ENTRY CcCleanSharedCacheMapList
Definition: view.c:59
VOID NTAPI CcInitCacheZeroPage(VOID)
Definition: copy.c:56
VOID NTAPI ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
Definition: lookas.c:218
static NPAGED_LOOKASIDE_LIST SharedCacheMapLookasideList
Definition: view.c:45
LIST_ENTRY CcDeferredWrites
Definition: view.c:57
KSPIN_LOCK CcDeferredWriteSpinLock
Definition: view.c:58
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
NPAGED_LOOKASIDE_LIST iBcbLookasideList
Definition: view.c:44
#define NULL
Definition: types.h:112
#define DPRINT
Definition: sndvol32.h:71
LIST_ENTRY DirtyVacbListHead
Definition: view.c:41

Referenced by CcInitializeCacheManager().

◆ CcMdlReadComplete2()

VOID NTAPI CcMdlReadComplete2 ( IN PFILE_OBJECT  FileObject,
IN PMDL  MemoryDescriptorList 
)

Definition at line 83 of file mdlsup.c.

85 {
87 }
#define UNIMPLEMENTED
Definition: debug.h:115

◆ CcMdlWriteComplete2()

VOID NTAPI CcMdlWriteComplete2 ( IN PFILE_OBJECT  FileObject,
IN PLARGE_INTEGER  FileOffset,
IN PMDL  MdlChain 
)

Definition at line 111 of file mdlsup.c.

114 {
116 }
#define UNIMPLEMENTED
Definition: debug.h:115

◆ CcpAcquireFileLock()

BOOLEAN NTAPI CcpAcquireFileLock ( PNOCC_CACHE_MAP  Map)

Definition at line 131 of file fssup.c.

132 {
133  DPRINT("Calling AcquireForLazyWrite: %x\n", Map->LazyContext);
134  return Map->Callbacks.AcquireForLazyWrite(Map->LazyContext, TRUE);
135 }
PVOID LazyContext
Definition: newcc.h:35
#define TRUE
Definition: types.h:120
PACQUIRE_FOR_LAZY_WRITE AcquireForLazyWrite
Definition: cctypes.h:39
CACHE_MANAGER_CALLBACKS Callbacks
Definition: newcc.h:34
#define DPRINT
Definition: sndvol32.h:71

◆ CcpCountCacheSections()

ULONG NTAPI CcpCountCacheSections ( PNOCC_CACHE_MAP  Map)

◆ CcpDereferenceCache()

VOID CcpDereferenceCache ( ULONG  Sector,
BOOLEAN  Immediate 
)

Definition at line 213 of file pinsup.c.

215 {
216  PVOID ToUnmap;
217  PNOCC_BCB Bcb;
218  BOOLEAN Dirty;
219  LARGE_INTEGER MappedSize;
220  LARGE_INTEGER BaseOffset;
222 
223  DPRINT("CcpDereferenceCache(#%x)\n", Start);
224 
226 
227  Dirty = Bcb->Dirty;
228  ToUnmap = Bcb->BaseAddress;
229  BaseOffset = Bcb->FileOffset;
230  MappedSize = Bcb->Map->FileSizes.ValidDataLength;
231 
232  DPRINT("Dereference #%x (count %d)\n", Start, Bcb->RefCount);
233  ASSERT(Bcb->SectionObject);
234  ASSERT(Bcb->RefCount == 1);
235 
236  DPRINT("Firing work item for %x\n", Bcb->BaseAddress);
237 
238  if (Dirty) {
239  CcpUnlock();
240  Bcb->RefCount++;
241  MiFlushMappedSection(ToUnmap, &BaseOffset, &MappedSize, Dirty);
242  Bcb->RefCount--;
243  CcpLock();
244  }
245 
246  if (Immediate)
247  {
248  PROS_SECTION_OBJECT ToDeref = Bcb->SectionObject;
249  Bcb->Map = NULL;
250  Bcb->SectionObject = NULL;
251  Bcb->BaseAddress = NULL;
252  Bcb->FileOffset.QuadPart = 0;
253  Bcb->Length = 0;
254  Bcb->RefCount = 0;
255  Bcb->Dirty = FALSE;
256  RemoveEntryList(&Bcb->ThisFileList);
257 
258  CcpUnlock();
260  ObDereferenceObject(ToDeref);
261  CcpLock();
262  }
263  else
264  {
266  if (!WorkItem) KeBugCheck(0);
267  WorkItem->ToUnmap = Bcb->BaseAddress;
268  WorkItem->FileOffset = Bcb->FileOffset;
269  WorkItem->Dirty = Bcb->Dirty;
270  WorkItem->MapSize = MappedSize;
271  WorkItem->ToDeref = Bcb->SectionObject;
272  WorkItem->AcquireForLazyWrite = Bcb->Map->Callbacks.AcquireForLazyWrite;
273  WorkItem->ReleaseFromLazyWrite = Bcb->Map->Callbacks.ReleaseFromLazyWrite;
274  WorkItem->LazyContext = Bcb->Map->LazyContext;
275 
276  ExInitializeWorkItem(&WorkItem->WorkItem,
278  WorkItem);
279 
280  Bcb->Map = NULL;
281  Bcb->SectionObject = NULL;
282  Bcb->BaseAddress = NULL;
283  Bcb->FileOffset.QuadPart = 0;
284  Bcb->Length = 0;
285  Bcb->RefCount = 0;
286  Bcb->Dirty = FALSE;
287  RemoveEntryList(&Bcb->ThisFileList);
288 
289  CcpUnlock();
291  CcpLock();
292  }
293  DPRINT("Done\n");
294 }
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:723
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:411
#define CcpLock()
Definition: newcc.h:138
Definition: newcc.h:3
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
#define FALSE
Definition: types.h:117
DECLSPEC_NORETURN VOID NTAPI KeBugCheck(ULONG BugCheckCode)
Definition: bug.c:1427
NOCC_BCB CcCacheSections[CACHE_NUM_SECTIONS]
Definition: pinsup.c:98
NTSTATUS NTAPI MmUnmapCacheViewInSystemSpace(PVOID Address)
unsigned char BOOLEAN
VOID CcpUnmapCache(PVOID Context)
Definition: pinsup.c:187
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
#define ASSERT(a)
Definition: mode.c:44
#define MiFlushMappedSection(A, O, S, D)
Definition: newmm.h:333
#define ObDereferenceObject
Definition: obfuncs.h:203
Definition: partlist.h:33
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
#define NULL
Definition: types.h:112
#define CcpUnlock()
Definition: newcc.h:139
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
Definition: wdfworkitem.h:110
#define DPRINT
Definition: sndvol32.h:71
WORKER_THREAD_ROUTINE * PWORKER_THREAD_ROUTINE
Definition: extypes.h:200

Referenced by _CcpFlushCache(), CcpAllocateCacheSections(), and CcUninitializeCacheMap().

◆ CcPfInitializePrefetcher()

VOID NTAPI CcPfInitializePrefetcher ( VOID  )

Definition at line 114 of file fssup.c.

115 {
116  /* Notify debugger */
119  "CCPF: InitializePrefetecher()\n");
120 
121  /* Setup the Prefetcher Data */
125 
126  /* FIXME: Setup the rest of the prefetecher */
127 }
FAST_MUTEX CompletedTracesLock
Definition: cc.h:164
NTSYSAPI ULONG __cdecl DbgPrintEx(_In_ ULONG ComponentId, _In_ ULONG Level, _In_z_ _Printf_format_string_ PCSTR Format,...)
LIST_ENTRY CompletedTraces
Definition: cc.h:163
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
PFSN_PREFETCHER_GLOBALS CcPfGlobals
Definition: fssup.c:20
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
LIST_ENTRY ActiveTraces
Definition: cc.h:160
#define DPFLTR_TRACE_LEVEL
Definition: kdtypes.h:32

◆ CcpMapData()

BOOLEAN NTAPI CcpMapData ( IN PFILE_OBJECT  FileObject,
IN PLARGE_INTEGER  FileOffset,
IN ULONG  Length,
IN ULONG  Flags,
OUT PVOID BcbResult,
OUT PVOID Buffer 
)

Definition at line 465 of file pinsup.c.

471 {
472  BOOLEAN Success = FALSE, FaultIn = FALSE;
473  /* Note: windows 2000 drivers treat this as a bool */
474  //BOOLEAN Wait = (Flags & MAP_WAIT) || (Flags == TRUE);
475  LARGE_INTEGER Target, EndInterval;
476  ULONG BcbHead, SectionSize, ViewSize;
477  PNOCC_BCB Bcb = NULL;
478  PROS_SECTION_OBJECT SectionObject = NULL;
480  PNOCC_CACHE_MAP Map = (PNOCC_CACHE_MAP)FileObject->SectionObjectPointer->SharedCacheMap;
482 
483  if (!Map)
484  {
485  DPRINT1("File object was not mapped\n");
486  return FALSE;
487  }
488 
489  DPRINT("CcMapData(F->%x, %I64x:%d)\n",
490  FileObject,
491  FileOffset->QuadPart,
492  Length);
493 
495 
496  Target.HighPart = FileOffset->HighPart;
497  Target.LowPart = CACHE_ROUND_DOWN(FileOffset->LowPart);
498 
499  CcpLock();
500 
501  /* Find out if any range is a superset of what we want */
502  /* Find an accomodating section */
504 
505  if (BcbHead != INVALID_CACHE)
506  {
507  Bcb = &CcCacheSections[BcbHead];
508  Success = TRUE;
509  *BcbResult = Bcb;
510  *Buffer = ((PCHAR)Bcb->BaseAddress) + (int)(FileOffset->QuadPart - Bcb->FileOffset.QuadPart);
511 
512  DPRINT("Bcb #%x Buffer maps (%I64x) At %x Length %x (Getting %p:%x) %wZ\n",
514  Bcb->FileOffset.QuadPart,
515  Bcb->BaseAddress,
516  Bcb->Length,
517  *Buffer,
518  Length,
519  &FileObject->FileName);
520 
521  DPRINT("w1n\n");
522  goto cleanup;
523  }
524 
525  DPRINT("File size %I64x\n",
527 
528  /* Not all files have length, in fact filesystems often use stream file
529  objects for various internal purposes and are loose about the file
530  length, since the filesystem promises itself to write the right number
531  of bytes to the internal stream. In these cases, we just allow the file
532  to have the full stripe worth of space. */
534  {
535  SectionSize = min(CACHE_STRIPE,
536  Map->FileSizes.ValidDataLength.QuadPart - Target.QuadPart);
537  }
538  else
539  {
540  SectionSize = CACHE_STRIPE;
541  }
542 
543  DPRINT("Allocating a cache stripe at %x:%d\n",
544  Target.LowPart, SectionSize);
545 
546  //ASSERT(SectionSize <= CACHE_STRIPE);
547 
548  CcpUnlock();
549  /* CcpAllocateSection doesn't need the lock, so we'll give other action
550  a chance in here. */
552  SectionSize,
553 #ifdef PIN_WRITE_ONLY
555 #else
557 #endif
558  &SectionObject);
559  CcpLock();
560 
561  if (!NT_SUCCESS(Status))
562  {
563  *BcbResult = NULL;
564  *Buffer = NULL;
565  DPRINT1("End %08x\n", Status);
566  goto cleanup;
567  }
568 
569 retry:
570  /* Returns a reference */
571  DPRINT("Allocating cache sections: %wZ\n", &FileObject->FileName);
573  /* XXX todo: we should handle the immediate fail case here, but don't */
574  if (BcbHead == INVALID_CACHE)
575  {
576  ULONG i;
577  DbgPrint("Cache Map:");
578  for (i = 0; i < CACHE_NUM_SECTIONS; i++)
579  {
580  if (!(i % 64)) DbgPrint("\n");
581  DbgPrint("%c",
582  CcCacheSections[i].RefCount + (RtlTestBit(CcCacheBitmap, i) ? '@' : '`'));
583  }
584  DbgPrint("\n");
585 
587  Executive,
588  KernelMode,
589  FALSE,
590  NULL);
591 
592  goto retry;
593  }
594 
595  DPRINT("BcbHead #%x (final)\n", BcbHead);
596 
597  if (BcbHead == INVALID_CACHE)
598  {
599  *BcbResult = NULL;
600  *Buffer = NULL;
601  DPRINT1("End\n");
602  goto cleanup;
603  }
604 
605  DPRINT("Selected BCB #%x\n", BcbHead);
607 
608  Bcb = &CcCacheSections[BcbHead];
609  /* MmMapCacheViewInSystemSpaceAtOffset is one of three methods of Mm
610  that are specific to NewCC. In this case, it's implementation
611  exactly mirrors MmMapViewInSystemSpace, but allows an offset to
612  be specified. */
614  &Bcb->BaseAddress,
615  &Target,
616  &ViewSize);
617 
618  /* Summary: Failure. Dereference our section and tell the user we failed */
619  if (!NT_SUCCESS(Status))
620  {
621  *BcbResult = NULL;
622  *Buffer = NULL;
624  RemoveEntryList(&Bcb->ThisFileList);
625  RtlZeroMemory(Bcb, sizeof(*Bcb));
626  RtlClearBit(CcCacheBitmap, BcbHead);
627  DPRINT1("Failed to map\n");
628  goto cleanup;
629  }
630 
631  /* Summary: Success. Put together a valid Bcb and link it with the others
632  * in the NOCC_CACHE_MAP.
633  */
634  Success = TRUE;
635 
636  Bcb->Length = MIN(Map->FileSizes.ValidDataLength.QuadPart - Target.QuadPart,
637  CACHE_STRIPE);
638 
639  Bcb->SectionObject = SectionObject;
640  Bcb->Map = Map;
641  Bcb->FileOffset = Target;
642  InsertTailList(&Map->AssociatedBcb, &Bcb->ThisFileList);
643 
644  *BcbResult = &CcCacheSections[BcbHead];
645  *Buffer = ((PCHAR)Bcb->BaseAddress) + (int)(FileOffset->QuadPart - Bcb->FileOffset.QuadPart);
646  FaultIn = TRUE;
647 
648  DPRINT("Bcb #%x Buffer maps (%I64x) At %x Length %x (Getting %p:%lx) %wZ\n",
650  Bcb->FileOffset.QuadPart,
651  Bcb->BaseAddress,
652  Bcb->Length,
653  *Buffer,
654  Length,
655  &FileObject->FileName);
656 
657  EndInterval.QuadPart = Bcb->FileOffset.QuadPart + Bcb->Length - 1;
658  ASSERT((EndInterval.QuadPart & ~(CACHE_STRIPE - 1)) ==
659  (Bcb->FileOffset.QuadPart & ~(CACHE_STRIPE - 1)));
660 
661 cleanup:
662  CcpUnlock();
663  if (Success)
664  {
665  if (FaultIn)
666  {
667  /* Fault in the pages. This forces reads to happen now. */
668  ULONG i;
669  PCHAR FaultIn = Bcb->BaseAddress;
670 
671  DPRINT("Faulting in pages at this point: file %wZ %I64x:%x\n",
672  &FileObject->FileName,
673  Bcb->FileOffset.QuadPart,
674  Bcb->Length);
675 
676  for (i = 0; i < Bcb->Length; i += PAGE_SIZE)
677  {
678  FaultIn[i] ^= 0;
679  }
680  }
683  }
684  else
685  {
686  ASSERT(FALSE);
687  }
688 
689  return Success;
690 }
_Must_inspect_result_ _Outptr_ PVOID * SectionObject
Definition: fsrtlfuncs.h:860
NTSTATUS CcpAllocateSection(PFILE_OBJECT FileObject, ULONG Length, ULONG Protect, PROS_SECTION_OBJECT *Result)
Definition: pinsup.c:140
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
#define INVALID_CACHE
Definition: newcc.h:128
signed char * PCHAR
Definition: retypes.h:7
PRTL_BITMAP CcCacheBitmap
Definition: pinsup.c:100
KEVENT CcDeleteEvent
Definition: pinsup.c:102
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:411
#define DbgPrint
Definition: hal.h:12
#define CcpLock()
Definition: newcc.h:138
#define TRUE
Definition: types.h:120
#define CACHE_NUM_SECTIONS
Definition: newcc.h:125
LONG NTSTATUS
Definition: precomp.h:26
#define InsertTailList(ListHead, Entry)
if(dx==0 &&dy==0)
Definition: linetemp.h:174
Definition: newcc.h:3
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
#define CACHE_ROUND_DOWN(x)
Definition: newcc.h:127
T MIN(T a, T b)
Definition: polytest.cpp:79
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
#define FALSE
Definition: types.h:117
NOCC_BCB CcCacheSections[CACHE_NUM_SECTIONS]
Definition: pinsup.c:98
unsigned char BOOLEAN
Definition: bufpool.h:45
LIST_ENTRY AssociatedBcb
Definition: newcc.h:29
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
#define PCHAR
Definition: match.c:90
#define CACHE_STRIPE
Definition: newcc.h:123
Status
Definition: gdiplustypes.h:24
ULONG CcpAllocateCacheSections(PFILE_OBJECT FileObject, PROS_SECTION_OBJECT SectionObject)
Definition: pinsup.c:310
#define ASSERT(a)
Definition: mode.c:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ObDereferenceObject
Definition: obfuncs.h:203
VOID NTAPI RtlClearBit(_In_ PRTL_BITMAP BitMapHeader, _In_ BITMAP_INDEX BitNumber)
Definition: bitmap.c:294
_Must_inspect_result_ NTSYSAPI BOOLEAN NTAPI RtlTestBit(_In_ PRTL_BITMAP BitMapHeader, _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber)
Definition: bitmap.c:434
LARGE_INTEGER ValidDataLength
Definition: cctypes.h:17
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
CC_FILE_SIZES FileSizes
Definition: newcc.h:33
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:159
#define min(a, b)
Definition: monoChain.cc:55
#define NULL
Definition: types.h:112
#define PAGE_READONLY
Definition: compat.h:138
ULONG CcpFindMatchingMap(PLIST_ENTRY Head, PLARGE_INTEGER FileOffset, ULONG Length)
Definition: pinsup.c:430
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
#define DPRINT1
Definition: precomp.h:8
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
Definition: mmfuncs.h:404
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
char * cleanup(char *str)
Definition: wpickclick.c:99
#define CcpUnlock()
Definition: newcc.h:139
#define DPRINT
Definition: sndvol32.h:71
NTSTATUS NTAPI MmMapCacheViewInSystemSpaceAtOffset(IN PMM_SECTION_SEGMENT Segment, OUT PVOID *MappedBase, IN PLARGE_INTEGER ViewOffset, IN OUT PULONG ViewSize)
LONGLONG QuadPart
Definition: typedefs.h:114
struct _NOCC_CACHE_MAP * PNOCC_CACHE_MAP
#define PAGE_READWRITE
Definition: nt_native.h:1304
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by CcMapData(), and CcPinMappedData().

◆ CcpPinMappedData()

BOOLEAN NTAPI CcpPinMappedData ( IN PNOCC_CACHE_MAP  Map,
IN PLARGE_INTEGER  FileOffset,
IN ULONG  Length,
IN ULONG  Flags,
IN OUT PVOID Bcb 
)

Definition at line 730 of file pinsup.c.

735 {
737  ULONG BcbHead;
738  PNOCC_BCB TheBcb;
739 
740  CcpLock();
741 
742  ASSERT(Map->AssociatedBcb.Flink == &Map->AssociatedBcb || (CONTAINING_RECORD(Map->AssociatedBcb.Flink, NOCC_BCB, ThisFileList) >= CcCacheSections && CONTAINING_RECORD(Map->AssociatedBcb.Flink, NOCC_BCB, ThisFileList) < CcCacheSections + CACHE_NUM_SECTIONS));
743  BcbHead = CcpFindMatchingMap(&Map->AssociatedBcb, FileOffset, Length);
744  if (BcbHead == INVALID_CACHE)
745  {
746  CcpUnlock();
747  return FALSE;
748  }
749 
750  TheBcb = &CcCacheSections[BcbHead];
751 
752  if (Exclusive)
753  {
754  DPRINT("Requesting #%x Exclusive\n", BcbHead);
755  CcpMarkForExclusive(BcbHead);
756  }
757  else
758  {
759  DPRINT("Reference #%x\n", BcbHead);
760  CcpReferenceCache(BcbHead);
761  }
762 
763  if (Exclusive)
765 
766  CcpUnlock();
767 
768  *Bcb = TheBcb;
769  return TRUE;
770 }
#define INVALID_CACHE
Definition: newcc.h:128
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:411
#define CcpLock()
Definition: newcc.h:138
#define TRUE
Definition: types.h:120
#define CACHE_NUM_SECTIONS
Definition: newcc.h:125
VOID CcpMarkForExclusive(ULONG Start)
Definition: pinsup.c:379
Definition: newcc.h:3
#define FALSE
Definition: types.h:117
NOCC_BCB CcCacheSections[CACHE_NUM_SECTIONS]
Definition: pinsup.c:98
unsigned char BOOLEAN
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define ASSERT(a)
Definition: mode.c:44
__in PWDFDEVICE_INIT __in BOOLEAN Exclusive
VOID CcpReferenceCache(ULONG Start)
Definition: pinsup.c:368
VOID CcpReferenceCacheExclusive(ULONG Start)
Definition: pinsup.c:396
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:159
ULONG CcpFindMatchingMap(PLIST_ENTRY Head, PLARGE_INTEGER FileOffset, ULONG Length)
Definition: pinsup.c:430
#define PIN_EXCLUSIVE
unsigned int ULONG
Definition: retypes.h:1
#define CcpUnlock()
Definition: newcc.h:139
#define DPRINT
Definition: sndvol32.h:71

Referenced by CcPinMappedData().

◆ CcpReferenceCache()

VOID CcpReferenceCache ( ULONG  Sector)

Definition at line 368 of file pinsup.c.

369 {
370  PNOCC_BCB Bcb;
372  ASSERT(Bcb->SectionObject);
373  Bcb->RefCount++;
375 
376 }
PRTL_BITMAP CcCacheBitmap
Definition: pinsup.c:100
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:411
NTSYSAPI VOID NTAPI RtlSetBit(_In_ PRTL_BITMAP BitMapHeader, _In_range_(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber)
Definition: bitmap.c:304
Definition: newcc.h:3
NOCC_BCB CcCacheSections[CACHE_NUM_SECTIONS]
Definition: pinsup.c:98
#define ASSERT(a)
Definition: mode.c:44
Definition: partlist.h:33

Referenced by _CcpFlushCache(), CcMapData(), CcpPinMappedData(), CcRemapBcb(), CcRepinBcb(), CcSetBcbOwnerPointer(), and CcZeroData().

◆ CcpReleaseFileLock()

VOID NTAPI CcpReleaseFileLock ( PNOCC_CACHE_MAP  Map)

Definition at line 139 of file fssup.c.

140 {
141  DPRINT("Releasing Lazy Write %x\n", Map->LazyContext);
143 }
PVOID LazyContext
Definition: newcc.h:35
CACHE_MANAGER_CALLBACKS Callbacks
Definition: newcc.h:34
PRELEASE_FROM_LAZY_WRITE ReleaseFromLazyWrite
Definition: cctypes.h:40
#define DPRINT
Definition: sndvol32.h:71

◆ CcpUnpinData()

BOOLEAN NTAPI CcpUnpinData ( PNOCC_BCB  Bcb,
BOOLEAN  ActuallyRelease 
)

Referenced by _CcpFlushCache(), and CcZeroData().

◆ CcShutdownSystem()

VOID NTAPI CcShutdownSystem ( VOID  )

Definition at line 299 of file cachesub.c.

300 {
301  ULONG i, Result;
303 
304  DPRINT1("CC: Shutdown\n");
305 
306  for (i = 0; i < CACHE_NUM_SECTIONS; i++)
307  {
309  if (Bcb->SectionObject)
310  {
311  DPRINT1("Evicting #%02x %08x%08x %wZ\n",
312  i,
313  Bcb->FileOffset.u.HighPart,
314  Bcb->FileOffset.u.LowPart,
315  &MmGetFileObjectForSection((PROS_SECTION_OBJECT)Bcb->SectionObject)->FileName);
316 
317  CcpFlushCache(Bcb->Map, NULL, 0, NULL, TRUE);
318  Bcb->Dirty = FALSE;
319  }
320  }
321 
322  /* Evict all section pages */
323  Status = MiRosTrimCache(~0, 0, &Result);
324 
325  DPRINT1("Done (Evicted %d, Status %x)\n", Result, Status);
326 }
PFILE_OBJECT NTAPI MmGetFileObjectForSection(IN PVOID Section)
Definition: section.c:1734
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:411
#define TRUE
Definition: types.h:120
#define CACHE_NUM_SECTIONS
Definition: newcc.h:125
LONG NTSTATUS
Definition: precomp.h:26
#define CcpFlushCache(M, F, L, I, D)
Definition: newcc.h:91
NTSTATUS MiRosTrimCache(ULONG Target, ULONG Priority, PULONG NrFreed)
Definition: swapout.c:633
Definition: newcc.h:3
NOCC_BCB CcCacheSections[CACHE_NUM_SECTIONS]
Definition: pinsup.c:98
#define FALSE
Definition: types.h:117
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
Status
Definition: gdiplustypes.h:24
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1

◆ MmGetReferenceCountPageWithoutLock()

ULONG MmGetReferenceCountPageWithoutLock ( PFN_NUMBER  Page)

Definition at line 165 of file newcc.h.

166 {
167  ULONG Ret;
168  KIRQL OldIrql = MiAcquirePfnLock();
169 
171 
172  MiReleasePfnLock(OldIrql);
173 
174  return Ret;
175 }
UCHAR KIRQL
Definition: env_spec_w32.h:591
PFN_NUMBER Page
Definition: section.c:4923
KIRQL OldIrql
Definition: mm.h:1502
ULONG NTAPI MmGetReferenceCountPage(PFN_NUMBER Page)
Definition: freelist.c:538
unsigned int ULONG
Definition: retypes.h:1

Referenced by MiFreeSegmentPage(), MmFinalizeSectionPageOut(), and MmpPageOutPhysicalAddress().

Variable Documentation

◆ CcCacheBitmap

◆ CcCacheClockHand

ULONG CcCacheClockHand

Definition at line 104 of file pinsup.c.

Referenced by CcpAllocateCacheSections().

◆ CcCacheSections

◆ CcDeleteEvent

KEVENT CcDeleteEvent

Definition at line 102 of file pinsup.c.

Referenced by CcInitializeCacheManager(), CcpMapData(), and CcpUnpinData().

◆ CcMutex

FAST_MUTEX CcMutex

Definition at line 101 of file pinsup.c.

Referenced by _CcpLock(), _CcpUnlock(), and CcInitializeCacheManager().

◆ CcPendingUnmap

LIST_ENTRY CcPendingUnmap

◆ CcpLazyWriteEvent

KEVENT CcpLazyWriteEvent

Definition at line 18 of file lazyrite.c.