ReactOS  0.4.14-dev-98-gb0d4763
CcPinRead_drv.c File Reference
#include <kmt_test.h>
#include <debug.h>
Include dependency graph for CcPinRead_drv.c:

Go to the source code of this file.

Classes

struct  _TEST_FCB
 
struct  _TEST_CONTEXT
 

Macros

#define NDEBUG
 
#define IOCTL_START_TEST   1
 
#define IOCTL_FINISH_TEST   2
 
#define ok_bcb(B, L, O)
 

Typedefs

typedef struct _TEST_FCB TEST_FCB
 
typedef struct _TEST_FCBPTEST_FCB
 
typedef struct _TEST_CONTEXT TEST_CONTEXT
 
typedef struct _TEST_CONTEXTPTEST_CONTEXT
 

Functions

NTSTATUS TestEntry (_In_ PDRIVER_OBJECT DriverObject, _In_ PCUNICODE_STRING RegistryPath, _Out_ PCWSTR *DeviceName, _Inout_ INT *Flags)
 
VOID TestUnload (_In_ PDRIVER_OBJECT DriverObject)
 
BOOLEAN NTAPI AcquireForLazyWrite (_In_ PVOID Context, _In_ BOOLEAN Wait)
 
VOID NTAPI ReleaseFromLazyWrite (_In_ PVOID Context)
 
BOOLEAN NTAPI AcquireForReadAhead (_In_ PVOID Context, _In_ BOOLEAN Wait)
 
VOID NTAPI ReleaseFromReadAhead (_In_ PVOID Context)
 
static PVOID MapAndLockUserBuffer (_In_ _Out_ PIRP Irp, _In_ ULONG BufferLength)
 
static VOID NTAPI PinInAnotherThread (IN PVOID Context)
 
static VOID NTAPI PinInAnotherThreadExclusive (IN PVOID Context)
 
static VOID PerformTest (ULONG TestId, PDEVICE_OBJECT DeviceObject)
 
static VOID CleanupTest (ULONG TestId, PDEVICE_OBJECT DeviceObject)
 
static NTSTATUS TestMessageHandler (_In_ PDEVICE_OBJECT DeviceObject, _In_ ULONG ControlCode, _In_opt_ PVOID Buffer, _In_ SIZE_T InLength, _Inout_ PSIZE_T OutLength)
 
static NTSTATUS TestIrpHandler (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _In_ PIO_STACK_LOCATION IoStack)
 

Variables

static ULONG TestTestId = -1
 
static PFILE_OBJECT TestFileObject
 
static PDEVICE_OBJECT TestDeviceObject
 
static KMT_IRP_HANDLER TestIrpHandler
 
static KMT_MESSAGE_HANDLER TestMessageHandler
 
static BOOLEAN TestWriteCalled = FALSE
 
static ULONGLONG Memory = 0
 
static BOOLEAN TS = FALSE
 
static CACHE_MANAGER_CALLBACKS Callbacks
 
static CC_FILE_SIZES FileSizes
 
static CC_FILE_SIZES SmallFileSizes
 

Macro Definition Documentation

◆ IOCTL_FINISH_TEST

#define IOCTL_FINISH_TEST   2

Definition at line 14 of file CcPinRead_drv.c.

◆ IOCTL_START_TEST

#define IOCTL_START_TEST   1

Definition at line 13 of file CcPinRead_drv.c.

◆ NDEBUG

#define NDEBUG

Definition at line 10 of file CcPinRead_drv.c.

◆ ok_bcb

#define ok_bcb (   B,
  L,
  O 
)
Value:
{ \
PPUBLIC_BCB public_bcb = (B); \
ok(public_bcb->NodeTypeCode == 0x2FD, "Not a BCB: %x\n", public_bcb->NodeTypeCode); \
ok(public_bcb->NodeByteSize == 0, "Invalid size: %d\n", public_bcb->NodeByteSize); \
ok_eq_ulong(public_bcb->MappedLength, (L)); \
ok_eq_longlong(public_bcb->MappedFileOffset.QuadPart, (O)); \
}
static const WCHAR O[]
Definition: oid.c:1251
static const WCHAR L[]
Definition: oid.c:1250
#define B(row, col)

Definition at line 186 of file CcPinRead_drv.c.

Typedef Documentation

◆ PTEST_CONTEXT

◆ PTEST_FCB

◆ TEST_CONTEXT

◆ TEST_FCB

Function Documentation

◆ AcquireForLazyWrite()

BOOLEAN NTAPI AcquireForLazyWrite ( _In_ PVOID  Context,
_In_ BOOLEAN  Wait 
)

Definition at line 103 of file CcPinRead_drv.c.

106 {
107  return TRUE;
108 }
#define TRUE
Definition: types.h:120

◆ AcquireForReadAhead()

BOOLEAN NTAPI AcquireForReadAhead ( _In_ PVOID  Context,
_In_ BOOLEAN  Wait 
)

Definition at line 120 of file CcPinRead_drv.c.

123 {
124  return TRUE;
125 }
#define TRUE
Definition: types.h:120

◆ CleanupTest()

static VOID CleanupTest ( ULONG  TestId,
PDEVICE_OBJECT  DeviceObject 
)
static

Definition at line 629 of file CcPinRead_drv.c.

632 {
634  CACHE_UNINITIALIZE_EVENT CacheUninitEvent;
635 
637  ok_eq_ulong(TestTestId, TestId);
638 
639  if (!skip(TestFileObject != NULL, "No test FO\n"))
640  {
642  {
643  KeInitializeEvent(&CacheUninitEvent.Event, NotificationEvent, FALSE);
644  CcUninitializeCacheMap(TestFileObject, &Zero, &CacheUninitEvent);
645  KeWaitForSingleObject(&CacheUninitEvent.Event, Executive, KernelMode, FALSE, NULL);
646  }
647 
648  if (TestFileObject->FsContext != NULL)
649  {
650  ExFreePool(TestFileObject->FsContext);
651  TestFileObject->FsContext = NULL;
652  TestFileObject->SectionObjectPointer = NULL;
653  }
654 
655  if (TestTestId == 6)
656  {
657  ok_bool_true(TestWriteCalled, "Write was not called!\n");
658  }
659  else
660  {
661  ok_bool_false(TestWriteCalled, "Write was unexpectedly called\n");
662  }
663 
665  }
666 
669  TestTestId = -1;
671 }
#define ok_eq_ulong(value, expected)
#define LL
Definition: tui.h:85
#define ok_eq_pointer(value, expected)
static PFILE_OBJECT TestFileObject
Definition: CcPinRead_drv.c:31
static PDEVICE_OBJECT TestDeviceObject
Definition: CcPinRead_drv.c:32
VOID NTAPI ObDereferenceObject(IN PVOID Object)
Definition: obref.c:375
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
#define ok_bool_false(value, desc)
Definition: kmt_test.h:257
#define ok_bool_true(value, desc)
Definition: kmt_test.h:256
#define RTL_CONSTANT_LARGE_INTEGER(quad_part)
Definition: rtltypes.h:414
#define CcIsFileCached(FO)
smooth NULL
Definition: ftsmooth.c:416
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
BOOLEAN NTAPI CcUninitializeCacheMap(IN PFILE_OBJECT FileObject, IN OPTIONAL PLARGE_INTEGER TruncateSize, IN OPTIONAL PCACHE_UNINITIALIZE_EVENT UninitializeEvent)
Definition: fssup.c:284
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN IN BOOLEAN Zero
Definition: fatprocs.h:402
#define skip(...)
Definition: atltest.h:64
static ULONG TestTestId
Definition: CcPinRead_drv.c:30
static BOOLEAN TestWriteCalled
Definition: CcPinRead_drv.c:35
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

Referenced by TestMessageHandler().

◆ MapAndLockUserBuffer()

static PVOID MapAndLockUserBuffer ( _In_ _Out_ PIRP  Irp,
_In_ ULONG  BufferLength 
)
static

Definition at line 156 of file CcPinRead_drv.c.

159 {
160  PMDL Mdl;
161 
162  if (Irp->MdlAddress == NULL)
163  {
164  Mdl = IoAllocateMdl(Irp->UserBuffer, BufferLength, FALSE, FALSE, Irp);
165  if (Mdl == NULL)
166  {
167  return NULL;
168  }
169 
170  _SEH2_TRY
171  {
172  MmProbeAndLockPages(Mdl, Irp->RequestorMode, IoWriteAccess);
173  }
175  {
176  IoFreeMdl(Mdl);
177  Irp->MdlAddress = NULL;
178  _SEH2_YIELD(return NULL);
179  }
180  _SEH2_END;
181  }
182 
184 }
_In_ PIRP Irp
Definition: csq.h:116
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
_SEH2_TRY
Definition: create.c:4250
_In_ ULONG BufferLength
Definition: usbdlib.h:225
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
VOID NTAPI IoFreeMdl(PMDL Mdl)
Definition: iomdl.c:146
PMDL NTAPI IoAllocateMdl(IN PVOID VirtualAddress, IN ULONG Length, IN BOOLEAN SecondaryBuffer, IN BOOLEAN ChargeQuota, IN PIRP Irp)
Definition: iomdl.c:22
_SEH2_END
Definition: create.c:4424
VOID NTAPI MmProbeAndLockPages(IN PMDL Mdl, IN KPROCESSOR_MODE AccessMode, IN LOCK_OPERATION Operation)
Definition: mdlsup.c:935
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6

Referenced by TestIrpHandler().

◆ PerformTest()

static VOID PerformTest ( ULONG  TestId,
PDEVICE_OBJECT  DeviceObject 
)
static

Definition at line 397 of file CcPinRead_drv.c.

400 {
401  PVOID Bcb;
402  BOOLEAN Ret;
403  PULONG Buffer;
404  PTEST_FCB Fcb;
406 
409  ok_eq_ulong(TestTestId, -1);
410 
412  TestTestId = TestId;
414  if (!skip(TestFileObject != NULL, "Failed to allocate FO\n"))
415  {
417  if (!skip(Fcb != NULL, "ExAllocatePool failed\n"))
418  {
419  BOOLEAN PinAccess = (TestId != 4);
420 
421  RtlZeroMemory(Fcb, sizeof(TEST_FCB));
422  ExInitializeFastMutex(&Fcb->HeaderMutex);
423  FsRtlSetupAdvancedHeader(&Fcb->Header, &Fcb->HeaderMutex);
424 
425  TestFileObject->FsContext = Fcb;
426  TestFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers;
427 
428  KmtStartSeh();
429  if (TestId < 6)
430  {
432  }
433  else
434  {
436  }
438 
439  if (!skip(CcIsFileCached(TestFileObject) == TRUE, "CcInitializeCacheMap failed\n"))
440  {
441  if (TestId < 3)
442  {
443  Ret = FALSE;
444  Offset.QuadPart = TestId * 0x1000;
445  KmtStartSeh();
448 
449  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
450  {
451  ok_bcb(Bcb, ((4 - TestId) * 4096), Offset.QuadPart);
452  ok_eq_ulong(Buffer[(0x3000 - TestId * 0x1000) / sizeof(ULONG)], 0xDEADBABE);
453 
454  CcUnpinData(Bcb);
455  }
456  }
457  else if (TestId == 3)
458  {
459  PTEST_CONTEXT TestContext;
460 
461  TestContext = ExAllocatePool(NonPagedPool, sizeof(TEST_CONTEXT));
462  if (!skip(TestContext != NULL, "ExAllocatePool failed\n"))
463  {
464  Ret = FALSE;
465  Offset.QuadPart = 0x1000;
466 
467  /* Try enforce BCB first */
468  KmtStartSeh();
471  ok(Ret == FALSE, "CcPinRead succeed\n");
472  if (Ret)
473  {
474  CcUnpinData(Bcb);
475  }
476 
477  KmtStartSeh();
478  Ret = CcPinRead(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, PIN_WAIT, &TestContext->Bcb, &TestContext->Buffer);
480 
481  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
482  {
483  PKTHREAD ThreadHandle;
484 
485  ok_bcb(TestContext->Bcb, 12288, Offset.QuadPart);
486 
487  /* That's a bit rough but should do the job */
488 #ifdef _X86_
489  if (Memory >= 2 * 1024)
490  {
491  ok((TestContext->Buffer >= (PVOID)0xC1000000 && TestContext->Buffer < (PVOID)0xE0FFFFFF) ||
492  (TestContext->Buffer >= (PVOID)0xA4000000 && TestContext->Buffer < (PVOID)0xBFFFFFFF),
493  "Buffer %p not mapped in system space\n", TestContext->Buffer);
494  }
495  else if (TS)
496  {
497  ok(TestContext->Buffer >= (PVOID)0xC1000000 && TestContext->Buffer < (PVOID)0xDCFFFFFF,
498  "Buffer %p not mapped in system space\n", TestContext->Buffer);
499  }
500  else
501  {
502  ok(TestContext->Buffer >= (PVOID)0xC1000000 && TestContext->Buffer < (PVOID)0xDBFFFFFF,
503  "Buffer %p not mapped in system space\n", TestContext->Buffer);
504  }
505 #elif defined(_M_AMD64)
506  ok(TestContext->Buffer >= (PVOID)0xFFFFF98000000000 && TestContext->Buffer < (PVOID)0xFFFFFA8000000000,
507  "Buffer %p not mapped in system space\n", TestContext->Buffer);
508 #else
509  skip(FALSE, "System space mapping not defined\n");
510 #endif
511 
512  TestContext->Length = FileSizes.FileSize.QuadPart - Offset.QuadPart;
513  ThreadHandle = KmtStartThread(PinInAnotherThread, TestContext);
514  KmtFinishThread(ThreadHandle, NULL);
515 
516  TestContext->Length = FileSizes.FileSize.QuadPart - 2 * Offset.QuadPart;
517  ThreadHandle = KmtStartThread(PinInAnotherThread, TestContext);
518  KmtFinishThread(ThreadHandle, NULL);
519 
520  CcUnpinData(TestContext->Bcb);
521  }
522 
523  KmtStartSeh();
524  Ret = CcPinRead(TestFileObject, &Offset, FileSizes.FileSize.QuadPart - Offset.QuadPart, PIN_WAIT | PIN_EXCLUSIVE, &TestContext->Bcb, &TestContext->Buffer);
526 
527  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
528  {
529  PKTHREAD ThreadHandle;
530 
531  ok_bcb(TestContext->Bcb, 12288, Offset.QuadPart);
532 
533  TestContext->Length = FileSizes.FileSize.QuadPart - Offset.QuadPart;
534  ThreadHandle = KmtStartThread(PinInAnotherThreadExclusive, TestContext);
535  KmtFinishThread(ThreadHandle, NULL);
536 
537  CcUnpinData(TestContext->Bcb);
538  }
539 
540  ExFreePool(TestContext);
541  }
542  }
543  else if (TestId == 4)
544  {
545  Ret = FALSE;
546  Offset.QuadPart = 0x1000;
547  KmtStartSeh();
550 
551  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
552  {
553  ok_bcb(Bcb, 12288, Offset.QuadPart);
554  ok_eq_ulong(Buffer[0x2000 / sizeof(ULONG)], 0);
555 
556  CcUnpinData(Bcb);
557  }
558  }
559  else if (TestId == 5)
560  {
561  /* Pin after EOF */
562  Ret = FALSE;
563  Offset.QuadPart = FileSizes.FileSize.QuadPart + 0x1000;
564 
565  KmtStartSeh();
566  Ret = CcPinRead(TestFileObject, &Offset, 0x1000, 0, &Bcb, (PVOID *)&Buffer);
568  ok(Ret == FALSE, "CcPinRead succeed\n");
569 
570  if (Ret)
571  {
572  CcUnpinData(Bcb);
573  }
574 
575  /* Pin a VACB after EOF */
576  Ret = FALSE;
578 
579  KmtStartSeh();
580  Ret = CcPinRead(TestFileObject, &Offset, 0x1000, 0, &Bcb, (PVOID *)&Buffer);
582  ok(Ret == FALSE, "CcPinRead succeed\n");
583 
584  if (Ret)
585  {
586  CcUnpinData(Bcb);
587  }
588 
589  /* Pin more than a VACB */
590  Ret = FALSE;
591  Offset.QuadPart = 0x0;
592 
593  KmtStartSeh();
596  ok(Ret == FALSE, "CcPinRead succeed\n");
597 
598  if (Ret)
599  {
600  CcUnpinData(Bcb);
601  }
602  }
603  else if (TestId == 6)
604  {
605  Ret = FALSE;
606  Offset.QuadPart = 0;
607 
608  KmtStartSeh();
611 
612  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
613  {
614  ok_bcb(Bcb, PAGE_SIZE * 4, Offset.QuadPart);
617 
618  CcUnpinData(Bcb);
619  }
620  }
621  }
622  }
623  }
624 }
#define ok_eq_ulong(value, expected)
#define TRUE
Definition: types.h:120
PKTHREAD KmtStartThread(IN PKSTART_ROUTINE StartRoutine, IN PVOID StartContext OPTIONAL)
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:402
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:931
static CACHE_MANAGER_CALLBACKS Callbacks
VOID NTAPI CcSetDirtyPinnedData(IN PVOID BcbVoid, IN OPTIONAL PLARGE_INTEGER Lsn)
Definition: cachesub.c:121
#define ok_eq_pointer(value, expected)
static PFILE_OBJECT TestFileObject
Definition: CcPinRead_drv.c:31
#define KmtEndSeh(ExpectedStatus)
Definition: kmt_test.h:283
VOID NTAPI CcUnpinData(IN PVOID Bcb)
Definition: pinsup.c:955
static PDEVICE_OBJECT TestDeviceObject
Definition: CcPinRead_drv.c:32
#define PIN_WAIT
LARGE_INTEGER FileSize
Definition: cctypes.h:16
static CC_FILE_SIZES SmallFileSizes
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
static CC_FILE_SIZES FileSizes
#define CcIsFileCached(FO)
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
PFILE_OBJECT NTAPI IoCreateStreamFileObject(IN PFILE_OBJECT FileObject, IN PDEVICE_OBJECT DeviceObject)
Definition: file.c:3186
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 VOID NTAPI PinInAnotherThread(IN PVOID Context)
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
static BOOLEAN TS
Definition: CcPinRead_drv.c:37
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
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
ULONG LowPart
Definition: typedefs.h:104
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define KmtStartSeh()
Definition: kmt_test.h:277
VOID KmtFinishThread(IN PKTHREAD Thread OPTIONAL, IN PKEVENT Event OPTIONAL)
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:228
#define ok_bcb(B, L, O)
#define PIN_IF_BCB
#define ok(value,...)
Definition: atltest.h:57
unsigned int * PULONG
Definition: retypes.h:1
static ULONGLONG Memory
Definition: CcPinRead_drv.c:36
#define PIN_EXCLUSIVE
#define skip(...)
Definition: atltest.h:64
static ULONG TestTestId
Definition: CcPinRead_drv.c:30
#define VACB_MAPPING_GRANULARITY
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
static VOID NTAPI PinInAnotherThreadExclusive(IN PVOID Context)
_In_ PFCB Fcb
Definition: cdprocs.h:151
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define RtlFillMemory(Dest, Length, Fill)
Definition: winternl.h:593
SECTION_OBJECT_POINTERS SectionObjectPointers
Definition: ntfs.h:514
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
LONGLONG QuadPart
Definition: typedefs.h:112

Referenced by TestMessageHandler().

◆ PinInAnotherThread()

static VOID NTAPI PinInAnotherThread ( IN PVOID  Context)
static

Definition at line 198 of file CcPinRead_drv.c.

199 {
200  BOOLEAN Ret;
201  PULONG Buffer;
202  PVOID Bcb;
204  PTEST_CONTEXT TestContext;
205 
206  ok(TestFileObject != NULL, "Called in invalid context!\n");
208 
209  TestContext = Context;
210  ok(TestContext != NULL, "Called in invalid context!\n");
211  ok(TestContext->Bcb != NULL, "Called in invalid context!\n");
212  ok(TestContext->Buffer != NULL, "Called in invalid context!\n");
213  ok(TestContext->Length != 0, "Called in invalid context!\n");
214 
215  Ret = FALSE;
216  Offset.QuadPart = 0x1000;
217  KmtStartSeh();
218  Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, PIN_WAIT, &Bcb, (PVOID *)&Buffer);
220 
221  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
222  {
223  ok_bcb(Bcb, 12288, Offset.QuadPart);
224  ok_eq_pointer(Bcb, TestContext->Bcb);
225  ok_eq_pointer(Buffer, TestContext->Buffer);
226 
227  CcUnpinData(Bcb);
228  }
229 
230  KmtStartSeh();
231  Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, PIN_WAIT | PIN_IF_BCB, &Bcb, (PVOID *)&Buffer);
233 
234  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
235  {
236  ok_bcb(Bcb, 12288, Offset.QuadPart);
237  ok_eq_pointer(Bcb, TestContext->Bcb);
238  ok_eq_pointer(Buffer, TestContext->Buffer);
239 
240  CcUnpinData(Bcb);
241  }
242 
243  KmtStartSeh();
244  Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, PIN_EXCLUSIVE, &Bcb, (PVOID *)&Buffer);
246 
247  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
248  {
249  ok_bcb(Bcb, 12288, Offset.QuadPart);
250  ok_eq_pointer(Bcb, TestContext->Bcb);
251  ok_eq_pointer(Buffer, TestContext->Buffer);
252 
253  CcUnpinData(Bcb);
254  }
255 
256  KmtStartSeh();
257  Ret = CcMapData(TestFileObject, &Offset, TestContext->Length, MAP_WAIT, &Bcb, (PVOID *)&Buffer);
259 
260  if (!skip(Ret == TRUE, "CcMapData failed\n"))
261  {
262  ok(Bcb != TestContext->Bcb, "Returned same BCB!\n");
263  ok_eq_pointer(Buffer, TestContext->Buffer);
264 
265  CcUnpinData(Bcb);
266  }
267 
268  Offset.QuadPart = 0x1500;
269  TestContext->Length -= 0x500;
270 
271  KmtStartSeh();
272  Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, PIN_WAIT | PIN_IF_BCB, &Bcb, (PVOID *)&Buffer);
274 
275  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
276  {
277  ok_bcb(Bcb, 12288, 4096);
278  ok_eq_pointer(Bcb, TestContext->Bcb);
279  ok_eq_pointer(Buffer, (PVOID)((ULONG_PTR)TestContext->Buffer + 0x500));
280 
281  CcUnpinData(Bcb);
282  }
283 
284  KmtStartSeh();
285  Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, PIN_WAIT, &Bcb, (PVOID *)&Buffer);
287 
288  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
289  {
290  ok_bcb(Bcb, 12288, 4096);
291  ok_eq_pointer(Bcb, TestContext->Bcb);
292  ok_eq_pointer(Buffer, (PVOID)((ULONG_PTR)TestContext->Buffer + 0x500));
293 
294  CcUnpinData(Bcb);
295  }
296 
297  KmtStartSeh();
298  Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, PIN_EXCLUSIVE, &Bcb, (PVOID *)&Buffer);
300 
301  if (!skip(Ret == TRUE, "CcPinRead failed\n"))
302  {
303  ok_bcb(Bcb, 12288, 4096);
304  ok_eq_pointer(Bcb, TestContext->Bcb);
305  ok_eq_pointer(Buffer, (PVOID)((ULONG_PTR)TestContext->Buffer + 0x500));
306 
307  CcUnpinData(Bcb);
308  }
309 
310  return;
311 }
#define ok_eq_ulong(value, expected)
#define TRUE
Definition: types.h:120
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:402
#define ok_eq_pointer(value, expected)
static PFILE_OBJECT TestFileObject
Definition: CcPinRead_drv.c:31
#define KmtEndSeh(ExpectedStatus)
Definition: kmt_test.h:283
VOID NTAPI CcUnpinData(IN PVOID Bcb)
Definition: pinsup.c:955
#define MAP_WAIT
#define PIN_WAIT
uint32_t ULONG_PTR
Definition: typedefs.h:63
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
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
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
#define KmtStartSeh()
Definition: kmt_test.h:277
#define ok_bcb(B, L, O)
#define PIN_IF_BCB
#define ok(value,...)
Definition: atltest.h:57
unsigned int * PULONG
Definition: retypes.h:1
#define PIN_EXCLUSIVE
#define skip(...)
Definition: atltest.h:64
static ULONG TestTestId
Definition: CcPinRead_drv.c:30
struct tagContext Context
Definition: acpixf.h:1024
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by PerformTest().

◆ PinInAnotherThreadExclusive()

static VOID NTAPI PinInAnotherThreadExclusive ( IN PVOID  Context)
static

Definition at line 316 of file CcPinRead_drv.c.

317 {
318  BOOLEAN Ret;
319  PULONG Buffer;
320  PVOID Bcb;
322  PTEST_CONTEXT TestContext;
323 
324  ok(TestFileObject != NULL, "Called in invalid context!\n");
326 
327  TestContext = Context;
328  ok(TestContext != NULL, "Called in invalid context!\n");
329  ok(TestContext->Bcb != NULL, "Called in invalid context!\n");
330  ok(TestContext->Buffer != NULL, "Called in invalid context!\n");
331  ok(TestContext->Length != 0, "Called in invalid context!\n");
332 
333  Ret = FALSE;
334  Offset.QuadPart = 0x1000;
335  KmtStartSeh();
336  Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, PIN_EXCLUSIVE, &Bcb, (PVOID *)&Buffer);
338  ok(Ret == FALSE, "CcPinRead succeed\n");
339 
340  if (Ret)
341  {
342  CcUnpinData(Bcb);
343  }
344 
345  KmtStartSeh();
346  Ret = CcMapData(TestFileObject, &Offset, TestContext->Length, 0, &Bcb, (PVOID *)&Buffer);
348 
349  if (!skip(Ret == TRUE, "CcMapData failed\n"))
350  {
351  ok(Bcb != TestContext->Bcb, "Returned same BCB!\n");
352  ok_eq_pointer(Buffer, TestContext->Buffer);
353 
354  CcUnpinData(Bcb);
355  }
356 
357  Offset.QuadPart = 0x1500;
358  TestContext->Length -= 0x500;
359 
360  KmtStartSeh();
361  Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, PIN_IF_BCB, &Bcb, (PVOID *)&Buffer);
363  ok(Ret == FALSE, "CcPinRead succeed\n");
364 
365  if (Ret)
366  {
367  CcUnpinData(Bcb);
368  }
369 
370  KmtStartSeh();
371  Ret = CcPinRead(TestFileObject, &Offset, TestContext->Length, 0, &Bcb, (PVOID *)&Buffer);
373  ok(Ret == FALSE, "CcPinRead succeed\n");
374 
375  if (Ret)
376  {
377  CcUnpinData(Bcb);
378  }
379 
380  KmtStartSeh();
381  Ret = CcMapData(TestFileObject, &Offset, TestContext->Length, 0, &Bcb, (PVOID *)&Buffer);
383 
384  if (!skip(Ret == TRUE, "CcMapData failed\n"))
385  {
386  ok(Bcb != TestContext->Bcb, "Returned same BCB!\n");
387  ok_eq_pointer(Buffer, (PVOID)((ULONG_PTR)TestContext->Buffer + 0x500));
388 
389  CcUnpinData(Bcb);
390  }
391 
392  return;
393 }
#define ok_eq_ulong(value, expected)
#define TRUE
Definition: types.h:120
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
Definition: fatprocs.h:402
#define ok_eq_pointer(value, expected)
static PFILE_OBJECT TestFileObject
Definition: CcPinRead_drv.c:31
#define KmtEndSeh(ExpectedStatus)
Definition: kmt_test.h:283
VOID NTAPI CcUnpinData(IN PVOID Bcb)
Definition: pinsup.c:955
uint32_t ULONG_PTR
Definition: typedefs.h:63
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
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
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
#define KmtStartSeh()
Definition: kmt_test.h:277
#define PIN_IF_BCB
#define ok(value,...)
Definition: atltest.h:57
unsigned int * PULONG
Definition: retypes.h:1
#define PIN_EXCLUSIVE
#define skip(...)
Definition: atltest.h:64
static ULONG TestTestId
Definition: CcPinRead_drv.c:30
struct tagContext Context
Definition: acpixf.h:1024
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by PerformTest().

◆ ReleaseFromLazyWrite()

VOID NTAPI ReleaseFromLazyWrite ( _In_ PVOID  Context)

Definition at line 112 of file CcPinRead_drv.c.

114 {
115  return;
116 }

◆ ReleaseFromReadAhead()

VOID NTAPI ReleaseFromReadAhead ( _In_ PVOID  Context)

Definition at line 129 of file CcPinRead_drv.c.

131 {
132  return;
133 }

◆ TestEntry()

NTSTATUS TestEntry ( _In_ PDRIVER_OBJECT  DriverObject,
_In_ PCUNICODE_STRING  RegistryPath,
_Out_ PCWSTR DeviceName,
_Inout_ INT Flags 
)

Definition at line 40 of file CcPinRead_drv.c.

45 {
46  ULONG Length;
49  RTL_OSVERSIONINFOEXW VersionInfo;
50 
51  PAGED_CODE();
52 
54 
55  *DeviceName = L"CcPinRead";
56  *Flags = TESTENTRY_NO_EXCLUSIVE_DEVICE |
57  TESTENTRY_BUFFERED_IO_DEVICE |
58  TESTENTRY_NO_READONLY_DEVICE;
59 
63 
65  &SBI,
66  sizeof(SBI),
67  &Length);
68  if (NT_SUCCESS(Status))
69  {
70  Memory = (SBI.NumberOfPhysicalPages * SBI.PageSize) / 1024 / 1024;
71  }
72  else
73  {
75  }
76 
77  VersionInfo.dwOSVersionInfoSize = sizeof(VersionInfo);
78  Status = RtlGetVersion((PRTL_OSVERSIONINFOW)&VersionInfo);
79  if (NT_SUCCESS(Status))
80  {
83  }
84  else
85  {
87  }
88 
89  trace("System with %I64dMb RAM and terminal services %S\n", Memory, (TS ? L"enabled" : L"disabled"));
90 
91  return Status;
92 }
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:265
NTSTATUS NTAPI RtlGetVersion(IN OUT PRTL_OSVERSIONINFOW lpVersionInformation)
Definition: version.c:158
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
LONG NTSTATUS
Definition: precomp.h:26
#define VER_SUITE_TERMINAL
WCHAR DeviceName[]
Definition: adapter.cpp:21
USHORT wSuiteMask
Definition: rtltypes.h:273
#define PAGED_CODE()
Definition: video.h:57
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
NTSYSAPI NTSTATUS NTAPI ZwQuerySystemInformation(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS KmtRegisterIrpHandler(IN UCHAR MajorFunction, IN PDEVICE_OBJECT DeviceObject OPTIONAL, IN PKMT_IRP_HANDLER IrpHandler)
NTSTATUS KmtRegisterMessageHandler(IN ULONG ControlCode OPTIONAL, IN PDEVICE_OBJECT DeviceObject OPTIONAL, IN PKMT_MESSAGE_HANDLER MessageHandler)
#define trace
Definition: atltest.h:70
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static KMT_IRP_HANDLER TestIrpHandler
Definition: CcPinRead_drv.c:33
static BOOLEAN TS
Definition: CcPinRead_drv.c:37
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
static const WCHAR L[]
Definition: oid.c:1250
Status
Definition: gdiplustypes.h:24
#define VER_SUITE_SINGLEUSERTS
static KMT_MESSAGE_HANDLER TestMessageHandler
Definition: CcPinRead_drv.c:34
static ULONGLONG Memory
Definition: CcPinRead_drv.c:36
#define IRP_MJ_READ
Definition: rdpdr.c:46
unsigned int ULONG
Definition: retypes.h:1
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
return STATUS_SUCCESS
Definition: btrfs.c:2966

◆ TestIrpHandler()

static NTSTATUS TestIrpHandler ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ PIRP  Irp,
_In_ PIO_STACK_LOCATION  IoStack 
)
static

Definition at line 711 of file CcPinRead_drv.c.

715 {
717 
718  PAGED_CODE();
719 
720  DPRINT("IRP %x/%x\n", IoStack->MajorFunction, IoStack->MinorFunction);
721  ASSERT(IoStack->MajorFunction == IRP_MJ_READ ||
722  IoStack->MajorFunction == IRP_MJ_WRITE);
723 
725 
727  Irp->IoStatus.Information = 0;
728 
729  if (IoStack->MajorFunction == IRP_MJ_READ)
730  {
731  PMDL Mdl;
732  ULONG Length;
733  PVOID Buffer;
735 
736  Offset = IoStack->Parameters.Read.ByteOffset;
737  Length = IoStack->Parameters.Read.Length;
738 
740  ok_eq_pointer(IoStack->FileObject, TestFileObject);
741 
742  ok(FlagOn(Irp->Flags, IRP_NOCACHE), "Not coming from Cc\n");
743 
744  ok_irql(APC_LEVEL);
745  ok((Offset.QuadPart % PAGE_SIZE == 0 || Offset.QuadPart == 0), "Offset is not aligned: %I64i\n", Offset.QuadPart);
746  ok(Length % PAGE_SIZE == 0, "Length is not aligned: %I64i\n", Length);
747 
748  ok(Irp->AssociatedIrp.SystemBuffer == NULL, "A SystemBuffer was allocated!\n");
750  ok(Buffer != NULL, "Null pointer!\n");
751  RtlFillMemory(Buffer, Length, 0xBA);
752 
754  if (Offset.QuadPart <= 0x3000 && Offset.QuadPart + Length > 0x3000)
755  {
756  *(PULONG)((ULONG_PTR)Buffer + (ULONG_PTR)(0x3000 - Offset.QuadPart)) = 0xDEADBABE;
757  }
758 
759  Mdl = Irp->MdlAddress;
760  ok(Mdl != NULL, "Null pointer for MDL!\n");
761  ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) != 0, "MDL not locked\n");
762  ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) == 0, "MDL from non paged\n");
763  ok((Mdl->MdlFlags & MDL_IO_PAGE_READ) != 0, "Non paging IO\n");
764  ok((Irp->Flags & IRP_PAGING_IO) != 0, "Non paging IO\n");
765 
766  Irp->IoStatus.Information = Length;
767  }
768  else if (IoStack->MajorFunction == IRP_MJ_WRITE)
769  {
770  PMDL Mdl;
771  ULONG Length;
772  PVOID Buffer;
774 
775  Offset = IoStack->Parameters.Write.ByteOffset;
776  Length = IoStack->Parameters.Write.Length;
777 
778  ok(TestTestId == 6, "Unexpected test id: %d\n", TestTestId);
780  ok_eq_pointer(IoStack->FileObject, TestFileObject);
781 
782  ok(FlagOn(Irp->Flags, IRP_NOCACHE), "Not coming from Cc\n");
783 
784  ok_irql(PASSIVE_LEVEL);
785  ok(Offset.QuadPart == 0, "Offset is not null: %I64i\n", Offset.QuadPart);
786  ok(Length % PAGE_SIZE == 0, "Length is not aligned: %I64i\n", Length);
787  ok(Length == PAGE_SIZE * 4, "Length is not MappedLength-sized: %I64i\n", Length);
788 
790  ok(Buffer != NULL, "Null pointer!\n");
791 
792  Mdl = Irp->MdlAddress;
793  ok(Mdl != NULL, "Null pointer for MDL!\n");
794  ok((Mdl->MdlFlags & MDL_PAGES_LOCKED) != 0, "MDL not locked\n");
795  ok((Mdl->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) == 0, "MDL from non paged\n");
796  ok((Irp->Flags & IRP_PAGING_IO) != 0, "Non paging IO\n");
797 
798  ok_bool_false(TestWriteCalled, "Write has been unexpectedly called twice!\n");
800 
802  Irp->IoStatus.Information = Length;
803  }
804 
805  if (Status == STATUS_PENDING)
806  {
810  }
811  else
812  {
813  Irp->IoStatus.Status = Status;
815  }
816 
818 
819  return Status;
820 }
#define MDL_IO_PAGE_READ
Definition: mmtypes.h:24
#define TRUE
Definition: types.h:120
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
_In_ PIRP Irp
Definition: csq.h:116
#define ok_eq_pointer(value, expected)
LONG NTSTATUS
Definition: precomp.h:26
static PFILE_OBJECT TestFileObject
Definition: CcPinRead_drv.c:31
static PDEVICE_OBJECT TestDeviceObject
Definition: CcPinRead_drv.c:32
#define IRP_NOCACHE
static PVOID MapAndLockUserBuffer(_In_ _Out_ PIRP Irp, _In_ ULONG BufferLength)
#define PAGED_CODE()
Definition: video.h:57
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define ok_bool_false(value, desc)
Definition: kmt_test.h:257
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
smooth NULL
Definition: ftsmooth.c:416
#define MDL_SOURCE_IS_NONPAGED_POOL
Definition: mmtypes.h:20
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
#define MDL_PAGES_LOCKED
Definition: mmtypes.h:19
#define STATUS_PENDING
Definition: ntstatus.h:82
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#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
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
#define ok(value,...)
Definition: atltest.h:57
unsigned int * PULONG
Definition: retypes.h:1
#define IRP_PAGING_IO
#define IRP_MJ_READ
Definition: rdpdr.c:46
static ULONG TestTestId
Definition: CcPinRead_drv.c:30
static BOOLEAN TestWriteCalled
Definition: CcPinRead_drv.c:35
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:566
#define ULONG_PTR
Definition: config.h:101
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
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

◆ TestMessageHandler()

static NTSTATUS TestMessageHandler ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ ULONG  ControlCode,
_In_opt_ PVOID Buffer  ,
_In_ SIZE_T  InLength,
_Inout_ PSIZE_T  OutLength 
)
static

Definition at line 676 of file CcPinRead_drv.c.

682 {
684 
686 
687  switch (ControlCode)
688  {
689  case IOCTL_START_TEST:
690  ok_eq_ulong((ULONG)InLength, sizeof(ULONG));
692  break;
693 
694  case IOCTL_FINISH_TEST:
695  ok_eq_ulong((ULONG)InLength, sizeof(ULONG));
697  break;
698 
699  default:
701  break;
702  }
703 
705 
706  return Status;
707 }
#define ok_eq_ulong(value, expected)
#define IOCTL_FINISH_TEST
Definition: CcPinRead_drv.c:14
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
static VOID PerformTest(ULONG TestId, PDEVICE_OBJECT DeviceObject)
LONG NTSTATUS
Definition: precomp.h:26
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
Definition: bufpool.h:45
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
static VOID CleanupTest(ULONG TestId, PDEVICE_OBJECT DeviceObject)
unsigned int * PULONG
Definition: retypes.h:1
#define IOCTL_START_TEST
Definition: CcPinRead_drv.c:13
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2966

◆ TestUnload()

VOID TestUnload ( _In_ PDRIVER_OBJECT  DriverObject)

Definition at line 95 of file CcPinRead_drv.c.

97 {
98  PAGED_CODE();
99 }
#define PAGED_CODE()
Definition: video.h:57

Variable Documentation

◆ Callbacks

CACHE_MANAGER_CALLBACKS Callbacks
static
Initial value:
= {
}
BOOLEAN NTAPI AcquireForLazyWrite(_In_ PVOID Context, _In_ BOOLEAN Wait)
BOOLEAN NTAPI AcquireForReadAhead(_In_ PVOID Context, _In_ BOOLEAN Wait)
VOID NTAPI ReleaseFromLazyWrite(_In_ PVOID Context)
VOID NTAPI ReleaseFromReadAhead(_In_ PVOID Context)

Definition at line 135 of file CcPinRead_drv.c.

Referenced by PerformTest().

◆ FileSizes

CC_FILE_SIZES FileSizes
static
Initial value:
= {
}
#define RTL_CONSTANT_LARGE_INTEGER(quad_part)
Definition: rtltypes.h:414
int64_t LONGLONG
Definition: typedefs.h:66

Definition at line 142 of file CcPinRead_drv.c.

Referenced by PerformTest().

◆ Memory

ULONGLONG Memory = 0
static

Definition at line 36 of file CcPinRead_drv.c.

Referenced by PerformTest(), and TestEntry().

◆ SmallFileSizes

CC_FILE_SIZES SmallFileSizes
static
Initial value:
= {
}
#define RTL_CONSTANT_LARGE_INTEGER(quad_part)
Definition: rtltypes.h:414
int64_t LONGLONG
Definition: typedefs.h:66

Definition at line 148 of file CcPinRead_drv.c.

Referenced by PerformTest().

◆ TestDeviceObject

PDEVICE_OBJECT TestDeviceObject
static

Definition at line 32 of file CcPinRead_drv.c.

Referenced by CleanupTest(), PerformTest(), and TestIrpHandler().

◆ TestFileObject

PFILE_OBJECT TestFileObject
static

◆ TestIrpHandler

KMT_IRP_HANDLER TestIrpHandler
static

Definition at line 33 of file CcPinRead_drv.c.

Referenced by TestEntry().

◆ TestMessageHandler

KMT_MESSAGE_HANDLER TestMessageHandler
static

Definition at line 34 of file CcPinRead_drv.c.

Referenced by TestEntry().

◆ TestTestId

ULONG TestTestId = -1
static

◆ TestWriteCalled

BOOLEAN TestWriteCalled = FALSE
static

Definition at line 35 of file CcPinRead_drv.c.

Referenced by CleanupTest(), and TestIrpHandler().

◆ TS

BOOLEAN TS = FALSE
static

Definition at line 37 of file CcPinRead_drv.c.

Referenced by PerformTest(), and TestEntry().