mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 18:15:58 +00:00
[KMTESTS:CC] Add tests for CcCopyRead that reproduce CORE-15067
CORE-15067
This commit is contained in:
parent
15a3ca08b0
commit
351ae6b2b4
2 changed files with 29 additions and 2 deletions
|
@ -18,6 +18,7 @@ START_TEST(CcCopyRead)
|
|||
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();
|
||||
|
@ -89,6 +90,17 @@ START_TEST(CcCopyRead)
|
|||
|
||||
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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue