ReactOS  0.4.15-dev-1206-g731eddf
fssup.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Kernel
4  * FILE: ntoskrnl/cache/fssup.c
5  * PURPOSE: Logging and configuration routines
6  * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7  * Art Yerkes
8  */
9 
10 /* INCLUDES *******************************************************************/
11 
12 #include <ntoskrnl.h>
13 #include "newcc.h"
14 #include "section/newmm.h"
15 #define NDEBUG
16 #include <debug.h>
17 
18 /* GLOBALS ********************************************************************/
19 
23 extern KEVENT CcFinalizeEvent;
29 
30 /*
31 
32 A note about private cache maps.
33 
34 CcInitializeCacheMap and CcUninitializeCacheMap are not meant to be paired,
35 although they can work that way.
36 
37 The actual operation I've gleaned from reading both jan kratchovil's writing
38 and real filesystems is this:
39 
40 CcInitializeCacheMap means:
41 
42 Make the indicated FILE_OBJECT have a private cache map if it doesn't already
43 and make it have a shared cache map if it doesn't already.
44 
45 CcUninitializeCacheMap means:
46 
47 Take away the private cache map from this FILE_OBJECT. If it's the last
48 private cache map corresponding to a specific shared cache map (the one that
49 was present in the FILE_OBJECT when it was created), then delete that too,
50 flusing all cached information.
51 
52 Using these simple semantics, filesystems can do all the things they actually
53 do:
54 
55 - Copy out the shared cache map pointer from a newly initialized file object
56 and store it in the fcb cache.
57 - Copy it back into any file object and call CcInitializeCacheMap to make
58 that file object be associated with the caching of all the other siblings.
59 - Call CcUninitializeCacheMap on a FILE_OBJECT many times, but have only the
60 first one count for each specific FILE_OBJECT.
61 - Have the actual last call to CcUninitializeCacheMap (that is, the one that
62 causes zero private cache maps to be associated with a shared cache map) to
63 delete the cache map and flush.
64 
65 So private cache map here is a light weight structure that just remembers
66 what shared cache map it associates with.
67 
68  */
70 {
75 
77 
78 /* FUNCTIONS ******************************************************************/
79 
80 INIT_FUNCTION
81 BOOLEAN
82 NTAPI
84 {
85  int i;
86 
87  DPRINT("Initialize\n");
88  for (i = 0; i < CACHE_NUM_SECTIONS; i++)
89  {
90  KeInitializeEvent(&CcCacheSections[i].ExclusiveWait,
92  FALSE);
93 
94  InitializeListHead(&CcCacheSections[i].ThisFileList);
95  }
96 
98 
102 
105  DPRINT1("Cache has %d entries\n", CcCacheBitmap->SizeOfBitMap);
107 
108  return TRUE;
109 }
110 
111 INIT_FUNCTION
112 VOID
113 NTAPI
115 {
116  /* Notify debugger */
119  "CCPF: InitializePrefetecher()\n");
120 
121  /* Setup the Prefetcher Data */
125 
126  /* FIXME: Setup the rest of the prefetecher */
127 }
128 
129 BOOLEAN
130 NTAPI
132 {
133  DPRINT("Calling AcquireForLazyWrite: %x\n", Map->LazyContext);
134  return Map->Callbacks.AcquireForLazyWrite(Map->LazyContext, TRUE);
135 }
136 
137 VOID
138 NTAPI
140 {
141  DPRINT("Releasing Lazy Write %x\n", Map->LazyContext);
143 }
144 
145 /*
146 
147 Cc functions are required to treat alternate streams of a file as the same
148 for the purpose of caching, meaning that we must be able to find the shared
149 cache map associated with the ``real'' stream associated with a stream file
150 object, if one exists. We do that by identifying a private cache map in
151 our gamut that has the same volume, device and fscontext as the stream file
152 object we're holding. It's heavy but it does work. This can probably be
153 improved, although there doesn't seem to be any real association between
154 a stream file object and a sibling file object in the file object struct
155 itself.
156 
157  */
158 
159 /* Must have CcpLock() */
161 {
162  PLIST_ENTRY Entry, Private;
165  Entry = Entry->Flink)
166  {
167  /* 'Identical' test for other stream file object */
169  for (Private = Map->PrivateCacheMaps.Flink;
170  Private != &Map->PrivateCacheMaps;
171  Private = Private->Flink)
172  {
173  PNOCC_PRIVATE_CACHE_MAP PrivateMap = CONTAINING_RECORD(Private,
175  ListEntry);
176 
177  if (PrivateMap->FileObject->Flags & FO_STREAM_FILE &&
178  PrivateMap->FileObject->DeviceObject == FileObject->DeviceObject &&
179  PrivateMap->FileObject->Vpb == FileObject->Vpb &&
180  PrivateMap->FileObject->FsContext == FileObject->FsContext &&
181  PrivateMap->FileObject->FsContext2 == FileObject->FsContext2 &&
182  1)
183  {
184  return PrivateMap->FileObject;
185  }
186  }
187  }
188  return 0;
189 }
190 
191 /* Thanks: http://windowsitpro.com/Windows/Articles/ArticleID/3864/pg/2/2.html */
192 
193 VOID
194 NTAPI
197  IN BOOLEAN PinAccess,
199  IN PVOID LazyWriteContext)
200 {
201  PNOCC_CACHE_MAP Map = FileObject->SectionObjectPointer->SharedCacheMap;
202  PNOCC_PRIVATE_CACHE_MAP PrivateCacheMap = FileObject->PrivateCacheMap;
203 
204  CcpLock();
205  /* We don't have a shared cache map. First find out if we have a sibling
206  stream file object we can take it from. */
207  if (!Map && FileObject->Flags & FO_STREAM_FILE)
208  {
209  PFILE_OBJECT IdenticalStreamFileObject = CcpFindOtherStreamFileObject(FileObject);
210  if (IdenticalStreamFileObject)
211  Map = IdenticalStreamFileObject->SectionObjectPointer->SharedCacheMap;
212  if (Map)
213  {
214  DPRINT1("Linking SFO %x to previous SFO %x through cache map %x #\n",
215  FileObject,
216  IdenticalStreamFileObject,
217  Map);
218  }
219  }
220  /* We still don't have a shared cache map. We need to create one. */
221  if (!Map)
222  {
223  DPRINT("Initializing file object for (%p) %wZ\n",
224  FileObject,
225  &FileObject->FileName);
226 
228  FileObject->SectionObjectPointer->SharedCacheMap = Map;
229  Map->FileSizes = *FileSizes;
230  Map->LazyContext = LazyWriteContext;
232  RtlCopyMemory(&Map->Callbacks, Callbacks, sizeof(*Callbacks));
233 
234  /* For now ... */
235  DPRINT("FileSizes->ValidDataLength %I64x\n",
237 
241  DPRINT("New Map %p\n", Map);
242  }
243  /* We don't have a private cache map. Link it with the shared cache map
244  to serve as a held reference. When the list in the shared cache map
245  is empty, we know we can delete it. */
246  if (!PrivateCacheMap)
247  {
248  PrivateCacheMap = ExAllocatePool(NonPagedPool,
249  sizeof(*PrivateCacheMap));
250 
251  FileObject->PrivateCacheMap = PrivateCacheMap;
252  PrivateCacheMap->FileObject = FileObject;
253  ObReferenceObject(PrivateCacheMap->FileObject);
254  }
255 
256  PrivateCacheMap->Map = Map;
257  InsertTailList(&Map->PrivateCacheMaps, &PrivateCacheMap->ListEntry);
258 
259  CcpUnlock();
260 }
261 
262 /*
263 
264 This function is used by NewCC's MM to determine whether any section objects
265 for a given file are not cache sections. If that's true, we're not allowed
266 to resize the file, although nothing actually prevents us from doing ;-)
267 
268  */
269 
270 ULONG
271 NTAPI
273 {
275  ULONG Count;
276 
277  for (Count = 0, Entry = Map->AssociatedBcb.Flink;
278  Entry != &Map->AssociatedBcb;
279  Entry = Entry->Flink, Count++);
280 
281  return Count;
282 }
283 
284 BOOLEAN
285 NTAPI
287  IN OPTIONAL PLARGE_INTEGER TruncateSize,
288  IN OPTIONAL PCACHE_UNINITIALIZE_EVENT UninitializeEvent)
289 {
290  BOOLEAN LastMap = FALSE;
291  PNOCC_CACHE_MAP Map = (PNOCC_CACHE_MAP)FileObject->SectionObjectPointer->SharedCacheMap;
292  PNOCC_PRIVATE_CACHE_MAP PrivateCacheMap = FileObject->PrivateCacheMap;
293 
294  DPRINT("Uninitializing file object for %wZ SectionObjectPointer %x\n",
295  &FileObject->FileName,
296  FileObject->SectionObjectPointer);
297 
298  ASSERT(UninitializeEvent == NULL);
299 
300  /* It may not be strictly necessary to flush here, but we do just for
301  kicks. */
302  if (Map)
303  CcpFlushCache(Map, NULL, 0, NULL, FALSE);
304 
305  CcpLock();
306  /* We have a private cache map, so we've been initialized and haven't been
307  * uninitialized. */
308  if (PrivateCacheMap)
309  {
310  ASSERT(!Map || Map == PrivateCacheMap->Map);
311  ASSERT(PrivateCacheMap->FileObject == FileObject);
312 
313  RemoveEntryList(&PrivateCacheMap->ListEntry);
314  /* That was the last private cache map. It's time to delete all
315  cache stripes and all aspects of caching on the file. */
316  if (IsListEmpty(&PrivateCacheMap->Map->PrivateCacheMaps))
317  {
318  /* Get rid of all the cache stripes. */
319  while (!IsListEmpty(&PrivateCacheMap->Map->AssociatedBcb))
320  {
321  PNOCC_BCB Bcb = CONTAINING_RECORD(PrivateCacheMap->Map->AssociatedBcb.Flink,
322  NOCC_BCB,
323  ThisFileList);
324 
325  DPRINT("Evicting cache stripe #%x\n", Bcb - CcCacheSections);
326  Bcb->RefCount = 1;
328  }
329  RemoveEntryList(&PrivateCacheMap->Map->Entry);
330  ExFreePool(PrivateCacheMap->Map);
331  FileObject->SectionObjectPointer->SharedCacheMap = NULL;
332  LastMap = TRUE;
333  }
334  ObDereferenceObject(PrivateCacheMap->FileObject);
335  FileObject->PrivateCacheMap = NULL;
336  ExFreePool(PrivateCacheMap);
337  }
338  CcpUnlock();
339 
340  DPRINT("Uninit complete\n");
341 
342  /* The return from CcUninitializeCacheMap means that 'caching was stopped'. */
343  return LastMap;
344 }
345 
346 /*
347 
348 CcSetFileSizes is used to tell the cache manager that the file changed
349 size. In our case, we use the internal Mm method MmExtendCacheSection
350 to notify Mm that our section potentially changed size, which may mean
351 truncating off data.
352 
353  */
354 VOID
355 NTAPI
358 {
359  PNOCC_CACHE_MAP Map = (PNOCC_CACHE_MAP)FileObject->SectionObjectPointer->SharedCacheMap;
360  PNOCC_BCB Bcb;
361 
362  if (!Map) return;
363  Map->FileSizes = *FileSizes;
364  Bcb = Map->AssociatedBcb.Flink == &Map->AssociatedBcb ?
365  NULL : CONTAINING_RECORD(Map->AssociatedBcb.Flink, NOCC_BCB, ThisFileList);
366  if (!Bcb) return;
367  MmExtendCacheSection(Bcb->SectionObject, &FileSizes->FileSize, FALSE);
368  DPRINT("FileSizes->FileSize %x\n", FileSizes->FileSize.LowPart);
369  DPRINT("FileSizes->AllocationSize %x\n", FileSizes->AllocationSize.LowPart);
370  DPRINT("FileSizes->ValidDataLength %x\n", FileSizes->ValidDataLength.LowPart);
371 }
372 
373 BOOLEAN
374 NTAPI
377 {
378  PNOCC_CACHE_MAP Map = (PNOCC_CACHE_MAP)FileObject->SectionObjectPointer->SharedCacheMap;
379  if (!Map) return FALSE;
380  *FileSizes = Map->FileSizes;
381  return TRUE;
382 }
383 
384 BOOLEAN
385 NTAPI
388  IN ULONG Length,
389  IN BOOLEAN UninitializeCacheMaps)
390 {
392  if (!Map) return TRUE;
393  CcpFlushCache(Map, NULL, 0, NULL, TRUE);
394  return TRUE;
395 }
396 
397 VOID
398 NTAPI
400  IN ULONG DirtyPageThreshold)
401 {
403 }
404 
405 /*
406 
407 This could be implemented much more intelligently by mapping instances
408 of a CoW zero page into the affected regions. We just RtlZeroMemory
409 for now.
410 
411 */
412 BOOLEAN
413 NTAPI
415  IN PLARGE_INTEGER StartOffset,
416  IN PLARGE_INTEGER EndOffset,
417  IN BOOLEAN Wait)
418 {
419  PNOCC_BCB Bcb = NULL;
420  PLIST_ENTRY ListEntry = NULL;
421  LARGE_INTEGER LowerBound = *StartOffset;
422  LARGE_INTEGER UpperBound = *EndOffset;
423  LARGE_INTEGER Target, End;
424  PVOID PinnedBcb, PinnedBuffer;
425  PNOCC_CACHE_MAP Map = FileObject->SectionObjectPointer->SharedCacheMap;
426 
427  DPRINT("S %I64x E %I64x\n",
428  StartOffset->QuadPart,
429  EndOffset->QuadPart);
430 
431  if (!Map)
432  {
434  IO_STATUS_BLOCK IOSB;
436  ULONG ToWrite;
437 
439  DPRINT1("RtlZeroMemory(%x,%x)\n", ZeroBuf, PAGE_SIZE);
440  RtlZeroMemory(ZeroBuf, PAGE_SIZE);
441 
442  Target.QuadPart = PAGE_ROUND_DOWN(LowerBound.QuadPart);
443  End.QuadPart = PAGE_ROUND_UP(UpperBound.QuadPart);
444 
445  // Handle leading page
446  if (LowerBound.QuadPart != Target.QuadPart)
447  {
448  ToWrite = MIN(UpperBound.QuadPart - LowerBound.QuadPart,
449  (PAGE_SIZE - LowerBound.QuadPart) & (PAGE_SIZE - 1));
450 
451  DPRINT("Zero last half %I64x %lx\n",
452  Target.QuadPart,
453  ToWrite);
454 
456  &Target,
457  ZeroBuf,
458  PAGE_SIZE,
459  TRUE,
460  &IOSB);
461 
462  if (!NT_SUCCESS(Status))
463  {
464  ExFreePool(ZeroBuf);
466  }
467 
468  DPRINT1("RtlZeroMemory(%p, %lx)\n",
469  ZeroBuf + LowerBound.QuadPart - Target.QuadPart,
470  ToWrite);
471 
472  RtlZeroMemory(ZeroBuf + LowerBound.QuadPart - Target.QuadPart,
473  ToWrite);
474 
476  &Target,
477  ZeroBuf,
478  MIN(PAGE_SIZE,
479  UpperBound.QuadPart-Target.QuadPart),
480  &IOSB);
481 
482  if (!NT_SUCCESS(Status))
483  {
484  ExFreePool(ZeroBuf);
486  }
487  Target.QuadPart += PAGE_SIZE;
488  }
489 
490  DPRINT1("RtlZeroMemory(%x,%x)\n", ZeroBuf, PAGE_SIZE);
491  RtlZeroMemory(ZeroBuf, PAGE_SIZE);
492 
493  while (UpperBound.QuadPart - Target.QuadPart > PAGE_SIZE)
494  {
495  DPRINT("Zero full page %I64x\n",
496  Target.QuadPart);
497 
499  &Target,
500  ZeroBuf,
501  PAGE_SIZE,
502  &IOSB);
503 
504  if (!NT_SUCCESS(Status))
505  {
506  ExFreePool(ZeroBuf);
508  }
509  Target.QuadPart += PAGE_SIZE;
510  }
511 
512  if (UpperBound.QuadPart > Target.QuadPart)
513  {
514  ToWrite = UpperBound.QuadPart - Target.QuadPart;
515  DPRINT("Zero first half %I64x %lx\n",
516  Target.QuadPart,
517  ToWrite);
518 
520  &Target,
521  ZeroBuf,
522  PAGE_SIZE,
523  TRUE,
524  &IOSB);
525 
526  if (!NT_SUCCESS(Status))
527  {
528  ExFreePool(ZeroBuf);
530  }
531  DPRINT1("RtlZeroMemory(%x,%x)\n", ZeroBuf, ToWrite);
532  RtlZeroMemory(ZeroBuf, ToWrite);
534  &Target,
535  ZeroBuf,
536  MIN(PAGE_SIZE,
537  UpperBound.QuadPart-Target.QuadPart),
538  &IOSB);
539  if (!NT_SUCCESS(Status))
540  {
541  ExFreePool(ZeroBuf);
543  }
544  Target.QuadPart += PAGE_SIZE;
545  }
546 
547  ExFreePool(ZeroBuf);
548  return TRUE;
549  }
550 
551  CcpLock();
552  ListEntry = Map->AssociatedBcb.Flink;
553 
554  while (ListEntry != &Map->AssociatedBcb)
555  {
556  Bcb = CONTAINING_RECORD(ListEntry, NOCC_BCB, ThisFileList);
558 
559  if (Bcb->FileOffset.QuadPart + Bcb->Length >= LowerBound.QuadPart &&
560  Bcb->FileOffset.QuadPart < UpperBound.QuadPart)
561  {
562  DPRINT("Bcb #%x (@%I64x)\n",
564  Bcb->FileOffset.QuadPart);
565 
566  Target.QuadPart = MAX(Bcb->FileOffset.QuadPart,
567  LowerBound.QuadPart);
568 
570  UpperBound.QuadPart);
571 
572  End.QuadPart = MIN(End.QuadPart,
573  Bcb->FileOffset.QuadPart + Bcb->Length);
574 
575  CcpUnlock();
576 
578  &Target,
579  End.QuadPart - Target.QuadPart,
580  TRUE,
581  Wait,
582  &PinnedBcb,
583  &PinnedBuffer))
584  {
585  return FALSE;
586  }
587 
588  ASSERT(PinnedBcb == Bcb);
589 
590  CcpLock();
591  ListEntry = ListEntry->Flink;
592  /* Return from pin state */
593  CcpUnpinData(PinnedBcb, TRUE);
594  }
595 
597  }
598 
599  CcpUnlock();
600 
601  return TRUE;
602 }
603 
605 NTAPI
607 {
609  PNOCC_CACHE_MAP Map = SectionObjectPointer->SharedCacheMap;
610  CcpLock();
611  if (!IsListEmpty(&Map->AssociatedBcb))
612  {
614  NOCC_BCB,
615  ThisFileList);
616 
618  }
619  CcpUnlock();
620  return Result;
621 }
622 
624 NTAPI
626 {
627  PNOCC_BCB RealBcb = (PNOCC_BCB)Bcb;
628  DPRINT("BCB #%x\n", RealBcb - CcCacheSections);
630 }
631 
632 /* EOF */
BOOLEAN NTAPI CcpUnpinData(PNOCC_BCB Bcb, BOOLEAN ActuallyRelease)
KEVENT CcpLazyWriteEvent
Definition: lazyrite.c:18
signed char * PCHAR
Definition: retypes.h:7
PULONG Buffer
Definition: typedefs.h:91
CLIENT_ID CcUnmapThreadId
Definition: fssup.c:27
BOOLEAN NTAPI CcPurgeCacheSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN UninitializeCacheMaps)
Definition: fssup.c:386
PFILE_OBJECT NTAPI MmGetFileObjectForSection(IN PVOID Section)
Definition: section.c:1681
_Must_inspect_result_ typedef _In_ PVOID Unused
Definition: iotypes.h:1149
#define IN
Definition: typedefs.h:39
DECLSPEC_NORETURN NTSYSAPI VOID NTAPI RtlRaiseStatus(_In_ NTSTATUS Status)
VOID NTAPI CcSetDirtyPageThreshold(IN PFILE_OBJECT FileObject, IN ULONG DirtyPageThreshold)
Definition: fssup.c:399
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
HANDLE CcLazyWriteThreadHandle
Definition: fssup.c:26
FAST_MUTEX CcMutex
Definition: pinsup.c:101
PFILE_OBJECT CcpFindOtherStreamFileObject(PFILE_OBJECT FileObject)
Definition: fssup.c:160
FAST_MUTEX CompletedTracesLock
Definition: cc.h:164
VOID NTAPI CcpUnmapThread(PVOID Unused)
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:411
#define ROUND_UP(n, align)
Definition: eventvwr.h:31
#define CcpLock()
Definition: newcc.h:143
PVOID LazyContext
Definition: newcc.h:35
struct _Entry Entry
Definition: kefuncs.h:627
#define TRUE
Definition: types.h:120
#define CACHE_NUM_SECTIONS
Definition: newcc.h:130
LONG NTSTATUS
Definition: precomp.h:26
#define CcpFlushCache(M, F, L, I, D)
Definition: newcc.h:96
BOOLEAN NTAPI CcpAcquireFileLock(PNOCC_CACHE_MAP Map)
Definition: fssup.c:131
PFILE_OBJECT FileObject
Definition: fssup.c:72
#define PAGE_ROUND_DOWN(x)
Definition: mmtypes.h:36
NTSYSAPI ULONG __cdecl DbgPrintEx(_In_ ULONG ComponentId, _In_ ULONG Level, _In_z_ _Printf_format_string_ PCSTR Format,...)
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1223
CLIENT_ID CcLazyWriteThreadId
Definition: fssup.c:27
VOID CcpReferenceCache(ULONG Sector)
Definition: pinsup.c:368
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
INIT_FUNCTION VOID NTAPI CcPfInitializePrefetcher(VOID)
Definition: fssup.c:114
static CC_FILE_SIZES FileSizes
#define InsertTailList(ListHead, Entry)
Definition: newcc.h:3
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
PFILE_OBJECT NTAPI CcGetFileObjectFromBcb(PVOID Bcb)
Definition: fssup.c:625
INIT_FUNCTION BOOLEAN NTAPI CcInitializeCacheManager(VOID)
Definition: fssup.c:83
NOCC_BCB CcCacheSections[CACHE_NUM_SECTIONS]
Definition: pinsup.c:98
BOOLEAN NTAPI CcGetFileSizes(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes)
Definition: fssup.c:375
_Must_inspect_result_ _In_ PDEVICE_OBJECT _In_ PSECTION_OBJECT_POINTERS SectionObjectPointer
Definition: fsrtlfuncs.h:1368
LARGE_INTEGER FileSize
Definition: cctypes.h:16
T MIN(T a, T b)
Definition: polytest.cpp:79
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
PFILE_OBJECT NTAPI CcGetFileObjectFromSectionPtrs(IN PSECTION_OBJECT_POINTERS SectionObjectPointer)
Definition: fssup.c:606
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
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FALSE
Definition: types.h:117
BOOLEAN NTAPI CcZeroData(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER StartOffset, IN PLARGE_INTEGER EndOffset, IN BOOLEAN Wait)
Definition: fssup.c:414
long LONG
Definition: pedump.c:60
PNOCC_CACHE_MAP Map
Definition: fssup.c:73
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
KEVENT CcDeleteEvent
Definition: pinsup.c:102
_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
void DPRINT(...)
Definition: polytest.cpp:61
LIST_ENTRY AssociatedBcb
Definition: newcc.h:29
LIST_ENTRY ListEntry
Definition: fssup.c:71
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:588
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
FAST_MUTEX GlobalPageOperation
Definition: fssup.c:28
FAST_MUTEX
Definition: extypes.h:17
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
LIST_ENTRY Entry
Definition: newcc.h:28
LIST_ENTRY CompletedTraces
Definition: cc.h:163
const struct winhelp_callbacks Callbacks
Definition: callback.c:161
if(!(yy_init))
Definition: macro.lex.yy.c:714
PROS_SECTION_OBJECT SectionObject
Definition: newcc.h:9
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID NTAPI CcInitializeCacheMap(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes, IN BOOLEAN PinAccess, IN PCACHE_MANAGER_CALLBACKS Callbacks, IN PVOID LazyWriteContext)
Definition: fssup.c:195
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
PACQUIRE_FOR_LAZY_WRITE AcquireForLazyWrite
Definition: cctypes.h:39
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_Must_inspect_result_ typedef _In_ ULONG _In_ BOOLEAN Target
Definition: iotypes.h:1088
* PFILE_OBJECT
Definition: iotypes.h:1978
KEVENT CcFinalizeEvent
Definition: pinsup.c:103
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
LIST_ENTRY PrivateCacheMaps
Definition: newcc.h:30
VOID NTAPI CcpLazyWriteThread(PVOID Unused)
Definition: lazyrite.c:23
VOID NTAPI CcpReleaseFileLock(PNOCC_CACHE_MAP Map)
Definition: fssup.c:139
Status
Definition: gdiplustypes.h:24
PRTL_BITMAP CcCacheBitmap
Definition: pinsup.c:100
#define MiSimpleWrite(F, O, B, L, R)
Definition: newmm.h:198
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
ULONG SizeOfBitMap
Definition: typedefs.h:90
ULONG LowPart
Definition: typedefs.h:106
LARGE_INTEGER ValidDataLength
Definition: cctypes.h:17
#define PAGE_SIZE
Definition: env_spec_w32.h:49
Definition: typedefs.h:119
LIST_ENTRY CcpAllSharedCacheMaps
Definition: fssup.c:76
T MAX(T a, T b)
Definition: polytest.cpp:85
NTSTATUS NTAPI MmExtendCacheSection(PROS_SECTION_OBJECT Section, PLARGE_INTEGER NewSize, BOOLEAN ExtendFile)
Definition: data.c:758
CC_FILE_SIZES FileSizes
Definition: newcc.h:33
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
LARGE_INTEGER AllocationSize
Definition: cctypes.h:15
VOID CcpDereferenceCache(ULONG Sector, BOOLEAN Immediate)
Definition: pinsup.c:213
struct _NOCC_PRIVATE_CACHE_MAP NOCC_PRIVATE_CACHE_MAP
BOOLEAN NTAPI CcUninitializeCacheMap(IN PFILE_OBJECT FileObject, IN OPTIONAL PLARGE_INTEGER TruncateSize, IN OPTIONAL PCACHE_UNINITIALIZE_EVENT UninitializeEvent)
Definition: fssup.c:286
PFSN_PREFETCHER_GLOBALS CcPfGlobals
Definition: fssup.c:20
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:159
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
VOID NTAPI CcSetFileSizes(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes)
Definition: fssup.c:356
ULONG NTAPI CcpCountCacheSections(IN PNOCC_CACHE_MAP Map)
Definition: fssup.c:272
unsigned int * PULONG
Definition: retypes.h:1
CACHE_MANAGER_CALLBACKS Callbacks
Definition: newcc.h:34
struct _NOCC_BCB * PNOCC_BCB
#define PAGE_ROUND_UP(x)
Definition: mmtypes.h:38
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57
#define DPRINT1
Definition: precomp.h:8
#define ObReferenceObject
Definition: obfuncs.h:204
PRELEASE_FROM_LAZY_WRITE ReleaseFromLazyWrite
Definition: cctypes.h:40
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define CcpUnlock()
Definition: newcc.h:144
LIST_ENTRY ActiveTraces
Definition: cc.h:160
LONG CcOutstandingDeletes
Definition: pinsup.c:105
ULONG ReadAheadGranularity
Definition: newcc.h:38
#define DPFLTR_TRACE_LEVEL
Definition: kdtypes.h:32
BOOLEAN NTAPI CcPreparePinWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Zero, IN ULONG Flags, OUT PVOID *Bcb, OUT PVOID *Buffer)
Definition: pinsup.c:827
HANDLE CcUnmapThreadHandle
Definition: fssup.c:26
struct _NOCC_PRIVATE_CACHE_MAP * PNOCC_PRIVATE_CACHE_MAP
base of all file and directory entries
Definition: entries.h:82
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define FO_STREAM_FILE
Definition: iotypes.h:1763
LONGLONG QuadPart
Definition: typedefs.h:114
struct _NOCC_CACHE_MAP * PNOCC_CACHE_MAP
IN BOOLEAN Wait
Definition: fatprocs.h:1538
NTSTATUS NTAPI MiSimpleRead(PFILE_OBJECT FileObject, PLARGE_INTEGER FileOffset, PVOID Buffer, ULONG Length, BOOLEAN Paging, PIO_STATUS_BLOCK ReadStatus)
Definition: io.c:114
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68