ReactOS  0.4.13-dev-259-g5ca9c9c
CcPinMappedData_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 CcPinMappedData 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 typedef struct _TEST_CONTEXT
24 {
25  PVOID Bcb;
27  ULONG Length;
29 
30 static ULONG TestTestId = -1;
33 static KMT_IRP_HANDLER TestIrpHandler;
34 static KMT_MESSAGE_HANDLER TestMessageHandler;
35 
41  _Inout_ INT *Flags)
42 {
44 
45  PAGED_CODE();
46 
48 
49  *DeviceName = L"CcPinMappedData";
50  *Flags = TESTENTRY_NO_EXCLUSIVE_DEVICE |
51  TESTENTRY_BUFFERED_IO_DEVICE |
52  TESTENTRY_NO_READONLY_DEVICE;
53 
56 
57 
58  return Status;
59 }
60 
61 VOID
64 {
65  PAGED_CODE();
66 }
67 
68 BOOLEAN
69 NTAPI
73 {
74  return TRUE;
75 }
76 
77 VOID
78 NTAPI
81 {
82  return;
83 }
84 
85 BOOLEAN
86 NTAPI
90 {
91  return TRUE;
92 }
93 
94 VOID
95 NTAPI
98 {
99  return;
100 }
101 
107 };
108 
110  RTL_CONSTANT_LARGE_INTEGER((LONGLONG)0x4000), // .AllocationSize
111  RTL_CONSTANT_LARGE_INTEGER((LONGLONG)0x4000), // .FileSize
112  RTL_CONSTANT_LARGE_INTEGER((LONGLONG)0x4000) // .ValidDataLength
113 };
114 
115 static
116 PVOID
118  _In_ _Out_ PIRP Irp,
120 {
121  PMDL Mdl;
122 
123  if (Irp->MdlAddress == NULL)
124  {
125  Mdl = IoAllocateMdl(Irp->UserBuffer, BufferLength, FALSE, FALSE, Irp);
126  if (Mdl == NULL)
127  {
128  return NULL;
129  }
130 
131  _SEH2_TRY
132  {
133  MmProbeAndLockPages(Mdl, Irp->RequestorMode, IoWriteAccess);
134  }
136  {
137  IoFreeMdl(Mdl);
138  Irp->MdlAddress = NULL;
139  _SEH2_YIELD(return NULL);
140  }
141  _SEH2_END;
142  }
143 
145 }
146 
147 static
148 VOID
149 NTAPI
151 {
152  BOOLEAN Ret;
153  PULONG Buffer;
154  PVOID Bcb, PinBcb;
156  PTEST_CONTEXT TestContext;
157 
158  ok(TestFileObject != NULL, "Called in invalid context!\n");
160 
161  TestContext = Context;
162  ok(TestContext != NULL, "Called in invalid context!\n");
163  ok(TestContext->Bcb != NULL, "Called in invalid context!\n");
164  ok(TestContext->Buffer != NULL, "Called in invalid context!\n");
165  ok(TestContext->Length != 0, "Called in invalid context!\n");
166 
167  Ret = FALSE;
168  Offset.QuadPart = 0;
169 
170  KmtStartSeh();
171  Ret = CcMapData(TestFileObject, &Offset, TestContext->Length, MAP_WAIT, &Bcb, (PVOID *)&Buffer);
173 
174  if (!skip(Ret == TRUE, "CcMapData failed\n"))
175  {
176  ok(Bcb != TestContext->Bcb, "Returned same BCB!\n");
177  ok_eq_pointer(Buffer, TestContext->Buffer);
178 
179  Ret = FALSE;
180  PinBcb = Bcb;
181 
182  KmtStartSeh();
183  Ret = CcPinMappedData(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, 0, &PinBcb);
185 
186  if (!skip(Ret == TRUE, "CcPinMappedData failed\n"))
187  {
188  ok(Bcb != PinBcb, "Returned same BCB!\n");
189  ok_eq_pointer(PinBcb, TestContext->Bcb);
190 
191  Bcb = PinBcb;
192  }
193 
194  CcUnpinData(Bcb);
195  }
196 }
197 
198 static
199 VOID
200 NTAPI
202 {
203  BOOLEAN Ret;
204  PULONG Buffer;
205  PVOID Bcb, PinBcb;
207  PTEST_CONTEXT TestContext;
208 
209  ok(TestFileObject != NULL, "Called in invalid context!\n");
211 
212  TestContext = Context;
213  ok(TestContext != NULL, "Called in invalid context!\n");
214  ok(TestContext->Bcb != NULL, "Called in invalid context!\n");
215  ok(TestContext->Buffer != NULL, "Called in invalid context!\n");
216  ok(TestContext->Length != 0, "Called in invalid context!\n");
217 
218  Ret = FALSE;
219  Offset.QuadPart = 0;
220 
221  KmtStartSeh();
222  Ret = CcMapData(TestFileObject, &Offset, TestContext->Length, MAP_WAIT, &Bcb, (PVOID *)&Buffer);
224 
225  if (!skip(Ret == TRUE, "CcMapData failed\n"))
226  {
227  ok(Bcb != TestContext->Bcb, "Returned same BCB!\n");
228  ok_eq_pointer(Buffer, TestContext->Buffer);
229 
230  Ret = FALSE;
231  PinBcb = Bcb;
232 
233  KmtStartSeh();
236 
237  if (!skip(Ret == FALSE, "CcPinMappedData succeed\n"))
238  {
239  ok_eq_pointer(PinBcb, Bcb);
240 
241  Ret = FALSE;
242  PinBcb = Bcb;
243 
244  KmtStartSeh();
245  Ret = CcPinMappedData(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, 0, &PinBcb);
247 
248  if (!skip(Ret == FALSE, "CcPinMappedData succeed\n"))
249  {
250  ok_eq_pointer(PinBcb, Bcb);
251  }
252  else
253  {
254  Bcb = PinBcb;
255  }
256  }
257  else
258  {
259  Bcb = PinBcb;
260  }
261 
262  CcUnpinData(Bcb);
263  }
264 }
265 
266 static
267 VOID
269  ULONG TestId,
271 {
272  PVOID Bcb, PinBcb, NewBcb;
273  BOOLEAN Ret;
274  PULONG Buffer;
275  PTEST_FCB Fcb;
277 
280  ok_eq_ulong(TestTestId, -1);
281 
283  TestTestId = TestId;
285  if (!skip(TestFileObject != NULL, "Failed to allocate FO\n"))
286  {
288  if (!skip(Fcb != NULL, "ExAllocatePool failed\n"))
289  {
290  RtlZeroMemory(Fcb, sizeof(TEST_FCB));
291  ExInitializeFastMutex(&Fcb->HeaderMutex);
292  FsRtlSetupAdvancedHeader(&Fcb->Header, &Fcb->HeaderMutex);
293 
294  TestFileObject->FsContext = Fcb;
295  TestFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
296 
297  KmtStartSeh();
300 
301  if (!skip(CcIsFileCached(TestFileObject) == TRUE, "CcInitializeCacheMap failed\n"))
302  {
303  if (TestId == 0)
304  {
305  Ret = FALSE;
306  Offset.QuadPart = 0;
307  KmtStartSeh();
310 
311  if (!skip(Ret == TRUE, "CcMapData failed\n"))
312  {
313  Ret = FALSE;
314  PinBcb = Bcb;
315  ok_eq_ulong(Buffer[0x3000 / sizeof(ULONG)], 0xDEADBABE);
316 
317  KmtStartSeh();
320 
321  if (!skip(Ret == TRUE, "CcPinMappedData failed\n"))
322  {
323  ok(Bcb != PinBcb, "Returned same BCB!\n");
324  ok(*(PUSHORT)PinBcb == 0x2FD, "Not a BCB: %x\n", *(PUSHORT)PinBcb);
325 
326  /* Previous BCB isn't valid anymore! */
327  Bcb = PinBcb;
328  }
329 
330  CcUnpinData(Bcb);
331  }
332  }
333  else if (TestId == 1)
334  {
335  Ret = FALSE;
336  Offset.QuadPart = 0;
337  KmtStartSeh();
338  Ret = CcPinRead(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, PIN_WAIT, &PinBcb, (PVOID *)&Buffer);
340 
341  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
342  {
343  ok(*(PUSHORT)PinBcb == 0x2FD, "Not a BCB: %x\n", *(PUSHORT)PinBcb);
344  ok_eq_ulong(Buffer[0x3000 / sizeof(ULONG)], 0xDEADBABE);
345 
346  Ret = FALSE;
347  KmtStartSeh();
350 
351  if (!skip(Ret == TRUE, "CcMapData failed\n"))
352  {
353  ok(Bcb != PinBcb, "Returned same BCB!\n");
354 
355  Ret = FALSE;
356  NewBcb = Bcb;
357  KmtStartSeh();
360 
361  if (!skip(Ret == TRUE, "CcPinMappedData failed\n"))
362  {
363  ok(Bcb != NewBcb, "Returned same BCB!\n");
364  ok_eq_pointer(NewBcb, PinBcb);
365  ok(*(PUSHORT)NewBcb == 0x2FD, "Not a BCB: %x\n", *(PUSHORT)NewBcb);
366 
367  /* Previous BCB isn't valid anymore! */
368  Bcb = NewBcb;
369  }
370 
371  CcUnpinData(Bcb);
372  }
373 
374  CcUnpinData(PinBcb);
375  }
376  }
377  else if (TestId == 2)
378  {
379  PTEST_CONTEXT TestContext;
380 
381  TestContext = ExAllocatePool(NonPagedPool, sizeof(TEST_CONTEXT));
382  if (!skip(TestContext != NULL, "ExAllocatePool failed\n"))
383  {
384  Ret = FALSE;
385  Offset.QuadPart = 0;
386  KmtStartSeh();
387  Ret = CcPinRead(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, PIN_WAIT | PIN_EXCLUSIVE, &TestContext->Bcb, (PVOID *)&TestContext->Buffer);
389 
390  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
391  {
392  PKTHREAD ThreadHandle;
393 
394  ok(*(PUSHORT)TestContext->Bcb == 0x2FD, "Not a BCB: %x\n", *(PUSHORT)TestContext->Bcb);
395  ok_eq_ulong(TestContext->Buffer[0x3000 / sizeof(ULONG)], 0xDEADBABE);
396 
397  TestContext->Length = FileSizes.FileSize.QuadPart - Offset.QuadPart;
398  ThreadHandle = KmtStartThread(PinInAnotherThreadExclusive, TestContext);
399  KmtFinishThread(ThreadHandle, NULL);
400 
401  CcUnpinData(TestContext->Bcb);
402  }
403 
404  ExFreePool(TestContext);
405  }
406  }
407  else if (TestId == 3)
408  {
409  Ret = FALSE;
410  Offset.QuadPart = 0;
411  KmtStartSeh();
414 
415  if (!skip(Ret == TRUE, "CcMapData failed\n"))
416  {
417  Ret = FALSE;
418  PinBcb = Bcb;
419  ok_eq_ulong(Buffer[0x3000 / sizeof(ULONG)], 0xDEADBABE);
420 
421  KmtStartSeh();
424 
425  if (!skip(Ret == FALSE, "CcPinMappedData succeed\n"))
426  {
427  ok_eq_pointer(Bcb, PinBcb);
428  }
429  else
430  {
431  Bcb = PinBcb;
432  }
433 
434  CcUnpinData(Bcb);
435  }
436  }
437  else if (TestId == 4)
438  {
439  PTEST_CONTEXT TestContext;
440 
441  TestContext = ExAllocatePool(NonPagedPool, sizeof(TEST_CONTEXT));
442  if (!skip(TestContext != NULL, "ExAllocatePool failed\n"))
443  {
444  Ret = FALSE;
445  Offset.QuadPart = 0;
446  KmtStartSeh();
447  Ret = CcPinRead(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, PIN_WAIT, &TestContext->Bcb, (PVOID *)&TestContext->Buffer);
449 
450  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
451  {
452  PKTHREAD ThreadHandle;
453 
454  ok(*(PUSHORT)TestContext->Bcb == 0x2FD, "Not a BCB: %x\n", *(PUSHORT)TestContext->Bcb);
455  ok_eq_ulong(TestContext->Buffer[0x3000 / sizeof(ULONG)], 0xDEADBABE);
456 
457  TestContext->Length = FileSizes.FileSize.QuadPart - Offset.QuadPart;
458  ThreadHandle = KmtStartThread(PinInAnotherThread, TestContext);
459  KmtFinishThread(ThreadHandle, NULL);
460 
461  CcUnpinData(TestContext->Bcb);
462  }
463 
464  ExFreePool(TestContext);
465  }
466  }
467  }
468  }
469  }
470 }
471 
472 
473 static
474 VOID
476  ULONG TestId,
478 {
480  CACHE_UNINITIALIZE_EVENT CacheUninitEvent;
481 
483  ok_eq_ulong(TestTestId, TestId);
484 
485  if (!skip(TestFileObject != NULL, "No test FO\n"))
486  {
488  {
489  KeInitializeEvent(&CacheUninitEvent.Event, NotificationEvent, FALSE);
490  CcUninitializeCacheMap(TestFileObject, &Zero, &CacheUninitEvent);
491  KeWaitForSingleObject(&CacheUninitEvent.Event, Executive, KernelMode, FALSE, NULL);
492  }
493 
494  if (TestFileObject->FsContext != NULL)
495  {
496  ExFreePool(TestFileObject->FsContext);
497  TestFileObject->FsContext = NULL;
498  TestFileObject->SectionObjectPointer = NULL;
499  }
500 
502  }
503 
506  TestTestId = -1;
507 }
508 
509 
510 static
511 NTSTATUS
516  _In_ SIZE_T InLength,
517  _Inout_ PSIZE_T OutLength)
518 {
520 
522 
523  switch (ControlCode)
524  {
525  case IOCTL_START_TEST:
526  ok_eq_ulong((ULONG)InLength, sizeof(ULONG));
528  break;
529 
530  case IOCTL_FINISH_TEST:
531  ok_eq_ulong((ULONG)InLength, sizeof(ULONG));
533  break;
534 
535  default:
537  break;
538  }
539 
541 
542  return Status;
543 }
544 
545 static
546 NTSTATUS
549  _In_ PIRP Irp,
550  _In_ PIO_STACK_LOCATION IoStack)
551 {
553 
554  PAGED_CODE();
555 
556  DPRINT("IRP %x/%x\n", IoStack->MajorFunction, IoStack->MinorFunction);
557  ASSERT(IoStack->MajorFunction == IRP_MJ_READ);
558 
560 
562  Irp->IoStatus.Information = 0;
563 
564  if (IoStack->MajorFunction == IRP_MJ_READ)
565  {
566  PMDL Mdl;
567  ULONG Length;
568  PVOID Buffer;
570 
571  Offset = IoStack->Parameters.Read.ByteOffset;
572  Length = IoStack->Parameters.Read.Length;
573 
575  ok_eq_pointer(IoStack->FileObject, TestFileObject);
576 
577  ok(FlagOn(Irp->Flags, IRP_NOCACHE), "Not coming from Cc\n");
578 
579  ok_irql(APC_LEVEL);
580  ok((Offset.QuadPart % PAGE_SIZE == 0 || Offset.QuadPart == 0), "Offset is not aligned: %I64i\n", Offset.QuadPart);
581  ok(Length % PAGE_SIZE == 0, "Length is not aligned: %I64i\n", Length);
582 
583  ok(Irp->AssociatedIrp.SystemBuffer == NULL, "A SystemBuffer was allocated!\n");
585  ok(Buffer != NULL, "Null pointer!\n");
586  RtlFillMemory(Buffer, Length, 0xBA);
587 
589  if (Offset.QuadPart <= 0x3000 && Offset.QuadPart + Length > 0x3000)
590  {
591  *(PULONG)((ULONG_PTR)Buffer + (ULONG_PTR)(0x3000 - Offset.QuadPart)) = 0xDEADBABE;
592  }
593 
594  Mdl = Irp->MdlAddress;
595  ok(Mdl != NULL, "Null pointer for MDL!\n");
596  ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) != 0, "MDL not locked\n");
597  ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) == 0, "MDL from non paged\n");
598  ok((Mdl->MdlFlags & MDL_IO_PAGE_READ) != 0, "Non paging IO\n");
599  ok((Irp->Flags & IRP_PAGING_IO) != 0, "Non paging IO\n");
600 
601  Irp->IoStatus.Information = Length;
602  }
603 
604  if (Status == STATUS_PENDING)
605  {
609  }
610  else
611  {
612  Irp->IoStatus.Status = Status;
614  }
615 
617 
618  return Status;
619 }
#define MDL_IO_PAGE_READ
Definition: mmtypes.h:24
#define IOCTL_FINISH_TEST
#define ok_eq_ulong(value, expected)
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define IN
Definition: typedefs.h:38
#define TRUE
Definition: types.h:120
PKTHREAD KmtStartThread(IN PKSTART_ROUTINE StartRoutine, IN PVOID StartContext OPTIONAL)
#define LL
Definition: tui.h:72
#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 CACHE_MANAGER_CALLBACKS Callbacks
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
VOID NTAPI ReleaseFromReadAhead(_In_ PVOID Context)
#define ok_eq_pointer(value, expected)
static PDEVICE_OBJECT TestDeviceObject
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
#define PIN_WAIT
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
WCHAR DeviceName[]
Definition: adapter.cpp:21
#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
#define PAGED_CODE()
Definition: video.h:57
#define _In_opt_
Definition: no_sal2.h:213
struct _TEST_CONTEXT TEST_CONTEXT
LARGE_INTEGER FileSize
Definition: cctypes.h:16
_SEH2_TRY
Definition: create.c:4250
uint32_t ULONG_PTR
Definition: typedefs.h:63
struct _TEST_FCB TEST_FCB
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
static VOID CleanupTest(ULONG TestId, PDEVICE_OBJECT DeviceObject)
#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
VOID NTAPI ReleaseFromLazyWrite(_In_ PVOID Context)
#define CcIsFileCached(FO)
#define ok(value,...)
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#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
BOOLEAN NTAPI AcquireForLazyWrite(_In_ PVOID Context, _In_ BOOLEAN Wait)
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
Definition: bufpool.h:45
NTSTATUS TestEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ PCUNICODE_STRING RegistryPath, _Out_ PCWSTR *DeviceName, _Inout_ INT *Flags)
PFILE_OBJECT NTAPI IoCreateStreamFileObject(IN PFILE_OBJECT FileObject, IN PDEVICE_OBJECT DeviceObject)
Definition: file.c:3186
static VOID PerformTest(ULONG TestId, PDEVICE_OBJECT DeviceObject)
NTSTATUS KmtRegisterIrpHandler(IN UCHAR MajorFunction, IN PDEVICE_OBJECT DeviceObject OPTIONAL, IN PKMT_IRP_HANDLER IrpHandler)
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 _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
#define IOCTL_START_TEST
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
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:1954
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)
static const WCHAR L[]
Definition: oid.c:1250
static CC_FILE_SIZES FileSizes
static ULONG TestTestId
FSRTL_ADVANCED_FCB_HEADER Header
static KMT_MESSAGE_HANDLER TestMessageHandler
#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 KmtStartSeh()
Definition: kmt_test.h:277
VOID KmtFinishThread(IN PKTHREAD Thread OPTIONAL, IN PKEVENT Event OPTIONAL)
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
static VOID NTAPI PinInAnotherThread(IN PVOID Context)
#define _In_
Definition: no_sal2.h:204
static VOID NTAPI PinInAnotherThreadExclusive(IN PVOID Context)
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
ULONG_PTR SIZE_T
Definition: typedefs.h:78
_SEH2_END
Definition: create.c:4424
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
struct _TEST_CONTEXT * PTEST_CONTEXT
VOID NTAPI MmProbeAndLockPages(IN PMDL Mdl, IN KPROCESSOR_MODE AccessMode, IN LOCK_OPERATION Operation)
Definition: mdlsup.c:935
struct _TEST_FCB * PTEST_FCB
#define PIN_IF_BCB
BOOLEAN NTAPI CcUninitializeCacheMap(IN PFILE_OBJECT FileObject, IN OPTIONAL PLARGE_INTEGER TruncateSize, IN OPTIONAL PCACHE_UNINITIALIZE_EVENT UninitializeEvent)
Definition: fssup.c:284
static PVOID MapAndLockUserBuffer(_In_ _Out_ PIRP Irp, _In_ ULONG BufferLength)
unsigned int * PULONG
Definition: retypes.h:1
static KMT_IRP_HANDLER TestIrpHandler
#define PIN_EXCLUSIVE
#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(...)
FAST_MUTEX HeaderMutex
struct tagContext Context
Definition: acpixf.h:1012
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:565
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ULONG_PTR
Definition: config.h:101
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
BOOLEAN NTAPI AcquireForReadAhead(_In_ PVOID Context, _In_ BOOLEAN Wait)
BOOLEAN NTAPI CcPinMappedData(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG Flags, IN OUT PVOID *Bcb)
Definition: pinsup.c:774
_In_ PFCB Fcb
Definition: cdprocs.h:151
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:2745
IoMarkIrpPending(Irp)
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:593
static PFILE_OBJECT TestFileObject
#define APC_LEVEL
Definition: env_spec_w32.h:695
SECTION_OBJECT_POINTERS SectionObjectPointers
Definition: ntfs.h:502
unsigned short * PUSHORT
Definition: retypes.h:2
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
LONGLONG QuadPart
Definition: typedefs.h:112
VOID TestUnload(_In_ PDRIVER_OBJECT DriverObject)
IN BOOLEAN Wait
Definition: fatprocs.h:1529