ReactOS  0.4.15-dev-2095-g7caf9e9
CcCopyRead_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 CcCopyRead 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 typedef struct _TEST_FCB
14 {
20 
23 static KMT_IRP_HANDLER TestIrpHandler;
26 
30 
31 static
32 BOOLEAN
33 NTAPI
43 {
45  return FALSE;
46 }
47 
53  _Inout_ INT *Flags)
54 {
56 
57  PAGED_CODE();
58 
60 
61  *DeviceName = L"CcCopyRead";
62  *Flags = TESTENTRY_NO_EXCLUSIVE_DEVICE |
63  TESTENTRY_BUFFERED_IO_DEVICE |
64  TESTENTRY_NO_READONLY_DEVICE;
65 
69 
71  DriverObject->FastIoDispatch = &TestFastIoDispatch;
72 
73 
74  return Status;
75 }
76 
77 VOID
80 {
81  PAGED_CODE();
82 }
83 
84 BOOLEAN
85 NTAPI
89 {
90  return TRUE;
91 }
92 
93 VOID
94 NTAPI
97 {
98  return;
99 }
100 
101 BOOLEAN
102 NTAPI
105  _In_ BOOLEAN Wait)
106 {
107  return TRUE;
108 }
109 
110 VOID
111 NTAPI
114 {
115  return;
116 }
117 
123 };
124 
125 static
126 PVOID
128  _In_ _Out_ PIRP Irp,
130 {
131  PMDL Mdl;
132 
133  if (Irp->MdlAddress == NULL)
134  {
135  Mdl = IoAllocateMdl(Irp->UserBuffer, BufferLength, FALSE, FALSE, Irp);
136  if (Mdl == NULL)
137  {
138  return NULL;
139  }
140 
141  _SEH2_TRY
142  {
143  MmProbeAndLockPages(Mdl, Irp->RequestorMode, IoWriteAccess);
144  }
146  {
147  IoFreeMdl(Mdl);
148  Irp->MdlAddress = NULL;
149  _SEH2_YIELD(return NULL);
150  }
151  _SEH2_END;
152  }
153 
155 }
156 
157 static
158 void
160 {
162  ReadOffset.QuadPart = MAXLONGLONG;
164 }
165 
166 #define ok_read_called(_Offset, _Length) do { \
167  ok(ReadCalledNonCached, "CcCopyRead should have triggerred a non-cached read.\n"); \
168  ok_eq_longlong(ReadOffset.QuadPart, _Offset); \
169  ok_eq_ulong(ReadLength, _Length); \
170 }while(0)
171 
172 #define ok_read_not_called() ok(!ReadCalledNonCached, "CcCopyRead shouldn't have triggered a read.\n")
173 
174 static
175 VOID
177 {
178 
179  BOOLEAN Ret;
181  CHAR Buffer[10];
183 
184  memset(Buffer, 0xAC, 10);
185 
186  /* Test bogus file object & file offset */
187  Ret = 'x';
188  KmtStartSeh()
189  Ret = CcCopyRead(FileObject, NULL, 0, FALSE, NULL, &IoStatus);
191  ok_eq_char(Ret, 'x');
192 
193  Ret = 'x';
194  Offset.QuadPart = 0;
195  KmtStartSeh()
196  Ret = CcCopyRead(NULL, &Offset, 10, FALSE, Buffer, &IoStatus);
198  ok_eq_char(Ret, 'x');
199 
200  /* What happens on invalid buffer */
201  Ret = 'x';
202  Offset.QuadPart = 0;
203  memset(&IoStatus, 0xAB, sizeof(IoStatus));
204  reset_read();
205  KmtStartSeh()
206  Ret = CcCopyRead(FileObject, &Offset, 0, TRUE, NULL, &IoStatus);
208  ok_bool_true(Ret, "CcCopyRead(0, NULL) should succeed\n");
209  /* When there is nothing to write, there is no reason to read */
212  ok_eq_ulongptr(IoStatus.Information, 0);
213 
214  Ret = 'x';
215  Offset.QuadPart = 0;
216  memset(&IoStatus, 0xAB, sizeof(IoStatus));
217  reset_read();
218  KmtStartSeh()
219  Ret = CcCopyRead(FileObject, &Offset, 10, TRUE, NULL, &IoStatus);
221  ok_eq_char(Ret, 'x');
222  /* This raises an exception, but it actually triggered a read */
224  ok_eq_hex(IoStatus.Status, 0xABABABAB);
225  ok_eq_ulongptr(IoStatus.Information, (ULONG_PTR)0xABABABABABABABAB);
226 
227  /* So this one succeeds, as the page is now resident */
228  Ret = 'x';
229  Offset.QuadPart = 0;
230  memset(&IoStatus, 0xAB, sizeof(IoStatus));
231  reset_read();
232  KmtStartSeh()
233  Ret = CcCopyRead(FileObject, &Offset, 10, FALSE, Buffer, &IoStatus);
235  ok_bool_true(Ret, "CcCopyRead should succeed\n");
236  /* But there was no read triggered, as the page is already resident. */
239  ok_eq_ulongptr(IoStatus.Information, 10);
240 
241  /* But this one doesn't */
242  Ret = 'x';
243  Offset.QuadPart = PAGE_SIZE;
244  memset(&IoStatus, 0xAB, sizeof(IoStatus));
245  reset_read();
246  KmtStartSeh()
247  Ret = CcCopyRead(FileObject, &Offset, 10, FALSE, Buffer, &IoStatus);
249  ok_bool_false(Ret, "CcCopyRead should fail\n");
250  /* But it triggered a read anyway. */
252  ok_eq_hex(IoStatus.Status, 0xABABABAB);
253  ok_eq_ulongptr(IoStatus.Information, (ULONG_PTR)0xABABABABABABABAB);
254 
255  /* Of course, waiting for it succeeds and triggers the read */
256  Ret = 'x';
257  Offset.QuadPart = PAGE_SIZE * 2;
258  memset(&IoStatus, 0xAB, sizeof(IoStatus));
259  reset_read();
260  KmtStartSeh()
261  Ret = CcCopyRead(FileObject, &Offset, 10, TRUE, Buffer, &IoStatus);
263  ok_bool_true(Ret, "CcCopyRead should succeed\n");
266  ok_eq_ulongptr(IoStatus.Information, 10);
267 
268  /* Try the same without a status block */
269  Ret = 'x';
270  Offset.QuadPart = PAGE_SIZE * 2;
271  KmtStartSeh()
272  Ret = CcCopyRead(FileObject, &Offset, 10, TRUE, Buffer, NULL);
274  ok_eq_char(Ret, 'x');
275 }
276 
277 
278 static
279 NTSTATUS
282  _In_ PIRP Irp,
283  _In_ PIO_STACK_LOCATION IoStack)
284 {
287  PTEST_FCB Fcb;
288  CACHE_UNINITIALIZE_EVENT CacheUninitEvent;
289 
290  PAGED_CODE();
291 
292  DPRINT("IRP %x/%x\n", IoStack->MajorFunction, IoStack->MinorFunction);
293  ASSERT(IoStack->MajorFunction == IRP_MJ_CLEANUP ||
294  IoStack->MajorFunction == IRP_MJ_CREATE ||
295  IoStack->MajorFunction == IRP_MJ_READ);
296 
298  Irp->IoStatus.Information = 0;
299 
300  if (IoStack->MajorFunction == IRP_MJ_CREATE)
301  {
302  ok_irql(PASSIVE_LEVEL);
303 
304  if (IoStack->FileObject->FileName.Length >= 2 * sizeof(WCHAR))
305  {
307  TestFileObject = IoStack->FileObject;
308  }
309  Fcb = ExAllocatePoolWithTag(NonPagedPool, sizeof(*Fcb), 'FwrI');
310  RtlZeroMemory(Fcb, sizeof(*Fcb));
311  ExInitializeFastMutex(&Fcb->HeaderMutex);
312  FsRtlSetupAdvancedHeader(&Fcb->Header, &Fcb->HeaderMutex);
313  Fcb->BigFile = FALSE;
314  if (IoStack->FileObject->FileName.Length >= 2 * sizeof(WCHAR) &&
315  IoStack->FileObject->FileName.Buffer[1] == 'B')
316  {
317  Fcb->Header.AllocationSize.QuadPart = 1000000;
318  Fcb->Header.FileSize.QuadPart = 1000000;
319  Fcb->Header.ValidDataLength.QuadPart = 1000000;
320  }
321  else if (IoStack->FileObject->FileName.Length >= 2 * sizeof(WCHAR) &&
322  IoStack->FileObject->FileName.Buffer[1] == 'S')
323  {
324  Fcb->Header.AllocationSize.QuadPart = 1004;
325  Fcb->Header.FileSize.QuadPart = 1004;
326  Fcb->Header.ValidDataLength.QuadPart = 1004;
327  }
328  else if (IoStack->FileObject->FileName.Length >= 2 * sizeof(WCHAR) &&
329  IoStack->FileObject->FileName.Buffer[1] == 'R')
330  {
331  Fcb->Header.AllocationSize.QuadPart = 62;
332  Fcb->Header.FileSize.QuadPart = 62;
333  Fcb->Header.ValidDataLength.QuadPart = 62;
334  }
335  else if (IoStack->FileObject->FileName.Length >= 2 * sizeof(WCHAR) &&
336  IoStack->FileObject->FileName.Buffer[1] == 'F')
337  {
338  Fcb->Header.AllocationSize.QuadPart = 4294967296;
339  Fcb->Header.FileSize.QuadPart = 4294967296;
340  Fcb->Header.ValidDataLength.QuadPart = 4294967296;
341  Fcb->BigFile = TRUE;
342  }
343  else
344  {
345  Fcb->Header.AllocationSize.QuadPart = 512;
346  Fcb->Header.FileSize.QuadPart = 512;
347  Fcb->Header.ValidDataLength.QuadPart = 512;
348  }
349  Fcb->Header.IsFastIoPossible = FastIoIsNotPossible;
350  IoStack->FileObject->FsContext = Fcb;
351  IoStack->FileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
352 
353  CcInitializeCacheMap(IoStack->FileObject,
354  (PCC_FILE_SIZES)&Fcb->Header.AllocationSize,
355  FALSE, &Callbacks, NULL);
356 
357  Irp->IoStatus.Information = FILE_OPENED;
359  }
360  else if (IoStack->MajorFunction == IRP_MJ_READ)
361  {
362  BOOLEAN Ret;
363  ULONG Length;
364  PVOID Buffer;
366  static const UNICODE_STRING BehaviourTestFileName = RTL_CONSTANT_STRING(L"\\BehaviourTestFile");
367 
368  Offset = IoStack->Parameters.Read.ByteOffset;
369  Length = IoStack->Parameters.Read.Length;
370  Fcb = IoStack->FileObject->FsContext;
371 
373  ok_eq_pointer(IoStack->FileObject, TestFileObject);
374 
375  /* Check special file name */
376  InBehaviourTest = RtlCompareUnicodeString(&IoStack->FileObject->FileName, &BehaviourTestFileName, TRUE) == 0;
377 
378  if (!FlagOn(Irp->Flags, IRP_NOCACHE))
379  {
380  ok_irql(PASSIVE_LEVEL);
381 
382  if (InBehaviourTest)
383  {
384  Test_CcCopyRead(IoStack->FileObject);
385  Status = Irp->IoStatus.Status = STATUS_SUCCESS;
386  }
387  else
388  {
389  /* We don't want to test alignement for big files (not the purpose of the test) */
390  if (!Fcb->BigFile)
391  {
392  ok(Offset.QuadPart % PAGE_SIZE != 0, "Offset is aligned: %I64i\n", Offset.QuadPart);
393  ok(Length % PAGE_SIZE != 0, "Length is aligned: %I64i\n", Length);
394  }
395 
396  Buffer = Irp->AssociatedIrp.SystemBuffer;
397  ok(Buffer != NULL, "Null pointer!\n");
398 
399  _SEH2_TRY
400  {
401  Ret = CcCopyRead(IoStack->FileObject, &Offset, Length, TRUE, Buffer,
402  &Irp->IoStatus);
403  ok_bool_true(Ret, "CcCopyRead");
404  }
406  {
407  Irp->IoStatus.Status = _SEH2_GetExceptionCode();
408  }
409  _SEH2_END;
410 
411  Status = Irp->IoStatus.Status;
412 
413  if (NT_SUCCESS(Status))
414  {
415  if (Offset.QuadPart <= 1000LL && Offset.QuadPart + Length > 1000LL)
416  {
417  ok_eq_hex(*(PUSHORT)((ULONG_PTR)Buffer + (ULONG_PTR)(1000LL - Offset.QuadPart)), 0xFFFF);
418  }
419  else
420  {
421  ok_eq_hex(*(PUSHORT)Buffer, 0xBABA);
422  }
423  }
424  }
425  }
426  else
427  {
428  PMDL Mdl;
429 
431  ReadOffset = Offset;
432  ReadLength = Length;
433 
434  ok_irql(APC_LEVEL);
435  ok((Offset.QuadPart % PAGE_SIZE == 0 || Offset.QuadPart == 0), "Offset is not aligned: %I64i\n", Offset.QuadPart);
436  ok(Length % PAGE_SIZE == 0, "Length is not aligned: %I64i\n", Length);
437 
438  ok(Irp->AssociatedIrp.SystemBuffer == NULL, "A SystemBuffer was allocated!\n");
440  ok(Buffer != NULL, "Null pointer!\n");
441  RtlFillMemory(Buffer, Length, 0xBA);
442 
444  if (Offset.QuadPart <= 1000LL && Offset.QuadPart + Length > 1000LL)
445  {
446  *(PUSHORT)((ULONG_PTR)Buffer + (ULONG_PTR)(1000LL - Offset.QuadPart)) = 0xFFFF;
447  }
448 
449  Mdl = Irp->MdlAddress;
450  ok(Mdl != NULL, "Null pointer for MDL!\n");
451  ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) != 0, "MDL not locked\n");
452  ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) == 0, "MDL from non paged\n");
453  ok((Mdl->MdlFlags & MDL_IO_PAGE_READ) != 0, "Non paging IO\n");
454  ok((Irp->Flags & IRP_PAGING_IO) != 0, "Non paging IO\n");
455  }
456 
457  if (NT_SUCCESS(Status))
458  {
459  Irp->IoStatus.Information = Length;
460  IoStack->FileObject->CurrentByteOffset.QuadPart = Offset.QuadPart + Length;
461  }
462 
464  }
465  else if (IoStack->MajorFunction == IRP_MJ_CLEANUP)
466  {
467  ok_irql(PASSIVE_LEVEL);
468  KeInitializeEvent(&CacheUninitEvent.Event, NotificationEvent, FALSE);
469  CcUninitializeCacheMap(IoStack->FileObject, &Zero, &CacheUninitEvent);
470  KeWaitForSingleObject(&CacheUninitEvent.Event, Executive, KernelMode, FALSE, NULL);
471  Fcb = IoStack->FileObject->FsContext;
472  ExFreePoolWithTag(Fcb, 'FwrI');
473  IoStack->FileObject->FsContext = NULL;
475  }
476 
477  if (Status == STATUS_PENDING)
478  {
482  }
483  else
484  {
485  Irp->IoStatus.Status = Status;
487  }
488 
489  return Status;
490 }
#define MDL_IO_PAGE_READ
Definition: mmtypes.h:24
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
static PVOID MapAndLockUserBuffer(_In_ _Out_ PIRP Irp, _In_ ULONG BufferLength)
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define LL
Definition: tui.h:84
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
VOID NTAPI ReleaseFromLazyWrite(_In_ PVOID Context)
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:925
PFILE_OBJECT FileObject
Definition: ntfs.h:516
static BOOLEAN InBehaviourTest
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:167
#define ok_eq_pointer(value, expected)
char CHAR
Definition: xmlstorage.h:175
LONG NTSTATUS
Definition: precomp.h:26
#define ok_read_called(_Offset, _Length)
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
#define KmtEndSeh(ExpectedStatus)
Definition: kmt_test.h:283
#define FILE_OPENED
Definition: nt_native.h:769
#define ok_eq_ulongptr(value, expected)
Definition: kmt_test.h:249
BOOLEAN NTAPI AcquireForReadAhead(_In_ PVOID Context, _In_ BOOLEAN Wait)
#define IRP_NOCACHE
static CACHE_MANAGER_CALLBACKS Callbacks
#define ok_eq_char(value, expected)
Definition: kmt_test.h:244
static PFILE_OBJECT TestFileObject
BOOLEAN ReadCalledNonCached
#define MAXLONGLONG
BOOLEAN BigFile
#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
_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
#define ok_read_not_called()
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#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
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
_Must_inspect_result_ _In_ WDFUSBPIPE _In_ WDFREQUEST _In_opt_ WDFMEMORY _In_opt_ PWDFMEMORY_OFFSET ReadOffset
Definition: wdfusb.h:1996
#define STATUS_INVALID_USER_BUFFER
Definition: udferr_usr.h:166
VOID NTAPI ReleaseFromReadAhead(_In_ PVOID Context)
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
unsigned char BOOLEAN
#define _Out_
Definition: no_sal2.h:160
#define MDL_SOURCE_IS_NONPAGED_POOL
Definition: mmtypes.h:20
#define IoCompleteRequest
Definition: irp.c:1240
ULONG ReadLength
Definition: bufpool.h:45
static BOOLEAN NTAPI FastIoRead(_In_ PFILE_OBJECT FileObject, _In_ PLARGE_INTEGER FileOffset, _In_ ULONG Length, _In_ BOOLEAN Wait, _In_ ULONG LockKey, _Out_ PVOID Buffer, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
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
Status
Definition: gdiplustypes.h:24
FAST_MUTEX
Definition: extypes.h:17
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2662
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
static void reset_read(void)
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
#define ASSERT(a)
Definition: mode.c:45
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MDL_PAGES_LOCKED
Definition: mmtypes.h:19
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#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
static PDEVICE_OBJECT TestDeviceObject
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
SECTION_OBJECT_POINTERS SectionObjectPointers
struct _TEST_FCB * PTEST_FCB
#define _Inout_
Definition: no_sal2.h:162
* PFILE_OBJECT
Definition: iotypes.h:1995
VOID NTAPI IoFreeMdl(PMDL Mdl)
Definition: iomdl.c:146
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
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
VOID TestUnload(_In_ PDRIVER_OBJECT DriverObject)
static const WCHAR L[]
Definition: oid.c:1250
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
Definition: string_lib.cpp:31
FSRTL_ADVANCED_FCB_HEADER Header
#define PAGE_SIZE
Definition: env_spec_w32.h:49
BOOLEAN NTAPI AcquireForLazyWrite(_In_ PVOID Context, _In_ BOOLEAN Wait)
#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
#define MAXULONG
Definition: typedefs.h:251
struct _TEST_FCB TEST_FCB
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define _In_
Definition: no_sal2.h:158
static FAST_IO_DISPATCH TestFastIoDispatch
PFAST_IO_READ FastIoRead
Definition: iotypes.h:1732
_SEH2_END
Definition: create.c:4400
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
static VOID Test_CcCopyRead(PFILE_OBJECT FileObject)
VOID NTAPI MmProbeAndLockPages(IN PMDL Mdl, IN KPROCESSOR_MODE AccessMode, IN LOCK_OPERATION Operation)
Definition: mdlsup.c:935
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
BOOLEAN NTAPI CcUninitializeCacheMap(IN PFILE_OBJECT FileObject, IN OPTIONAL PLARGE_INTEGER TruncateSize, IN OPTIONAL PCACHE_UNINITIALIZE_EVENT UninitializeEvent)
Definition: fssup.c:286
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:159
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
#define IRP_PAGING_IO
static KMT_IRP_HANDLER TestIrpHandler
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
FAST_MUTEX HeaderMutex
#define IRP_MJ_CLEANUP
__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
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define ok_eq_hex(value, expected)
#define STATUS_SUCCESS
Definition: shellext.h:65
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
LARGE_INTEGER ReadOffset
#define DPRINT
Definition: sndvol32.h:71
_In_ PFCB Fcb
Definition: cdprocs.h:159
IoMarkIrpPending(Irp)
#define memset(x, y, z)
Definition: compat.h:39
#define APC_LEVEL
Definition: env_spec_w32.h:695
SECTION_OBJECT_POINTERS SectionObjectPointers
Definition: ntfs.h:514
unsigned short * PUSHORT
Definition: retypes.h:2
NTSTATUS TestEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ PCUNICODE_STRING RegistryPath, _Out_ PCWSTR *DeviceName, _Inout_ INT *Flags)
#define PAGED_CODE()
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14