13#define IOCTL_START_TEST 1
14#define IOCTL_FINISH_TEST 2
48 *
Flags = TESTENTRY_NO_EXCLUSIVE_DEVICE |
49 TESTENTRY_BUFFERED_IO_DEVICE |
50 TESTENTRY_NO_READONLY_DEVICE;
173 FsRtlSetupAdvancedHeader(&
Fcb->
Header, &
Fcb->HeaderMutex);
181 if ((TestId > 1 && TestId < 4) || TestId >= 5)
192 trace(
"Starting test: %d\n", TestId);
194 if (TestId == 0 || TestId == 2)
201 if (!
skip(Ret ==
TRUE,
"CcMapData failed\n"))
219 if (!
skip(Ret ==
TRUE,
"CcMapData failed\n"))
226 else if (TestId == 1 || TestId == 3)
259 else if (TestId == 4 || TestId == 5)
269 if (!
skip(Ret ==
TRUE,
"CcPinRead failed\n"))
307 if (!
skip(Ret ==
TRUE,
"CcMapData failed\n"))
318 else if (TestId == 6)
325 if (!
skip(Ret ==
TRUE,
"CcMapData failed\n"))
428 DPRINT(
"IRP %x/%x\n", IoStack->MajorFunction, IoStack->MinorFunction);
435 Irp->IoStatus.Information = 0;
445 Offset = IoStack->Parameters.Read.ByteOffset;
446 Length = IoStack->Parameters.Read.Length;
459 ok(
Irp->AssociatedIrp.SystemBuffer ==
NULL,
"A SystemBuffer was allocated!\n");
494 ok(
Mdl !=
NULL,
"Null pointer for MDL!\n");
509 Offset = IoStack->Parameters.Write.ByteOffset;
510 Length = IoStack->Parameters.Write.Length;
531 ok(
Mdl !=
NULL,
"Null pointer for MDL!\n");
VOID NTAPI ReleaseFromReadAhead(_In_ PVOID Context)
static PDEVICE_OBJECT TestDeviceObject
static PFILE_OBJECT TestFileObject
#define IOCTL_FINISH_TEST
static VOID PerformTest(ULONG TestId, PDEVICE_OBJECT DeviceObject)
struct _TEST_FCB TEST_FCB
BOOLEAN NTAPI AcquireForReadAhead(_In_ PVOID Context, _In_ BOOLEAN Wait)
static VOID CleanupTest(ULONG TestId, PDEVICE_OBJECT DeviceObject)
struct _TEST_FCB * PTEST_FCB
VOID TestUnload(_In_ PDRIVER_OBJECT DriverObject)
static BOOLEAN TestUncaching
static PVOID MapAndLockUserBuffer(_In_ _Out_ PIRP Irp, _In_ ULONG BufferLength)
static BOOLEAN TestDirtying
static BOOLEAN TestSizing
static CACHE_MANAGER_CALLBACKS Callbacks
static KMT_MESSAGE_HANDLER TestMessageHandler
VOID NTAPI ReleaseFromLazyWrite(_In_ PVOID Context)
NTSTATUS TestEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ PCUNICODE_STRING RegistryPath, _Out_ PCWSTR *DeviceName, _Inout_ INT *Flags)
static BOOLEAN TestWritten
BOOLEAN NTAPI AcquireForLazyWrite(_In_ PVOID Context, _In_ BOOLEAN Wait)
static KMT_IRP_HANDLER TestIrpHandler
static CC_FILE_SIZES NewFileSizes
#define ok_eq_pointer(value, expected)
#define ok_eq_ulong(value, expected)
#define ok_bool_false(value, desc)
#define ok_bool_true(value, desc)
LARGE_INTEGER NTAPI CcGetFlushedValidData(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN BOOLEAN CcInternalCaller)
VOID NTAPI CcSetDirtyPinnedData(IN PVOID BcbVoid, IN OPTIONAL PLARGE_INTEGER Lsn)
#define CcIsFileCached(FO)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
IN PVCB IN VBO IN ULONG OUT PBCB * Bcb
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN IN BOOLEAN Zero
#define ExAllocatePool(type, size)
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
VOID NTAPI CcSetFileSizes(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes)
VOID NTAPI CcInitializeCacheMap(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes, IN BOOLEAN PinAccess, IN PCACHE_MANAGER_CALLBACKS Callbacks, IN PVOID LazyWriteContext)
BOOLEAN NTAPI CcUninitializeCacheMap(IN PFILE_OBJECT FileObject, IN OPTIONAL PLARGE_INTEGER TruncateSize, IN OPTIONAL PCACHE_UNINITIALIZE_EVENT UninitializeEvent)
#define EXCEPTION_EXECUTE_HANDLER
#define RtlFillMemory(Dest, Length, Fill)
#define KmtEndSeh(ExpectedStatus)
NTSTATUS KmtRegisterMessageHandler(IN ULONG ControlCode OPTIONAL, IN PDEVICE_OBJECT DeviceObject OPTIONAL, IN PKMT_MESSAGE_HANDLER MessageHandler)
NTSTATUS KmtRegisterIrpHandler(IN UCHAR MajorFunction, IN PDEVICE_OBJECT DeviceObject OPTIONAL, IN PKMT_IRP_HANDLER IrpHandler)
VOID NTAPI CcSetAdditionalCacheAttributes(IN PFILE_OBJECT FileObject, IN BOOLEAN DisableReadAhead, IN BOOLEAN DisableWriteBehind)
VOID NTAPI MmProbeAndLockPages(IN PMDL Mdl, IN KPROCESSOR_MODE AccessMode, IN LOCK_OPERATION Operation)
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
#define RTL_CONSTANT_LARGE_INTEGER(quad_part)
#define UNREFERENCED_PARAMETER(P)
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
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)
PFILE_OBJECT NTAPI IoCreateStreamFileObject(IN PFILE_OBJECT FileObject, IN PDEVICE_OBJECT DeviceObject)
#define IoCompleteRequest
#define STATUS_NOT_SUPPORTED
#define STATUS_NOT_IMPLEMENTED
VOID NTAPI CcUnpinData(IN PVOID Bcb)
BOOLEAN NTAPI CcPinRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG Flags, OUT PVOID *Bcb, OUT PVOID *Buffer)
BOOLEAN NTAPI CcMapData(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN ULONG Flags, OUT PVOID *BcbResult, OUT PVOID *Buffer)
#define _SEH2_EXCEPT(...)
#define _SEH2_YIELD(__stmt)
SECTION_OBJECT_POINTERS SectionObjectPointers
FSRTL_ADVANCED_FCB_HEADER Header
SECTION_OBJECT_POINTERS SectionObjectPointers
FSRTL_ADVANCED_FCB_HEADER Header
#define RtlZeroMemory(Destination, Length)
#define STATUS_UNSUCCESSFUL
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_In_ WDFDPC _In_ BOOLEAN Wait
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
_Must_inspect_result_ _In_ ULONG Flags
#define VACB_MAPPING_GRANULARITY
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
#define MDL_SOURCE_IS_NONPAGED_POOL
#define ObDereferenceObject