mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 07:26:47 +00:00
[KMTESTS:CC]
New test case which is matching the MS FastFAT CcCopyRead (minus the offset) and shows clearly the issue in our Cc. It also shows that my hack is utterly broken :-). CORE-11003 CORE-11819 svn path=/trunk/; revision=72182
This commit is contained in:
parent
831a53f80f
commit
f27ecf0960
|
@ -195,6 +195,13 @@ TestIrpHandler(
|
|||
Fcb->Header.FileSize.QuadPart = 1004;
|
||||
Fcb->Header.ValidDataLength.QuadPart = 1004;
|
||||
}
|
||||
else if (IoStack->FileObject->FileName.Length >= 2 * sizeof(WCHAR) &&
|
||||
IoStack->FileObject->FileName.Buffer[1] == 'R')
|
||||
{
|
||||
Fcb->Header.AllocationSize.QuadPart = 62;
|
||||
Fcb->Header.FileSize.QuadPart = 62;
|
||||
Fcb->Header.ValidDataLength.QuadPart = 62;
|
||||
}
|
||||
else
|
||||
{
|
||||
Fcb->Header.AllocationSize.QuadPart = 512;
|
||||
|
@ -262,7 +269,7 @@ TestIrpHandler(
|
|||
}
|
||||
else
|
||||
{
|
||||
ok(Offset.QuadPart % PAGE_SIZE == 0, "Offset is not aligned: %I64i\n", Offset.QuadPart);
|
||||
ok((Offset.QuadPart % PAGE_SIZE == 0 || Offset.QuadPart == 0), "Offset is not aligned: %I64i\n", Offset.QuadPart);
|
||||
ok(Length % PAGE_SIZE == 0, "Length is not aligned: %I64i\n", Length);
|
||||
|
||||
ok(Irp->AssociatedIrp.SystemBuffer == NULL, "A SystemBuffer was allocated!\n");
|
||||
|
|
|
@ -17,6 +17,7 @@ START_TEST(CcCopyRead)
|
|||
PVOID Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, 1024);
|
||||
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");
|
||||
|
||||
KmtLoadDriver(L"CcCopyRead", FALSE);
|
||||
KmtOpenDriver();
|
||||
|
@ -77,6 +78,17 @@ START_TEST(CcCopyRead)
|
|||
|
||||
NtClose(Handle);
|
||||
|
||||
InitializeObjectAttributes(&ObjectAttributes, &ReallySmallAlignmentTest, 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 = 1;
|
||||
Status = NtReadFile(Handle, NULL, NULL, NULL, &IoStatusBlock, Buffer, 61, &ByteOffset, NULL);
|
||||
ok_eq_hex(Status, STATUS_SUCCESS);
|
||||
ok_eq_hex(((USHORT *)Buffer)[0], 0xBABA);
|
||||
|
||||
NtClose(Handle);
|
||||
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
|
||||
KmtCloseDriver();
|
||||
KmtUnloadDriver();
|
||||
|
|
Loading…
Reference in a new issue