FSRTL_ADVANCED_FCB_HEADER Header;
SECTION_OBJECT_POINTERS SectionObjectPointers;
FAST_MUTEX HeaderMutex;
+ BOOLEAN BigFile;
} TEST_FCB, *PTEST_FCB;
static PFILE_OBJECT TestFileObject;
RtlZeroMemory(Fcb, sizeof(*Fcb));
ExInitializeFastMutex(&Fcb->HeaderMutex);
FsRtlSetupAdvancedHeader(&Fcb->Header, &Fcb->HeaderMutex);
+ Fcb->BigFile = FALSE;
if (IoStack->FileObject->FileName.Length >= 2 * sizeof(WCHAR) &&
IoStack->FileObject->FileName.Buffer[1] == 'B')
{
Fcb->Header.FileSize.QuadPart = 62;
Fcb->Header.ValidDataLength.QuadPart = 62;
}
+ else if (IoStack->FileObject->FileName.Length >= 2 * sizeof(WCHAR) &&
+ IoStack->FileObject->FileName.Buffer[1] == 'F')
+ {
+ Fcb->Header.AllocationSize.QuadPart = 4294967296;
+ Fcb->Header.FileSize.QuadPart = 4294967296;
+ Fcb->Header.ValidDataLength.QuadPart = 4294967296;
+ Fcb->BigFile = TRUE;
+ }
else
{
Fcb->Header.AllocationSize.QuadPart = 512;
if (!FlagOn(Irp->Flags, IRP_NOCACHE))
{
ok_irql(PASSIVE_LEVEL);
- ok(Offset.QuadPart % PAGE_SIZE != 0, "Offset is aligned: %I64i\n", Offset.QuadPart);
- ok(Length % PAGE_SIZE != 0, "Length is aligned: %I64i\n", Length);
+
+ /* We don't want to test alignement for big files (not the purpose of the test) */
+ if (!Fcb->BigFile)
+ {
+ ok(Offset.QuadPart % PAGE_SIZE != 0, "Offset is aligned: %I64i\n", Offset.QuadPart);
+ ok(Length % PAGE_SIZE != 0, "Length is aligned: %I64i\n", Length);
+ }
Buffer = Irp->AssociatedIrp.SystemBuffer;
ok(Buffer != NULL, "Null pointer!\n");
UNICODE_STRING BigAlignmentTest = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\BigAlignmentTest");
UNICODE_STRING SmallAlignmentTest = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\SmallAlignmentTest");
UNICODE_STRING ReallySmallAlignmentTest = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\ReallySmallAlignmentTest");
+ UNICODE_STRING FileBig = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\FileBig");
KmtLoadDriver(L"CcCopyRead", FALSE);
KmtOpenDriver();
NtClose(Handle);
+ InitializeObjectAttributes(&ObjectAttributes, &FileBig, OBJ_CASE_INSENSITIVE, NULL, NULL);
+ Status = NtOpenFile(&Handle, FILE_ALL_ACCESS, &ObjectAttributes, &IoStatusBlock, 0, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT);
+ ok_eq_hex(Status, STATUS_SUCCESS);
+
+ ByteOffset.QuadPart = 0;
+ Status = NtReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock, Buffer, 1024, &ByteOffset, NULL);
+ ok_eq_hex(Status, STATUS_SUCCESS);
+ ok_eq_hex(((USHORT *)Buffer)[0], 0xBABA);
+
+ NtClose(Handle);
+
RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
KmtCloseDriver();
KmtUnloadDriver();