ReactOS  0.4.15-dev-3165-gdf6fff7
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  else if (TestId == 6)
319  {
320  Offset.QuadPart = 0;
321  KmtStartSeh();
324 
325  if (!skip(Ret == TRUE, "CcMapData failed\n"))
326  {
327  ok_eq_ulong(Buffer[(VACB_MAPPING_GRANULARITY - PAGE_SIZE - sizeof(ULONG)) / sizeof(ULONG)], 0xBABABABA);
328  }
329 
330  KmtStartSeh();
333 
334  if (Ret == TRUE)
335  CcUnpinData(Bcb);
336  }
337  }
338  }
339  }
340 }
341 
342 
343 static
344 VOID
346  ULONG TestId,
348 {
350  CACHE_UNINITIALIZE_EVENT CacheUninitEvent;
351 
353  ok_eq_ulong(TestTestId, TestId);
354 
355  if (!skip(TestFileObject != NULL, "No test FO\n"))
356  {
358  {
360  KeInitializeEvent(&CacheUninitEvent.Event, NotificationEvent, FALSE);
361  CcUninitializeCacheMap(TestFileObject, &Zero, &CacheUninitEvent);
362  KeWaitForSingleObject(&CacheUninitEvent.Event, Executive, KernelMode, FALSE, NULL);
364  }
365 
366  if (TestFileObject->FsContext != NULL)
367  {
368  ExFreePool(TestFileObject->FsContext);
369  TestFileObject->FsContext = NULL;
370  TestFileObject->SectionObjectPointer = NULL;
371  }
372 
374  }
375 
378  TestTestId = -1;
379 }
380 
381 
382 static
383 NTSTATUS
388  _In_ SIZE_T InLength,
389  _Inout_ PSIZE_T OutLength)
390 {
392 
394 
395  switch (ControlCode)
396  {
397  case IOCTL_START_TEST:
398  ok_eq_ulong((ULONG)InLength, sizeof(ULONG));
400  break;
401 
402  case IOCTL_FINISH_TEST:
403  ok_eq_ulong((ULONG)InLength, sizeof(ULONG));
405  break;
406 
407  default:
409  break;
410  }
411 
413 
414  return Status;
415 }
416 
417 static
418 NTSTATUS
421  _In_ PIRP Irp,
422  _In_ PIO_STACK_LOCATION IoStack)
423 {
425 
426  PAGED_CODE();
427 
428  DPRINT("IRP %x/%x\n", IoStack->MajorFunction, IoStack->MinorFunction);
429  ASSERT(IoStack->MajorFunction == IRP_MJ_READ ||
430  IoStack->MajorFunction == IRP_MJ_WRITE);
431 
433 
435  Irp->IoStatus.Information = 0;
436 
437  if (IoStack->MajorFunction == IRP_MJ_READ)
438  {
439  PMDL Mdl;
440  ULONG Length;
441  PTEST_FCB Fcb;
443  PVOID Buffer, OrigBuffer;
444 
445  Offset = IoStack->Parameters.Read.ByteOffset;
446  Length = IoStack->Parameters.Read.Length;
447  Fcb = IoStack->FileObject->FsContext;
448 
450  ok_eq_pointer(IoStack->FileObject, TestFileObject);
451  ok(Fcb != NULL, "Null FCB\n");
452 
453  ok(FlagOn(Irp->Flags, IRP_NOCACHE), "Not coming from Cc\n");
454 
455  ok_irql(APC_LEVEL);
456  ok((Offset.QuadPart % PAGE_SIZE == 0 || Offset.QuadPart == 0), "Offset is not aligned: %I64i\n", Offset.QuadPart);
457  ok(Length % PAGE_SIZE == 0, "Length is not aligned: %I64i\n", Length);
458 
459  ok(Irp->AssociatedIrp.SystemBuffer == NULL, "A SystemBuffer was allocated!\n");
460  OrigBuffer = Buffer = MapAndLockUserBuffer(Irp, Length);
461  ok(Buffer != NULL, "Null pointer!\n");
462 
463  if (Offset.QuadPart < Fcb->Header.FileSize.QuadPart)
464  {
465  RtlFillMemory(Buffer, min(Length, Fcb->Header.FileSize.QuadPart - Offset.QuadPart), 0xBA);
466  Buffer = (PVOID)((ULONG_PTR)Buffer + (ULONG_PTR)min(Length, Fcb->Header.FileSize.QuadPart - Offset.QuadPart));
467 
468  if (Length > (Fcb->Header.FileSize.QuadPart - Offset.QuadPart))
469  {
470  RtlFillMemory(Buffer, Length - (Fcb->Header.FileSize.QuadPart - Offset.QuadPart), 0xBD);
471  }
472  }
473  else
474  {
475  RtlFillMemory(Buffer, Length, 0xBD);
476  }
477 
478  if ((TestTestId == 4 || TestTestId == 5) && TestWritten &&
479  Offset.QuadPart <= VACB_MAPPING_GRANULARITY - PAGE_SIZE - sizeof(ULONG) &&
481  {
482  Buffer = (PVOID)((ULONG_PTR)OrigBuffer + (VACB_MAPPING_GRANULARITY - PAGE_SIZE - sizeof(ULONG)));
483  RtlFillMemory(Buffer, sizeof(ULONG), 0xDA);
484  }
485 
487 
488  Mdl = Irp->MdlAddress;
489  ok(Mdl != NULL, "Null pointer for MDL!\n");
490  ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) != 0, "MDL not locked\n");
491  ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) == 0, "MDL from non paged\n");
492  ok((Mdl->MdlFlags & MDL_IO_PAGE_READ) != 0, "Non paging IO\n");
493  ok((Irp->Flags & IRP_PAGING_IO) != 0, "Non paging IO\n");
494 
495  Irp->IoStatus.Information = Length;
496  }
497  else if (IoStack->MajorFunction == IRP_MJ_WRITE)
498  {
499  PMDL Mdl;
500  ULONG Length;
501  PVOID Buffer;
503 
504  Offset = IoStack->Parameters.Write.ByteOffset;
505  Length = IoStack->Parameters.Write.Length;
506 
507  ok((TestTestId == 4 || TestTestId == 5), "Unexpected test id: %d\n", TestTestId);
509  ok_eq_pointer(IoStack->FileObject, TestFileObject);
510 
511  ok_bool_false(TestUnpin, "Write triggered while unpinning!\n");
512  ok_bool_false(TestSizing, "Write triggered while sizing!\n");
513  ok_bool_false(TestDirtying, "Write triggered while dirtying!\n");
514  ok_bool_true(TestUncaching, "Write not triggered while uncaching!\n");
515 
516  ok(FlagOn(Irp->Flags, IRP_NOCACHE), "Not coming from Cc\n");
517 
518  ok_irql(PASSIVE_LEVEL);
519  ok((Offset.QuadPart % PAGE_SIZE == 0 || Offset.QuadPart == 0), "Offset is not aligned: %I64i\n", Offset.QuadPart);
520  ok(Length % PAGE_SIZE == 0, "Length is not aligned: %I64i\n", Length);
521 
523  ok(Buffer != NULL, "Null pointer!\n");
524 
525  Mdl = Irp->MdlAddress;
526  ok(Mdl != NULL, "Null pointer for MDL!\n");
527  ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) != 0, "MDL not locked\n");
528  ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) == 0, "MDL from non paged\n");
529  ok((Irp->Flags & IRP_PAGING_IO) != 0, "Non paging IO\n");
530 
531  TestWritten = TRUE;
533  Irp->IoStatus.Information = Length;
534  }
535 
536  if (Status == STATUS_PENDING)
537  {
541  }
542  else
543  {
544  Irp->IoStatus.Status = Status;
546  }
547 
549 
550  return Status;
551 }
#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:57
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3767
return STATUS_NOT_SUPPORTED
#define LL
Definition: tui.h:84
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define FsRtlEnterFileSystem
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:411
#define _In_opt_
Definition: ms_sal.h:309
#define _Inout_
Definition: ms_sal.h:378
#define FsRtlExitFileSystem
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:925
static ULONG TestTestId
PFILE_OBJECT FileObject
Definition: ntfs.h:520
#define _Out_
Definition: ms_sal.h:345
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
VOID NTAPI CcSetDirtyPinnedData(IN PVOID BcbVoid, IN OPTIONAL PLARGE_INTEGER Lsn)
Definition: cachesub.c:121
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:167
#define ok_eq_pointer(value, expected)
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
#define KmtEndSeh(ExpectedStatus)
Definition: kmt_test.h:283
VOID NTAPI CcUnpinData(IN PVOID Bcb)
Definition: pinsup.c:955
#define IRP_NOCACHE
#define MAP_WAIT
static BOOLEAN TestUncaching
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:58
static CC_FILE_SIZES NewFileSizes
_SEH2_TRY
Definition: create.c:4226
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define ok_bool_false(value, desc)
Definition: kmt_test.h:257
#define ok_bool_true(value, desc)
Definition: kmt_test.h:256
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
return STATUS_NOT_IMPLEMENTED
VOID TestUnload(_In_ PDRIVER_OBJECT DriverObject)
#define RTL_CONSTANT_LARGE_INTEGER(quad_part)
Definition: rtltypes.h:416
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3272
ULONG_PTR * PSIZE_T
Definition: typedefs.h:80
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
#define CcIsFileCached(FO)
VOID NTAPI ReleaseFromReadAhead(_In_ PVOID Context)
unsigned char BOOLEAN
VOID NTAPI CcSetAdditionalCacheAttributes(IN PFILE_OBJECT FileObject, IN BOOLEAN DisableReadAhead, IN BOOLEAN DisableWriteBehind)
Definition: logsup.c:22
#define _In_
Definition: ms_sal.h:308
#define MDL_SOURCE_IS_NONPAGED_POOL
Definition: mmtypes.h:20
#define IoCompleteRequest
Definition: irp.c:1240
_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)
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
static PFILE_OBJECT TestFileObject
Status
Definition: gdiplustypes.h:24
FAST_MUTEX
Definition: extypes.h:17
int64_t LONGLONG
Definition: typedefs.h:68
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
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
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 ASSERT(a)
Definition: mode.c:44
#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:195
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:593
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
static BOOLEAN TestUnpin
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
static BOOLEAN TestDirtying
#define ObDereferenceObject
Definition: obfuncs.h:203
static PDEVICE_OBJECT TestDeviceObject
SECTION_OBJECT_POINTERS SectionObjectPointers
* PFILE_OBJECT
Definition: iotypes.h:1998
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
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
PMDL NTAPI IoAllocateMdl(IN PVOID VirtualAddress, IN ULONG Length, IN BOOLEAN SecondaryBuffer, IN BOOLEAN ChargeQuota, IN PIRP Irp)
Definition: iomdl.c:22
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
ULONG_PTR SIZE_T
Definition: typedefs.h:80
_SEH2_END
Definition: create.c:4400
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:922
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:286
VOID NTAPI CcSetFileSizes(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes)
Definition: fssup.c:356
#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 NULL
Definition: types.h:112
#define IOCTL_FINISH_TEST
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
#define IRP_PAGING_IO
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN IN BOOLEAN Zero
Definition: fatprocs.h:411
#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
__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 IO_NO_INCREMENT
Definition: iotypes.h:598
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define ULONG_PTR
Definition: config.h:101
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:40
#define STATUS_SUCCESS
Definition: shellext.h:65
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:168
#define DPRINT
Definition: sndvol32.h:71
_In_ PFCB Fcb
Definition: cdprocs.h:159
IoMarkIrpPending(Irp)
static BOOLEAN TestWritten
#define APC_LEVEL
Definition: env_spec_w32.h:695
SECTION_OBJECT_POINTERS SectionObjectPointers
Definition: ntfs.h:518
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
static VOID CleanupTest(ULONG TestId, PDEVICE_OBJECT DeviceObject)
LONGLONG QuadPart
Definition: typedefs.h:114
LARGE_INTEGER NTAPI CcGetFlushedValidData(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN BOOLEAN CcInternalCaller)
Definition: cachesub.c:130
VOID NTAPI ReleaseFromLazyWrite(_In_ PVOID Context)
#define PAGED_CODE()
struct _TEST_FCB * PTEST_FCB