ReactOS  0.4.14-dev-57-g333b8f1
CcMapData_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 CcMapData 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 {
29 
30 static ULONG TestTestId = -1;
33 static KMT_IRP_HANDLER TestIrpHandler;
34 static KMT_MESSAGE_HANDLER TestMessageHandler;
35 static ULONGLONG Memory = 0;
36 static BOOLEAN TS = FALSE;
37 
43  _Inout_ INT *Flags)
44 {
45  ULONG Length;
48  RTL_OSVERSIONINFOEXW VersionInfo;
49 
50  PAGED_CODE();
51 
53 
54  *DeviceName = L"CcMapData";
55  *Flags = TESTENTRY_NO_EXCLUSIVE_DEVICE |
56  TESTENTRY_BUFFERED_IO_DEVICE |
57  TESTENTRY_NO_READONLY_DEVICE;
58 
61 
63  &SBI,
64  sizeof(SBI),
65  &Length);
66  if (NT_SUCCESS(Status))
67  {
68  Memory = (SBI.NumberOfPhysicalPages * SBI.PageSize) / 1024 / 1024;
69  }
70  else
71  {
73  }
74 
75  VersionInfo.dwOSVersionInfoSize = sizeof(VersionInfo);
76  Status = RtlGetVersion((PRTL_OSVERSIONINFOW)&VersionInfo);
77  if (NT_SUCCESS(Status))
78  {
79  TS = BooleanFlagOn(VersionInfo.wSuiteMask, VER_SUITE_TERMINAL) &&
80  !BooleanFlagOn(VersionInfo.wSuiteMask, VER_SUITE_SINGLEUSERTS);
81  }
82  else
83  {
85  }
86 
87  trace("System with %I64dMb RAM and terminal services %S\n", Memory, (TS ? L"enabled" : L"disabled"));
88 
89  return Status;
90 }
91 
92 VOID
95 {
96  PAGED_CODE();
97 }
98 
99 BOOLEAN
100 NTAPI
103  _In_ BOOLEAN Wait)
104 {
105  return TRUE;
106 }
107 
108 VOID
109 NTAPI
112 {
113  return;
114 }
115 
116 BOOLEAN
117 NTAPI
120  _In_ BOOLEAN Wait)
121 {
122  return TRUE;
123 }
124 
125 VOID
126 NTAPI
129 {
130  return;
131 }
132 
138 };
139 
141  RTL_CONSTANT_LARGE_INTEGER((LONGLONG)0x4000), // .AllocationSize
142  RTL_CONSTANT_LARGE_INTEGER((LONGLONG)0x4000), // .FileSize
143  RTL_CONSTANT_LARGE_INTEGER((LONGLONG)0x4000) // .ValidDataLength
144 };
145 
146 static
147 PVOID
149  _In_ _Out_ PIRP Irp,
151 {
152  PMDL Mdl;
153 
154  if (Irp->MdlAddress == NULL)
155  {
156  Mdl = IoAllocateMdl(Irp->UserBuffer, BufferLength, FALSE, FALSE, Irp);
157  if (Mdl == NULL)
158  {
159  return NULL;
160  }
161 
162  _SEH2_TRY
163  {
164  MmProbeAndLockPages(Mdl, Irp->RequestorMode, IoWriteAccess);
165  }
167  {
168  IoFreeMdl(Mdl);
169  Irp->MdlAddress = NULL;
170  _SEH2_YIELD(return NULL);
171  }
172  _SEH2_END;
173  }
174 
176 }
177 
178 static
179 VOID
180 NTAPI
182 {
183  BOOLEAN Ret;
184  PULONG Buffer;
185  PVOID Bcb;
187  PTEST_CONTEXT TestContext;
188 
189  ok(TestFileObject != NULL, "Called in invalid context!\n");
191 
192  TestContext = Context;
193  ok(TestContext != NULL, "Called in invalid context!\n");
194  ok(TestContext->Bcb != NULL, "Called in invalid context!\n");
195  ok(TestContext->Buffer != NULL, "Called in invalid context!\n");
196  ok(TestContext->Length != 0, "Called in invalid context!\n");
197 
198  Ret = FALSE;
199  Offset.QuadPart = 0x1000;
200  KmtStartSeh();
201  Ret = CcMapData(TestFileObject, &Offset, TestContext->Length, MAP_WAIT, &Bcb, (PVOID *)&Buffer);
203 
204  if (!skip(Ret == TRUE, "CcMapData failed\n"))
205  {
206  ok_eq_pointer(Bcb, TestContext->Bcb);
207  ok_eq_pointer(Buffer, TestContext->Buffer);
208 
209  CcUnpinData(Bcb);
210  }
211 
212  KmtStartSeh();
213  Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, 0, &Bcb, (PVOID *)&Buffer);
215 
216  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
217  {
218  ok(Bcb != TestContext->Bcb, "Returned same BCB!\n");
219  ok_eq_pointer(Buffer, TestContext->Buffer);
220 
221  CcUnpinData(Bcb);
222  }
223 
224  KmtStartSeh();
225  Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, PIN_IF_BCB, &Bcb, (PVOID *)&Buffer);
227  ok(Ret == FALSE, "CcPinRead succeed\n");
228 
229  if (Ret)
230  {
231  CcUnpinData(Bcb);
232  }
233 
234  KmtStartSeh();
235  Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, PIN_EXCLUSIVE, &Bcb, (PVOID *)&Buffer);
237 
238  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
239  {
240  ok(Bcb != TestContext->Bcb, "Returned same BCB!\n");
241  ok_eq_pointer(Buffer, TestContext->Buffer);
242 
243  CcUnpinData(Bcb);
244  }
245 
246  Offset.QuadPart = 0x1500;
247  TestContext->Length -= 0x500;
248 
249  KmtStartSeh();
250  Ret = CcMapData(TestFileObject, &Offset, TestContext->Length, MAP_WAIT, &Bcb, (PVOID *)&Buffer);
252 
253  if (!skip(Ret == TRUE, "CcMapData failed\n"))
254  {
255  ok_eq_pointer(Bcb, TestContext->Bcb);
256  ok_eq_pointer(Buffer, (PVOID)((ULONG_PTR)TestContext->Buffer + 0x500));
257 
258  CcUnpinData(Bcb);
259  }
260 
261  return;
262 }
263 
264 static
265 VOID
267  ULONG TestId,
269 {
270  PVOID Bcb;
271  BOOLEAN Ret;
272  PULONG Buffer;
273  PTEST_FCB Fcb;
275 
278  ok_eq_ulong(TestTestId, -1);
279 
281  TestTestId = TestId;
283  if (!skip(TestFileObject != NULL, "Failed to allocate FO\n"))
284  {
286  if (!skip(Fcb != NULL, "ExAllocatePool failed\n"))
287  {
288  RtlZeroMemory(Fcb, sizeof(TEST_FCB));
289  ExInitializeFastMutex(&Fcb->HeaderMutex);
290  FsRtlSetupAdvancedHeader(&Fcb->Header, &Fcb->HeaderMutex);
291 
292  TestFileObject->FsContext = Fcb;
293  TestFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
294 
295  KmtStartSeh();
298 
299  if (!skip(CcIsFileCached(TestFileObject) == TRUE, "CcInitializeCacheMap failed\n"))
300  {
301  if (TestId < 3)
302  {
303  Ret = FALSE;
304  Offset.QuadPart = TestId * 0x1000;
305  KmtStartSeh();
308 
309  if (!skip(Ret == TRUE, "CcMapData failed\n"))
310  {
311  ok_eq_ulong(Buffer[(0x3000 - TestId * 0x1000) / sizeof(ULONG)], 0xDEADBABE);
312 
313  CcUnpinData(Bcb);
314  }
315  }
316  else if (TestId == 3)
317  {
318  PTEST_CONTEXT TestContext;
319 
320  TestContext = ExAllocatePool(NonPagedPool, sizeof(TEST_CONTEXT));
321  if (!skip(TestContext != NULL, "ExAllocatePool failed\n"))
322  {
323  Ret = FALSE;
324  Offset.QuadPart = 0x1000;
325  KmtStartSeh();
326  Ret = CcMapData(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, MAP_WAIT, &TestContext->Bcb, &TestContext->Buffer);
328 
329  if (!skip(Ret == TRUE, "CcMapData failed\n"))
330  {
331  PKTHREAD ThreadHandle;
332 
333  /* That's a bit rough but should do the job */
334 #ifdef _X86_
335  if (Memory >= 2 * 1024)
336  {
337  ok((TestContext->Buffer >= (PVOID)0xC1000000 && TestContext->Buffer < (PVOID)0xE0FFFFFF) ||
338  (TestContext->Buffer >= (PVOID)0xA4000000 && TestContext->Buffer < (PVOID)0xBFFFFFFF),
339  "Buffer %p not mapped in system space\n", TestContext->Buffer);
340  }
341  else if (TS)
342  {
343  ok(TestContext->Buffer >= (PVOID)0xC1000000 && TestContext->Buffer < (PVOID)0xDCFFFFFF,
344  "Buffer %p not mapped in system space\n", TestContext->Buffer);
345  }
346  else
347  {
348  ok(TestContext->Buffer >= (PVOID)0xC1000000 && TestContext->Buffer < (PVOID)0xDBFFFFFF,
349  "Buffer %p not mapped in system space\n", TestContext->Buffer);
350  }
351 #elif defined(_M_AMD64)
352  ok(TestContext->Buffer >= (PVOID)0xFFFFF98000000000 && TestContext->Buffer < (PVOID)0xFFFFFA8000000000,
353  "Buffer %p not mapped in system space\n", TestContext->Buffer);
354 #else
355  skip(FALSE, "System space mapping not defined\n");
356 #endif
357 
358  TestContext->Length = FileSizes.FileSize.QuadPart - Offset.QuadPart;
359  ThreadHandle = KmtStartThread(MapInAnotherThread, TestContext);
360  KmtFinishThread(ThreadHandle, NULL);
361 
362  TestContext->Length = FileSizes.FileSize.QuadPart - 2 * Offset.QuadPart;
363  ThreadHandle = KmtStartThread(MapInAnotherThread, TestContext);
364  KmtFinishThread(ThreadHandle, NULL);
365 
366  CcUnpinData(TestContext->Bcb);
367  }
368 
369  ExFreePool(TestContext);
370  }
371  }
372  else if (TestId == 4)
373  {
374  /* Map after EOF */
375  Ret = FALSE;
376  Offset.QuadPart = FileSizes.FileSize.QuadPart + 0x1000;
377 
378  KmtStartSeh();
379  Ret = CcMapData(TestFileObject, &Offset, 0x1000, 0, &Bcb, (PVOID *)&Buffer);
381  ok(Ret == FALSE, "CcMapData succeed\n");
382 
383  if (Ret)
384  {
385  CcUnpinData(Bcb);
386  }
387 
388  /* Map a VACB after EOF */
389  Ret = FALSE;
391 
392  KmtStartSeh();
393  Ret = CcMapData(TestFileObject, &Offset, 0x1000, 0, &Bcb, (PVOID *)&Buffer);
395  ok(Ret == FALSE, "CcMapData succeed\n");
396 
397  if (Ret)
398  {
399  CcUnpinData(Bcb);
400  }
401 
402  /* Map more than a VACB */
403  Ret = FALSE;
404  Offset.QuadPart = 0x0;
405 
406  KmtStartSeh();
409  ok(Ret == FALSE, "CcMapData succeed\n");
410 
411  if (Ret)
412  {
413  CcUnpinData(Bcb);
414  }
415  }
416  }
417  }
418  }
419 }
420 
421 
422 static
423 VOID
425  ULONG TestId,
427 {
429  CACHE_UNINITIALIZE_EVENT CacheUninitEvent;
430 
432  ok_eq_ulong(TestTestId, TestId);
433 
434  if (!skip(TestFileObject != NULL, "No test FO\n"))
435  {
437  {
438  KeInitializeEvent(&CacheUninitEvent.Event, NotificationEvent, FALSE);
439  CcUninitializeCacheMap(TestFileObject, &Zero, &CacheUninitEvent);
440  KeWaitForSingleObject(&CacheUninitEvent.Event, Executive, KernelMode, FALSE, NULL);
441  }
442 
443  if (TestFileObject->FsContext != NULL)
444  {
445  ExFreePool(TestFileObject->FsContext);
446  TestFileObject->FsContext = NULL;
447  TestFileObject->SectionObjectPointer = NULL;
448  }
449 
451  }
452 
455  TestTestId = -1;
456 }
457 
458 
459 static
460 NTSTATUS
465  _In_ SIZE_T InLength,
466  _Inout_ PSIZE_T OutLength)
467 {
469 
471 
472  switch (ControlCode)
473  {
474  case IOCTL_START_TEST:
475  ok_eq_ulong((ULONG)InLength, sizeof(ULONG));
477  break;
478 
479  case IOCTL_FINISH_TEST:
480  ok_eq_ulong((ULONG)InLength, sizeof(ULONG));
482  break;
483 
484  default:
486  break;
487  }
488 
490 
491  return Status;
492 }
493 
494 static
495 NTSTATUS
498  _In_ PIRP Irp,
499  _In_ PIO_STACK_LOCATION IoStack)
500 {
502 
503  PAGED_CODE();
504 
505  DPRINT("IRP %x/%x\n", IoStack->MajorFunction, IoStack->MinorFunction);
506  ASSERT(IoStack->MajorFunction == IRP_MJ_READ);
507 
509 
511  Irp->IoStatus.Information = 0;
512 
513  if (IoStack->MajorFunction == IRP_MJ_READ)
514  {
515  PMDL Mdl;
516  ULONG Length;
517  PVOID Buffer;
519 
520  Offset = IoStack->Parameters.Read.ByteOffset;
521  Length = IoStack->Parameters.Read.Length;
522 
524  ok_eq_pointer(IoStack->FileObject, TestFileObject);
525 
526  ok(FlagOn(Irp->Flags, IRP_NOCACHE), "Not coming from Cc\n");
527 
528  ok_irql(APC_LEVEL);
529  ok((Offset.QuadPart % PAGE_SIZE == 0 || Offset.QuadPart == 0), "Offset is not aligned: %I64i\n", Offset.QuadPart);
530  ok(Length % PAGE_SIZE == 0, "Length is not aligned: %I64i\n", Length);
531 
532  ok(Irp->AssociatedIrp.SystemBuffer == NULL, "A SystemBuffer was allocated!\n");
534  ok(Buffer != NULL, "Null pointer!\n");
535  RtlFillMemory(Buffer, Length, 0xBA);
536 
538  if (Offset.QuadPart <= 0x3000 && Offset.QuadPart + Length > 0x3000)
539  {
540  *(PULONG)((ULONG_PTR)Buffer + (ULONG_PTR)(0x3000 - Offset.QuadPart)) = 0xDEADBABE;
541  }
542 
543  Mdl = Irp->MdlAddress;
544  ok(Mdl != NULL, "Null pointer for MDL!\n");
545  ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) != 0, "MDL not locked\n");
546  ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) == 0, "MDL from non paged\n");
547  ok((Mdl->MdlFlags & MDL_IO_PAGE_READ) != 0, "Non paging IO\n");
548  ok((Irp->Flags & IRP_PAGING_IO) != 0, "Non paging IO\n");
549 
550  Irp->IoStatus.Information = Length;
551  }
552 
553  if (Status == STATUS_PENDING)
554  {
558  }
559  else
560  {
561  Irp->IoStatus.Status = Status;
563  }
564 
566 
567  return Status;
568 }
#define MDL_IO_PAGE_READ
Definition: mmtypes.h:24
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:265
NTSTATUS TestEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ PCUNICODE_STRING RegistryPath, _Out_ PCWSTR *DeviceName, _Inout_ INT *Flags)
Definition: CcMapData_drv.c:39
#define ok_eq_ulong(value, expected)
static ULONG TestTestId
Definition: CcMapData_drv.c:30
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:85
static VOID CleanupTest(ULONG TestId, PDEVICE_OBJECT DeviceObject)
#define FsRtlEnterFileSystem
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:402
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
Definition: version.c:158
#define FsRtlExitFileSystem
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:931
VOID NTAPI ReleaseFromLazyWrite(_In_ PVOID Context)
struct _TEST_FCB TEST_FCB
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
struct _TEST_CONTEXT TEST_CONTEXT
static BOOLEAN TS
Definition: CcMapData_drv.c:36
#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
static ULONGLONG Memory
Definition: CcMapData_drv.c:35
#define IRP_NOCACHE
#define MAP_WAIT
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
static CC_FILE_SIZES FileSizes
#define VER_SUITE_TERMINAL
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
LARGE_INTEGER FileSize
Definition: cctypes.h:16
_SEH2_TRY
Definition: create.c:4250
uint32_t ULONG_PTR
Definition: typedefs.h:63
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#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
#define IOCTL_START_TEST
Definition: CcMapData_drv.c:13
_In_ ULONG BufferLength
Definition: usbdlib.h:225
static CACHE_MANAGER_CALLBACKS Callbacks
#define CcIsFileCached(FO)
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NTSYSAPI NTSTATUS NTAPI ZwQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
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
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
Definition: bufpool.h:45
VOID TestUnload(_In_ PDRIVER_OBJECT DriverObject)
Definition: CcMapData_drv.c:93
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 PDEVICE_OBJECT TestDeviceObject
Definition: CcMapData_drv.c:32
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
static PVOID MapAndLockUserBuffer(_In_ _Out_ PIRP Irp, _In_ ULONG BufferLength)
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
struct _TEST_CONTEXT * PTEST_CONTEXT
#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:193
uint64_t ULONGLONG
Definition: typedefs.h:65
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:1955
static KMT_MESSAGE_HANDLER TestMessageHandler
Definition: CcMapData_drv.c:34
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
FSRTL_ADVANCED_FCB_HEADER Header
#define IOCTL_FINISH_TEST
Definition: CcMapData_drv.c:14
#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)
struct _TEST_FCB * PTEST_FCB
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
#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
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:228
#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
#define VER_SUITE_SINGLEUSERTS
#define ok(value,...)
Definition: atltest.h:57
unsigned int * PULONG
Definition: retypes.h:1
static PFILE_OBJECT TestFileObject
Definition: CcMapData_drv.c:31
#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
BOOLEAN NTAPI AcquireForReadAhead(_In_ PVOID Context, _In_ BOOLEAN Wait)
#define skip(...)
Definition: atltest.h:64
FAST_MUTEX HeaderMutex
#define VACB_MAPPING_GRANULARITY
BOOLEAN NTAPI AcquireForLazyWrite(_In_ PVOID Context, _In_ BOOLEAN Wait)
struct tagContext Context
Definition: acpixf.h:1024
#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
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
static KMT_IRP_HANDLER TestIrpHandler
Definition: CcMapData_drv.c:33
_In_ PFCB Fcb
Definition: cdprocs.h:151
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:2966
IoMarkIrpPending(Irp)
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:593
#define APC_LEVEL
Definition: env_spec_w32.h:695
SECTION_OBJECT_POINTERS SectionObjectPointers
Definition: ntfs.h:514
VOID NTAPI ReleaseFromReadAhead(_In_ PVOID Context)
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
static VOID PerformTest(ULONG TestId, PDEVICE_OBJECT DeviceObject)
static VOID NTAPI MapInAnotherThread(IN PVOID Context)
LONGLONG QuadPart
Definition: typedefs.h:112
IN BOOLEAN Wait
Definition: fatprocs.h:1529