ReactOS  0.4.14-dev-358-gbef841c
CcSetFileSizes_drv.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS kernel-mode tests
3  * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
4  * PURPOSE: Test driver for CcSetFileSizes function
5  * PROGRAMMER: Pierre Schweitzer <pierre@reactos.org>
6  */
7 
8 #include <kmt_test.h>
9 
10 #define NDEBUG
11 #include <debug.h>
12 
13 #define IOCTL_START_TEST 1
14 #define IOCTL_FINISH_TEST 2
15 
16 typedef struct _TEST_FCB
17 {
22 
23 static ULONG TestTestId = -1;
26 static KMT_IRP_HANDLER TestIrpHandler;
27 static KMT_MESSAGE_HANDLER TestMessageHandler;
33 
39  _Inout_ INT *Flags)
40 {
42 
43  PAGED_CODE();
44 
46 
47  *DeviceName = L"CcSetFileSizes";
48  *Flags = TESTENTRY_NO_EXCLUSIVE_DEVICE |
49  TESTENTRY_BUFFERED_IO_DEVICE |
50  TESTENTRY_NO_READONLY_DEVICE;
51 
55 
56  return Status;
57 }
58 
59 VOID
62 {
63  PAGED_CODE();
64 }
65 
66 BOOLEAN
67 NTAPI
71 {
72  return TRUE;
73 }
74 
75 VOID
76 NTAPI
79 {
80  return;
81 }
82 
83 BOOLEAN
84 NTAPI
88 {
89  return TRUE;
90 }
91 
92 VOID
93 NTAPI
96 {
97  return;
98 }
99 
105 };
106 
111 };
112 
113 static
114 PVOID
116  _In_ _Out_ PIRP Irp,
118 {
119  PMDL Mdl;
120 
121  if (Irp->MdlAddress == NULL)
122  {
123  Mdl = IoAllocateMdl(Irp->UserBuffer, BufferLength, FALSE, FALSE, Irp);
124  if (Mdl == NULL)
125  {
126  return NULL;
127  }
128 
129  _SEH2_TRY
130  {
131  MmProbeAndLockPages(Mdl, Irp->RequestorMode, IoWriteAccess);
132  }
134  {
135  IoFreeMdl(Mdl);
136  Irp->MdlAddress = NULL;
137  _SEH2_YIELD(return NULL);
138  }
139  _SEH2_END;
140  }
141 
143 }
144 
145 static
146 VOID
148  ULONG TestId,
150 {
151  PVOID Bcb;
152  BOOLEAN Ret;
153  PULONG Buffer;
154  PTEST_FCB Fcb;
157 
160  ok_eq_ulong(TestTestId, -1);
161 
162  TestWritten = FALSE;
164  TestTestId = TestId;
166  if (!skip(TestFileObject != NULL, "Failed to allocate FO\n"))
167  {
169  if (!skip(Fcb != NULL, "ExAllocatePool failed\n"))
170  {
171  RtlZeroMemory(Fcb, sizeof(TEST_FCB));
172  ExInitializeFastMutex(&Fcb->HeaderMutex);
173  FsRtlSetupAdvancedHeader(&Fcb->Header, &Fcb->HeaderMutex);
174 
175  TestFileObject->FsContext = Fcb;
176  TestFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
177  Fcb->Header.AllocationSize.QuadPart = VACB_MAPPING_GRANULARITY;
178  Fcb->Header.FileSize.QuadPart = VACB_MAPPING_GRANULARITY - PAGE_SIZE;
179  Fcb->Header.ValidDataLength.QuadPart = VACB_MAPPING_GRANULARITY - PAGE_SIZE;
180 
181  if ((TestId > 1 && TestId < 4) || TestId == 5)
182  {
183  Fcb->Header.AllocationSize.QuadPart = VACB_MAPPING_GRANULARITY - PAGE_SIZE;
184  }
185 
186  KmtStartSeh();
189 
190  if (!skip(CcIsFileCached(TestFileObject) == TRUE, "CcInitializeCacheMap failed\n"))
191  {
192  trace("Starting test: %d\n", TestId);
193 
194  if (TestId == 0 || TestId == 2)
195  {
196  Offset.QuadPart = 0;
197  KmtStartSeh();
200 
201  if (!skip(Ret == TRUE, "CcMapData failed\n"))
202  {
203  ok_eq_ulong(Buffer[(VACB_MAPPING_GRANULARITY - PAGE_SIZE - sizeof(ULONG)) / sizeof(ULONG)], 0xBABABABA);
204  CcUnpinData(Bcb);
205  }
206 
207  KmtStartSeh();
210 
211  Fcb->Header.AllocationSize.QuadPart = VACB_MAPPING_GRANULARITY;
212  Fcb->Header.FileSize.QuadPart = VACB_MAPPING_GRANULARITY;
213 
214  Offset.QuadPart = 0;
215  KmtStartSeh();
218 
219  if (!skip(Ret == TRUE, "CcMapData failed\n"))
220  {
221  ok_eq_ulong(Buffer[(VACB_MAPPING_GRANULARITY - sizeof(ULONG)) / sizeof(ULONG)], 0xBABABABA);
222 
223  CcUnpinData(Bcb);
224  }
225  }
226  else if (TestId == 1 || TestId == 3)
227  {
229  if (!skip(Buffer != NULL, "ExAllocatePool failed\n"))
230  {
231  Ret = FALSE;
232  Offset.QuadPart = VACB_MAPPING_GRANULARITY - 2 * PAGE_SIZE;
233 
234  KmtStartSeh();
237 
238  ok_eq_ulong(Buffer[(PAGE_SIZE - sizeof(ULONG)) / sizeof(ULONG)], 0xBABABABA);
239 
240  KmtStartSeh();
243 
244  Fcb->Header.AllocationSize.QuadPart = VACB_MAPPING_GRANULARITY;
245  Fcb->Header.FileSize.QuadPart = VACB_MAPPING_GRANULARITY;
247 
249 
250  KmtStartSeh();
253 
254  ok_eq_ulong(Buffer[(PAGE_SIZE - sizeof(ULONG)) / sizeof(ULONG)], 0xBABABABA);
255 
257  }
258  }
259  else if (TestId == 4 || TestId == 5)
260  {
261  /* Kill lazy writer */
263 
264  Offset.QuadPart = 0;
265  KmtStartSeh();
268 
269  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
270  {
271  LARGE_INTEGER Flushed;
272 
273  ok_eq_ulong(Buffer[(VACB_MAPPING_GRANULARITY - PAGE_SIZE - sizeof(ULONG)) / sizeof(ULONG)], 0xBABABABA);
274  Buffer[(VACB_MAPPING_GRANULARITY - PAGE_SIZE - sizeof(ULONG)) / sizeof(ULONG)] = 0xDADADADA;
275 
276  TestDirtying = TRUE;
279 
280  ok_bool_false(TestWritten, "Dirty VACB has been unexpectedly written!\n");
281 
282  TestSizing = TRUE;
283  KmtStartSeh();
286  TestSizing = FALSE;
287 
288  ok_bool_false(TestWritten, "Dirty VACB has been unexpectedly written!\n");
289 
290  Fcb->Header.AllocationSize.QuadPart = VACB_MAPPING_GRANULARITY;
291  Fcb->Header.FileSize.QuadPart = VACB_MAPPING_GRANULARITY;
292 
293  Flushed = CcGetFlushedValidData(TestFileObject->SectionObjectPointer, FALSE);
294  ok(Flushed.QuadPart == 0, "Flushed: %I64d\n", Flushed.QuadPart);
295 
296  TestUnpin = TRUE;
297  CcUnpinData(Bcb);
298  TestUnpin = FALSE;
299 
300  ok_bool_false(TestWritten, "Dirty VACB has been unexpectedly written!\n");
301 
302  Offset.QuadPart = 0;
303  KmtStartSeh();
306 
307  if (!skip(Ret == TRUE, "CcMapData failed\n"))
308  {
309  ok_eq_ulong(Buffer[(VACB_MAPPING_GRANULARITY - PAGE_SIZE - sizeof(ULONG)) / sizeof(ULONG)], 0xDADADADA);
310  ok_eq_ulong(Buffer[(VACB_MAPPING_GRANULARITY - sizeof(ULONG)) / sizeof(ULONG)], 0xBABABABA);
311 
312  CcUnpinData(Bcb);
313 
314  ok_bool_false(TestWritten, "Dirty VACB has been unexpectedly written!\n");
315  }
316  }
317  }
318  }
319  }
320  }
321 }
322 
323 
324 static
325 VOID
327  ULONG TestId,
329 {
331  CACHE_UNINITIALIZE_EVENT CacheUninitEvent;
332 
334  ok_eq_ulong(TestTestId, TestId);
335 
336  if (!skip(TestFileObject != NULL, "No test FO\n"))
337  {
339  {
341  KeInitializeEvent(&CacheUninitEvent.Event, NotificationEvent, FALSE);
342  CcUninitializeCacheMap(TestFileObject, &Zero, &CacheUninitEvent);
343  KeWaitForSingleObject(&CacheUninitEvent.Event, Executive, KernelMode, FALSE, NULL);
345  }
346 
347  if (TestFileObject->FsContext != NULL)
348  {
349  ExFreePool(TestFileObject->FsContext);
350  TestFileObject->FsContext = NULL;
351  TestFileObject->SectionObjectPointer = NULL;
352  }
353 
355  }
356 
359  TestTestId = -1;
360 }
361 
362 
363 static
364 NTSTATUS
369  _In_ SIZE_T InLength,
370  _Inout_ PSIZE_T OutLength)
371 {
373 
375 
376  switch (ControlCode)
377  {
378  case IOCTL_START_TEST:
379  ok_eq_ulong((ULONG)InLength, sizeof(ULONG));
381  break;
382 
383  case IOCTL_FINISH_TEST:
384  ok_eq_ulong((ULONG)InLength, sizeof(ULONG));
386  break;
387 
388  default:
390  break;
391  }
392 
394 
395  return Status;
396 }
397 
398 static
399 NTSTATUS
402  _In_ PIRP Irp,
403  _In_ PIO_STACK_LOCATION IoStack)
404 {
406 
407  PAGED_CODE();
408 
409  DPRINT("IRP %x/%x\n", IoStack->MajorFunction, IoStack->MinorFunction);
410  ASSERT(IoStack->MajorFunction == IRP_MJ_READ ||
411  IoStack->MajorFunction == IRP_MJ_WRITE);
412 
414 
416  Irp->IoStatus.Information = 0;
417 
418  if (IoStack->MajorFunction == IRP_MJ_READ)
419  {
420  PMDL Mdl;
421  ULONG Length;
422  PTEST_FCB Fcb;
424  PVOID Buffer, OrigBuffer;
425 
426  Offset = IoStack->Parameters.Read.ByteOffset;
427  Length = IoStack->Parameters.Read.Length;
428  Fcb = IoStack->FileObject->FsContext;
429 
431  ok_eq_pointer(IoStack->FileObject, TestFileObject);
432  ok(Fcb != NULL, "Null FCB\n");
433 
434  ok(FlagOn(Irp->Flags, IRP_NOCACHE), "Not coming from Cc\n");
435 
436  ok_irql(APC_LEVEL);
437  ok((Offset.QuadPart % PAGE_SIZE == 0 || Offset.QuadPart == 0), "Offset is not aligned: %I64i\n", Offset.QuadPart);
438  ok(Length % PAGE_SIZE == 0, "Length is not aligned: %I64i\n", Length);
439 
440  ok(Irp->AssociatedIrp.SystemBuffer == NULL, "A SystemBuffer was allocated!\n");
441  OrigBuffer = Buffer = MapAndLockUserBuffer(Irp, Length);
442  ok(Buffer != NULL, "Null pointer!\n");
443 
444  if (Offset.QuadPart < Fcb->Header.FileSize.QuadPart)
445  {
446  RtlFillMemory(Buffer, min(Length, Fcb->Header.FileSize.QuadPart - Offset.QuadPart), 0xBA);
447  Buffer = (PVOID)((ULONG_PTR)Buffer + (ULONG_PTR)min(Length, Fcb->Header.FileSize.QuadPart - Offset.QuadPart));
448 
449  if (Length > (Fcb->Header.FileSize.QuadPart - Offset.QuadPart))
450  {
451  RtlFillMemory(Buffer, Length - Fcb->Header.FileSize.QuadPart, 0xBD);
452  }
453  }
454  else
455  {
456  RtlFillMemory(Buffer, Length, 0xBD);
457  }
458 
459  if ((TestTestId == 4 || TestTestId == 5) && TestWritten &&
460  Offset.QuadPart <= VACB_MAPPING_GRANULARITY - PAGE_SIZE - sizeof(ULONG) &&
462  {
463  Buffer = (PVOID)((ULONG_PTR)OrigBuffer + (VACB_MAPPING_GRANULARITY - PAGE_SIZE - sizeof(ULONG)));
464  RtlFillMemory(Buffer, sizeof(ULONG), 0xDA);
465  }
466 
468 
469  Mdl = Irp->MdlAddress;
470  ok(Mdl != NULL, "Null pointer for MDL!\n");
471  ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) != 0, "MDL not locked\n");
472  ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) == 0, "MDL from non paged\n");
473  ok((Mdl->MdlFlags & MDL_IO_PAGE_READ) != 0, "Non paging IO\n");
474  ok((Irp->Flags & IRP_PAGING_IO) != 0, "Non paging IO\n");
475 
476  Irp->IoStatus.Information = Length;
477  }
478  else if (IoStack->MajorFunction == IRP_MJ_WRITE)
479  {
480  PMDL Mdl;
481  ULONG Length;
482  PVOID Buffer;
484 
485  Offset = IoStack->Parameters.Write.ByteOffset;
486  Length = IoStack->Parameters.Write.Length;
487 
488  ok((TestTestId == 4 || TestTestId == 5), "Unexpected test id: %d\n", TestTestId);
490  ok_eq_pointer(IoStack->FileObject, TestFileObject);
491 
492  ok_bool_false(TestUnpin, "Write triggered while unpinning!\n");
493  ok_bool_false(TestSizing, "Write triggered while sizing!\n");
494  ok_bool_false(TestDirtying, "Write triggered while dirtying!\n");
495  ok_bool_true(TestUncaching, "Write not triggered while uncaching!\n");
496 
497  ok(FlagOn(Irp->Flags, IRP_NOCACHE), "Not coming from Cc\n");
498 
499  ok_irql(PASSIVE_LEVEL);
500  ok((Offset.QuadPart % PAGE_SIZE == 0 || Offset.QuadPart == 0), "Offset is not aligned: %I64i\n", Offset.QuadPart);
501  ok(Length % PAGE_SIZE == 0, "Length is not aligned: %I64i\n", Length);
502 
504  ok(Buffer != NULL, "Null pointer!\n");
505 
506  Mdl = Irp->MdlAddress;
507  ok(Mdl != NULL, "Null pointer for MDL!\n");
508  ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) != 0, "MDL not locked\n");
509  ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) == 0, "MDL from non paged\n");
510  ok((Irp->Flags & IRP_PAGING_IO) != 0, "Non paging IO\n");
511 
512  TestWritten = TRUE;
514  Irp->IoStatus.Information = Length;
515  }
516 
517  if (Status == STATUS_PENDING)
518  {
522  }
523  else
524  {
525  Irp->IoStatus.Status = Status;
527  }
528 
530 
531  return Status;
532 }
#define MDL_IO_PAGE_READ
Definition: mmtypes.h:24
static KMT_MESSAGE_HANDLER TestMessageHandler
#define ok_eq_ulong(value, expected)
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define TRUE
Definition: types.h:120
#define LL
Definition: tui.h:85
#define FsRtlEnterFileSystem
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:402
#define FsRtlExitFileSystem
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:931
static ULONG TestTestId
PFILE_OBJECT FileObject
Definition: ntfs.h:516
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
VOID NTAPI CcSetDirtyPinnedData(IN PVOID BcbVoid, IN OPTIONAL PLARGE_INTEGER Lsn)
Definition: cachesub.c:121
#define ok_eq_pointer(value, expected)
LONG NTSTATUS
Definition: precomp.h:26
#define KmtEndSeh(ExpectedStatus)
Definition: kmt_test.h:283
VOID NTAPI CcUnpinData(IN PVOID Bcb)
Definition: pinsup.c:955
#define IRP_NOCACHE
#define MAP_WAIT
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
static BOOLEAN TestUncaching
WCHAR DeviceName[]
Definition: adapter.cpp:21
BOOLEAN NTAPI AcquireForLazyWrite(_In_ PVOID Context, _In_ BOOLEAN Wait)
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
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
int32_t INT
Definition: typedefs.h:56
static CC_FILE_SIZES NewFileSizes
#define PAGED_CODE()
Definition: video.h:57
#define _In_opt_
Definition: no_sal2.h:213
_SEH2_TRY
Definition: create.c:4250
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define ok_bool_false(value, desc)
Definition: kmt_test.h:257
#define ok_bool_true(value, desc)
Definition: kmt_test.h:256
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
VOID TestUnload(_In_ PDRIVER_OBJECT DriverObject)
#define RTL_CONSTANT_LARGE_INTEGER(quad_part)
Definition: rtltypes.h:414
ULONG_PTR * PSIZE_T
Definition: typedefs.h:78
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_In_ ULONG BufferLength
Definition: usbdlib.h:225
#define CcIsFileCached(FO)
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
VOID NTAPI ReleaseFromReadAhead(_In_ PVOID Context)
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI CcSetAdditionalCacheAttributes(IN PFILE_OBJECT FileObject, IN BOOLEAN DisableReadAhead, IN BOOLEAN DisableWriteBehind)
Definition: logsup.c:22
#define _Out_
Definition: no_sal2.h:323
#define MDL_SOURCE_IS_NONPAGED_POOL
Definition: mmtypes.h:20
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
PFILE_OBJECT NTAPI IoCreateStreamFileObject(IN PFILE_OBJECT FileObject, IN PDEVICE_OBJECT DeviceObject)
Definition: file.c:3186
NTSTATUS KmtRegisterIrpHandler(IN UCHAR MajorFunction, IN PDEVICE_OBJECT DeviceObject OPTIONAL, IN PKMT_IRP_HANDLER IrpHandler)
static PFILE_OBJECT TestFileObject
FAST_MUTEX
Definition: extypes.h:17
int64_t LONGLONG
Definition: typedefs.h:66
BOOLEAN NTAPI CcMapData(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG Flags, OUT PVOID *BcbResult, OUT PVOID *Buffer)
Definition: pinsup.c:694
NTSTATUS KmtRegisterMessageHandler(IN ULONG ControlCode OPTIONAL, IN PDEVICE_OBJECT DeviceObject OPTIONAL, IN PKMT_MESSAGE_HANDLER MessageHandler)
#define trace
Definition: atltest.h:70
#define IOCTL_START_TEST
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
#define MDL_PAGES_LOCKED
Definition: mmtypes.h:19
#define STATUS_PENDING
Definition: ntstatus.h:82
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:193
static BOOLEAN TestUnpin
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
static BOOLEAN TestDirtying
static PDEVICE_OBJECT TestDeviceObject
SECTION_OBJECT_POINTERS SectionObjectPointers
#define _Inout_
Definition: no_sal2.h:244
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
* PFILE_OBJECT
Definition: iotypes.h:1955
BOOLEAN NTAPI CcPinRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG Flags, OUT PVOID *Bcb, OUT PVOID *Buffer)
Definition: pinsup.c:802
VOID NTAPI IoFreeMdl(PMDL Mdl)
Definition: iomdl.c:146
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
BOOLEAN NTAPI CcCopyRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, OUT PVOID Buffer, OUT PIO_STATUS_BLOCK IoStatus)
Definition: copysup.c:43
static const WCHAR L[]
Definition: oid.c:1250
FSRTL_ADVANCED_FCB_HEADER Header
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define KmtStartSeh()
Definition: kmt_test.h:277
Status
Definition: gdiplustypes.h:24
PMDL NTAPI IoAllocateMdl(IN PVOID VirtualAddress, IN ULONG Length, IN BOOLEAN SecondaryBuffer, IN BOOLEAN ChargeQuota, IN PIRP Irp)
Definition: iomdl.c:22
#define _In_
Definition: no_sal2.h:204
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
ULONG_PTR SIZE_T
Definition: typedefs.h:78
_SEH2_END
Definition: create.c:4424
struct _TEST_FCB TEST_FCB
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
VOID NTAPI MmProbeAndLockPages(IN PMDL Mdl, IN KPROCESSOR_MODE AccessMode, IN LOCK_OPERATION Operation)
Definition: mdlsup.c:935
static PVOID MapAndLockUserBuffer(_In_ _Out_ PIRP Irp, _In_ ULONG BufferLength)
BOOLEAN NTAPI CcUninitializeCacheMap(IN PFILE_OBJECT FileObject, IN OPTIONAL PLARGE_INTEGER TruncateSize, IN OPTIONAL PCACHE_UNINITIALIZE_EVENT UninitializeEvent)
Definition: fssup.c:284
VOID NTAPI CcSetFileSizes(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes)
Definition: fssup.c:354
#define ok(value,...)
Definition: atltest.h:57
static KMT_IRP_HANDLER TestIrpHandler
unsigned int * PULONG
Definition: retypes.h:1
#define min(a, b)
Definition: monoChain.cc:55
#define IOCTL_FINISH_TEST
#define IRP_PAGING_IO
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN IN BOOLEAN Zero
Definition: fatprocs.h:402
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define skip(...)
Definition: atltest.h:64
FAST_MUTEX HeaderMutex
static VOID PerformTest(ULONG TestId, PDEVICE_OBJECT DeviceObject)
#define VACB_MAPPING_GRANULARITY
NTSTATUS TestEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ PCUNICODE_STRING RegistryPath, _Out_ PCWSTR *DeviceName, _Inout_ INT *Flags)
static BOOLEAN TestSizing
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:566
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ULONG_PTR
Definition: config.h:101
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
BOOLEAN NTAPI AcquireForReadAhead(_In_ PVOID Context, _In_ BOOLEAN Wait)
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
static CACHE_MANAGER_CALLBACKS Callbacks
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
_In_ PFCB Fcb
Definition: cdprocs.h:151
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:2938
IoMarkIrpPending(Irp)
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:593
static BOOLEAN TestWritten
#define APC_LEVEL
Definition: env_spec_w32.h:695
SECTION_OBJECT_POINTERS SectionObjectPointers
Definition: ntfs.h:514
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
static VOID CleanupTest(ULONG TestId, PDEVICE_OBJECT DeviceObject)
LONGLONG QuadPart
Definition: typedefs.h:112
LARGE_INTEGER NTAPI CcGetFlushedValidData(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN BOOLEAN CcInternalCaller)
Definition: cachesub.c:130
VOID NTAPI ReleaseFromLazyWrite(_In_ PVOID Context)
struct _TEST_FCB * PTEST_FCB
IN BOOLEAN Wait
Definition: fatprocs.h:1529