ReactOS 0.4.15-dev-8119-g4fb2fdb
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
29
30/*
31
32A note about private cache maps.
33
34CcInitializeCacheMap and CcUninitializeCacheMap are not meant to be paired,
35although they can work that way.
36
37The actual operation I've gleaned from reading both jan kratchovil's writing
38and real filesystems is this:
39
40CcInitializeCacheMap means:
41
42Make the indicated FILE_OBJECT have a private cache map if it doesn't already
43and make it have a shared cache map if it doesn't already.
44
45CcUninitializeCacheMap means:
46
47Take away the private cache map from this FILE_OBJECT. If it's the last
48private cache map corresponding to a specific shared cache map (the one that
49was present in the FILE_OBJECT when it was created), then delete that too,
50flusing all cached information.
51
52Using these simple semantics, filesystems can do all the things they actually
53do:
54
55- Copy out the shared cache map pointer from a newly initialized file object
56and store it in the fcb cache.
57- Copy it back into any file object and call CcInitializeCacheMap to make
58that 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
60first one count for each specific FILE_OBJECT.
61- Have the actual last call to CcUninitializeCacheMap (that is, the one that
62causes zero private cache maps to be associated with a shared cache map) to
63delete the cache map and flush.
64
65So private cache map here is a light weight structure that just remembers
66what shared cache map it associates with.
67
68 */
70{
75
77
78/* FUNCTIONS ******************************************************************/
79
80CODE_SEG("INIT")
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
111CODE_SEG("INIT")
112VOID
113NTAPI
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
130NTAPI
132{
133 DPRINT("Calling AcquireForLazyWrite: %x\n", Map->LazyContext);
135}
136
137VOID
138NTAPI
140{
141 DPRINT("Releasing Lazy Write %x\n", Map->LazyContext);
143}
144
145/*
146
147Cc functions are required to treat alternate streams of a file as the same
148for the purpose of caching, meaning that we must be able to find the shared
149cache map associated with the ``real'' stream associated with a stream file
150object, if one exists. We do that by identifying a private cache map in
151our gamut that has the same volume, device and fscontext as the stream file
152object we're holding. It's heavy but it does work. This can probably be
153improved, although there doesn't seem to be any real association between
154a stream file object and a sibling file object in the file object struct
155itself.
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
193VOID
194NTAPI
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",
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",
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
264This function is used by NewCC's MM to determine whether any section objects
265for a given file are not cache sections. If that's true, we're not allowed
266to resize the file, although nothing actually prevents us from doing ;-)
267
268 */
269
270ULONG
271NTAPI
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
285NTAPI
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
348CcSetFileSizes is used to tell the cache manager that the file changed
349size. In our case, we use the internal Mm method MmExtendCacheSection
350to notify Mm that our section potentially changed size, which may mean
351truncating off data.
352
353 */
354VOID
355NTAPI
358{
359 PNOCC_CACHE_MAP Map = (PNOCC_CACHE_MAP)FileObject->SectionObjectPointer->SharedCacheMap;
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
374NTAPI
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
385NTAPI
389 IN BOOLEAN UninitializeCacheMaps)
390{
392 if (!Map) return TRUE;
393 CcpFlushCache(Map, NULL, 0, NULL, TRUE);
394 return TRUE;
395}
396
397VOID
398NTAPI
400 IN ULONG DirtyPageThreshold)
401{
403}
404
405/*
406
407This could be implemented much more intelligently by mapping instances
408of a CoW zero page into the affected regions. We just RtlZeroMemory
409for now.
410
411*/
413NTAPI
415 IN PLARGE_INTEGER StartOffset,
416 IN PLARGE_INTEGER EndOffset,
418{
420 PLIST_ENTRY ListEntry = NULL;
421 LARGE_INTEGER LowerBound = *StartOffset;
422 LARGE_INTEGER UpperBound = *EndOffset;
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,
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,
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
605NTAPI
607{
609 PNOCC_CACHE_MAP Map = SectionObjectPointer->SharedCacheMap;
610 CcpLock();
611 if (!IsListEmpty(&Map->AssociatedBcb))
612 {
614 NOCC_BCB,
615 ThisFileList);
616
617 Result = MmGetFileObjectForSection((PROS_SECTION_OBJECT)Bcb->SectionObject);
618 }
619 CcpUnlock();
620 return Result;
621}
622
624NTAPI
626{
627 PNOCC_BCB RealBcb = (PNOCC_BCB)Bcb;
628 DPRINT("BCB #%x\n", RealBcb - CcCacheSections);
629 return MmGetFileObjectForSection((PROS_SECTION_OBJECT)RealBcb->SectionObject);
630}
631
632/* EOF */
#define CODE_SEG(...)
static CC_FILE_SIZES FileSizes
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define MIN(x, y)
Definition: rdesktop.h:171
#define MAX(x, y)
Definition: rdesktop.h:175
#define DPRINT1
Definition: precomp.h:8
const struct winhelp_callbacks Callbacks
Definition: callback.c:161
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:160
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
@ DPFLTR_PREFETCHER_ID
Definition: dpfilter.h:91
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define NonPagedPool
Definition: env_spec_w32.h:307
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define PagedPool
Definition: env_spec_w32.h:308
#define ROUND_UP(n, align)
Definition: eventvwr.h:34
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:414
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
_Must_inspect_result_ _In_ PDEVICE_OBJECT _In_ PSECTION_OBJECT_POINTERS SectionObjectPointer
Definition: fsrtlfuncs.h:1369
FAST_MUTEX GlobalPageOperation
Definition: fssup.c:28
VOID NTAPI CcSetFileSizes(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes)
Definition: fssup.c:356
HANDLE CcUnmapThreadHandle
Definition: fssup.c:26
BOOLEAN NTAPI CcGetFileSizes(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes)
Definition: fssup.c:375
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
PFSN_PREFETCHER_GLOBALS CcPfGlobals
Definition: fssup.c:20
PFILE_OBJECT NTAPI CcGetFileObjectFromBcb(PVOID Bcb)
Definition: fssup.c:625
PFILE_OBJECT CcpFindOtherStreamFileObject(PFILE_OBJECT FileObject)
Definition: fssup.c:160
KEVENT CcpLazyWriteEvent
Definition: lazyrite.c:18
CLIENT_ID CcLazyWriteThreadId
Definition: fssup.c:27
ULONG NTAPI CcpCountCacheSections(IN PNOCC_CACHE_MAP Map)
Definition: fssup.c:272
BOOLEAN NTAPI CcUninitializeCacheMap(IN PFILE_OBJECT FileObject, IN OPTIONAL PLARGE_INTEGER TruncateSize, IN OPTIONAL PCACHE_UNINITIALIZE_EVENT UninitializeEvent)
Definition: fssup.c:286
VOID NTAPI CcSetDirtyPageThreshold(IN PFILE_OBJECT FileObject, IN ULONG DirtyPageThreshold)
Definition: fssup.c:399
VOID NTAPI CcpReleaseFileLock(PNOCC_CACHE_MAP Map)
Definition: fssup.c:139
BOOLEAN NTAPI CcInitializeCacheManager(VOID)
Definition: fssup.c:83
BOOLEAN NTAPI CcZeroData(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER StartOffset, IN PLARGE_INTEGER EndOffset, IN BOOLEAN Wait)
Definition: fssup.c:414
CLIENT_ID CcUnmapThreadId
Definition: fssup.c:27
struct _NOCC_PRIVATE_CACHE_MAP * PNOCC_PRIVATE_CACHE_MAP
HANDLE CcLazyWriteThreadHandle
Definition: fssup.c:26
BOOLEAN NTAPI CcPurgeCacheSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN UninitializeCacheMaps)
Definition: fssup.c:386
LONG CcOutstandingDeletes
Definition: pinsup.c:105
PFILE_OBJECT NTAPI CcGetFileObjectFromSectionPtrs(IN PSECTION_OBJECT_POINTERS SectionObjectPointer)
Definition: fssup.c:606
KEVENT CcFinalizeEvent
Definition: pinsup.c:103
LIST_ENTRY CcpAllSharedCacheMaps
Definition: fssup.c:76
VOID NTAPI CcpUnmapThread(PVOID Unused)
struct _NOCC_PRIVATE_CACHE_MAP NOCC_PRIVATE_CACHE_MAP
VOID NTAPI CcpLazyWriteThread(PVOID Unused)
Definition: lazyrite.c:23
VOID NTAPI CcPfInitializePrefetcher(VOID)
Definition: fssup.c:114
BOOLEAN NTAPI CcpAcquireFileLock(PNOCC_CACHE_MAP Map)
Definition: fssup.c:131
Status
Definition: gdiplustypes.h:25
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 Unused(x)
Definition: atlwin.h:28
if(dx< 0)
Definition: linetemp.h:194
#define ASSERT(a)
Definition: mode.c:44
#define DPFLTR_TRACE_LEVEL
Definition: kdtypes.h:32
#define PAGE_ROUND_UP(x)
Definition: mmtypes.h:38
#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,...)
DECLSPEC_NORETURN NTSYSAPI VOID NTAPI RtlRaiseStatus(_In_ NTSTATUS Status)
FAST_MUTEX CcMutex
Definition: pinsup.c:101
#define CcpFlushCache(M, F, L, I, D)
Definition: newcc.h:91
BOOLEAN NTAPI CcpUnpinData(PNOCC_BCB Bcb, BOOLEAN ActuallyRelease)
NOCC_BCB CcCacheSections[CACHE_NUM_SECTIONS]
Definition: pinsup.c:98
struct _NOCC_BCB * PNOCC_BCB
struct _NOCC_CACHE_MAP * PNOCC_CACHE_MAP
VOID CcpReferenceCache(ULONG Sector)
Definition: pinsup.c:368
VOID CcpDereferenceCache(ULONG Sector, BOOLEAN Immediate)
Definition: pinsup.c:213
PRTL_BITMAP CcCacheBitmap
Definition: pinsup.c:100
KEVENT CcDeleteEvent
Definition: pinsup.c:102
#define CcpLock()
Definition: newcc.h:138
#define CcpUnlock()
Definition: newcc.h:139
#define CACHE_NUM_SECTIONS
Definition: newcc.h:125
NTSTATUS NTAPI MmExtendCacheSection(PSECTION Section, PLARGE_INTEGER NewSize, BOOLEAN ExtendFile)
#define MiSimpleWrite(F, O, B, L, R)
Definition: newmm.h:145
int Count
Definition: noreturn.cpp:7
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
@ SynchronizationEvent
NTSTATUS NTAPI MiSimpleRead(PFILE_OBJECT FileObject, PLARGE_INTEGER FileOffset, PVOID Buffer, ULONG Length, BOOLEAN Paging, PIO_STATUS_BLOCK ReadStatus)
Definition: io.c:109
PFILE_OBJECT NTAPI MmGetFileObjectForSection(IN PVOID Section)
Definition: section.c:1541
long LONG
Definition: pedump.c:60
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
#define DPRINT
Definition: sndvol32.h:73
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
base of all file and directory entries
Definition: entries.h:83
PACQUIRE_FOR_LAZY_WRITE AcquireForLazyWrite
Definition: cctypes.h:39
PRELEASE_FROM_LAZY_WRITE ReleaseFromLazyWrite
Definition: cctypes.h:40
LARGE_INTEGER FileSize
Definition: cctypes.h:16
LARGE_INTEGER ValidDataLength
Definition: cctypes.h:17
LARGE_INTEGER AllocationSize
Definition: cctypes.h:15
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
Definition: newcc.h:4
PSECTION SectionObject
Definition: newcc.h:9
CACHE_MANAGER_CALLBACKS Callbacks
Definition: newcc.h:34
PVOID LazyContext
Definition: newcc.h:35
LIST_ENTRY Entry
Definition: newcc.h:28
ULONG ReadAheadGranularity
Definition: newcc.h:38
CC_FILE_SIZES FileSizes
Definition: newcc.h:33
LIST_ENTRY PrivateCacheMaps
Definition: newcc.h:30
LIST_ENTRY AssociatedBcb
Definition: newcc.h:29
PNOCC_CACHE_MAP Map
Definition: fssup.c:73
LIST_ENTRY ListEntry
Definition: fssup.c:71
PFILE_OBJECT FileObject
Definition: fssup.c:72
LIST_ENTRY ActiveTraces
Definition: cc.h:160
LIST_ENTRY CompletedTraces
Definition: cc.h:163
FAST_MUTEX CompletedTracesLock
Definition: cc.h:164
ULONG SizeOfBitMap
Definition: typedefs.h:90
PULONG Buffer
Definition: typedefs.h:91
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LONGLONG QuadPart
Definition: typedefs.h:114
ULONG LowPart
Definition: typedefs.h:106
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
_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:409
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
FAST_MUTEX
Definition: extypes.h:17
* PFILE_OBJECT
Definition: iotypes.h:1998
#define FO_STREAM_FILE
Definition: iotypes.h:1783
#define ObDereferenceObject
Definition: obfuncs.h:203
#define ObReferenceObject
Definition: obfuncs.h:204