91 *
Flags = TESTENTRY_NO_EXCLUSIVE_DEVICE |
92 TESTENTRY_BUFFERED_IO_DEVICE |
93 TESTENTRY_NO_READONLY_DEVICE;
205 DPRINT(
"IRP %x/%x\n", IoStack->MajorFunction, IoStack->MinorFunction);
214 Irp->IoStatus.Information = 0;
218 ULONG RequestedDisposition = ((IoStack->Parameters.Create.Options >> 24) & 0xff);
219 ok(RequestedDisposition ==
FILE_CREATE || RequestedDisposition ==
FILE_OPEN,
"Invalid disposition: %lu\n", RequestedDisposition);
221 if (IoStack->FileObject->FileName.Length >= 2 *
sizeof(
WCHAR))
229 FsRtlSetupAdvancedHeader(&
Fcb->
Header, &
Fcb->HeaderMutex);
236 Fcb->
Header.ValidDataLength.QuadPart = 0;
240 Fcb->
Header.AllocationSize.QuadPart = 512;
242 Fcb->
Header.ValidDataLength.QuadPart = 512;
246 DPRINT1(
"File: %wZ\n", &IoStack->FileObject->FileName);
248 IoStack->FileObject->FsContext =
Fcb;
254 if (IoStack->FileObject->FileName.Length == 0 ||
274 Offset = IoStack->Parameters.Read.ByteOffset;
275 Length = IoStack->Parameters.Read.Length;
293 Buffer =
Irp->AssociatedIrp.SystemBuffer;
298 if (IoStack->FileObject->PrivateCacheMap ==
NULL)
321 ok(
Irp->AssociatedIrp.SystemBuffer ==
NULL,
"A SystemBuffer was allocated!\n");
333 IoStack->FileObject->CurrentByteOffset.QuadPart =
Offset.QuadPart +
Length;
343 Offset = IoStack->Parameters.Write.ByteOffset;
344 Length = IoStack->Parameters.Write.Length;
358 Buffer =
Irp->AssociatedIrp.SystemBuffer;
363 if (IoStack->FileObject->PrivateCacheMap ==
NULL)
387 ok(
Mdl !=
NULL,
"Null pointer for MDL!\n");
416 if (IoStack->FileObject->SectionObjectPointer !=
NULL)
420 if (IoStack->FileObject->SectionObjectPointer->DataSectionObject)
431 IoStack->FileObject->FsContext =
NULL;
453 ok(StandardInfo !=
NULL,
"Null pointer!\n");
492 ok(EOFInfo !=
NULL,
"Null pointer!\n");
494 ok_bool_false(IoStack->Parameters.SetFile.AdvanceOnly,
"AdvanceOnly set!\n");
497 if (
Fcb->
Header.AllocationSize.QuadPart != 0)
VOID NTAPI ReleaseFromReadAhead(_In_ PVOID Context)
static PDEVICE_OBJECT TestDeviceObject
static PFILE_OBJECT TestFileObject
static UNICODE_STRING InitOnCreate
static FAST_IO_DISPATCH TestFastIoDispatch
struct _TEST_FCB TEST_FCB
static BOOLEAN NTAPI FastIoQueryStandardInfo(_In_ PFILE_OBJECT FileObject, _In_ BOOLEAN Wait, _Out_ PFILE_STANDARD_INFORMATION Buffer, _Out_ PIO_STATUS_BLOCK IoStatus, _In_ PDEVICE_OBJECT DeviceObject)
static UNICODE_STRING InitOnRW
BOOLEAN NTAPI AcquireForReadAhead(_In_ PVOID Context, _In_ BOOLEAN Wait)
struct _TEST_FCB * PTEST_FCB
VOID TestUnload(_In_ PDRIVER_OBJECT DriverObject)
static UNICODE_STRING InvalidInit
static BOOLEAN NTAPI FastIoWrite(_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)
static PVOID MapAndLockUserBuffer(_In_ _Out_ PIRP Irp, _In_ ULONG BufferLength)
static CACHE_MANAGER_CALLBACKS Callbacks
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)
VOID NTAPI ReleaseFromLazyWrite(_In_ PVOID Context)
NTSTATUS TestEntry(_In_ PDRIVER_OBJECT DriverObject, _In_ PCUNICODE_STRING RegistryPath, _Out_ PCWSTR *DeviceName, _Inout_ INT *Flags)
BOOLEAN NTAPI AcquireForLazyWrite(_In_ PVOID Context, _In_ BOOLEAN Wait)
static KMT_IRP_HANDLER TestIrpHandler
#define ok_eq_pointer(value, expected)
#define ok_eq_ulong(value, expected)
#define ok_bool_false(value, desc)
#define ok_bool_true(value, desc)
VOID NTAPI CcFlushCache(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, OUT OPTIONAL PIO_STATUS_BLOCK IoStatus)
#define CcIsFileCached(FO)
_In_ PFCB _In_ LONGLONG FileOffset
#define STATUS_NOT_SUPPORTED
#define STATUS_NOT_IMPLEMENTED
#define NT_SUCCESS(StatCode)
#define ExAllocatePoolWithTag(hernya, size, tag)
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
IN PVCB IN VBO IN ULONG OUT PBCB OUT PVOID IN BOOLEAN IN BOOLEAN Zero
@ FileEndOfFileInformation
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)
BOOLEAN NTAPI CcPurgeCacheSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN UninitializeCacheMaps)
#define EXCEPTION_EXECUTE_HANDLER
#define RtlFillMemory(Dest, Length, Fill)
NTSTATUS KmtRegisterIrpHandler(IN UCHAR MajorFunction, IN PDEVICE_OBJECT DeviceObject OPTIONAL, IN PKMT_IRP_HANDLER IrpHandler)
VOID NTAPI MmProbeAndLockPages(IN PMDL Mdl, IN KPROCESSOR_MODE AccessMode, IN LOCK_OPERATION Operation)
#define ExFreePoolWithTag(_P, _T)
#define FILE_STANDARD_INFORMATION
__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 CcCopyWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN Wait, IN PVOID Buffer)
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)
#define IoCompleteRequest
#define FileStandardInformation
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define _SEH2_YIELD(__stmt)
#define IRP_MJ_SET_INFORMATION
#define IRP_MJ_QUERY_INFORMATION
#define STATUS_END_OF_FILE
#define STATUS_BUFFER_OVERFLOW
PFAST_IO_QUERY_STANDARD_INFO FastIoQueryStandardInfo
PFAST_IO_WRITE FastIoWrite
SECTION_OBJECT_POINTERS SectionObjectPointers
FSRTL_ADVANCED_FCB_HEADER Header
SECTION_OBJECT_POINTERS SectionObjectPointers
FSRTL_ADVANCED_FCB_HEADER Header
#define RTL_CONSTANT_STRING(s)
#define RtlZeroMemory(Destination, Length)
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_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
_Must_inspect_result_ _In_ ULONG Flags
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
#define MDL_SOURCE_IS_NONPAGED_POOL