mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[NTDLL_APITEST] Add test for FileEndOfFileInformation
This commit is contained in:
parent
35dc2f2410
commit
bebf99aaf1
1 changed files with 32 additions and 0 deletions
|
@ -20,4 +20,36 @@ START_TEST(NtQueryInformationFile)
|
||||||
Status = NtQueryInformationFile(NULL, NULL, NULL, 0, 0x80000000);
|
Status = NtQueryInformationFile(NULL, NULL, NULL, 0, 0x80000000);
|
||||||
ok(Status == STATUS_INVALID_INFO_CLASS ||
|
ok(Status == STATUS_INVALID_INFO_CLASS ||
|
||||||
ntv6(Status == STATUS_NOT_IMPLEMENTED), "Status = %lx\n", Status);
|
ntv6(Status == STATUS_NOT_IMPLEMENTED), "Status = %lx\n", Status);
|
||||||
|
|
||||||
|
/* Get the full path of the current executable */
|
||||||
|
CHAR Path[MAX_PATH];
|
||||||
|
DWORD Length = GetModuleFileNameA(NULL, Path, _countof(Path));
|
||||||
|
ok(Length != 0, "GetModuleFileNameA failed\n");
|
||||||
|
if (Length == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Open the file */
|
||||||
|
HANDLE hFile = CreateFileA(Path,
|
||||||
|
GENERIC_READ,
|
||||||
|
FILE_SHARE_READ,
|
||||||
|
NULL,
|
||||||
|
OPEN_EXISTING,
|
||||||
|
FILE_ATTRIBUTE_NORMAL,
|
||||||
|
NULL);
|
||||||
|
ok(hFile != INVALID_HANDLE_VALUE, "CreateFileA failed\n");
|
||||||
|
if (hFile == INVALID_HANDLE_VALUE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Query FileEndOfFileInformation */
|
||||||
|
FILE_END_OF_FILE_INFORMATION EndOfFileInformation;
|
||||||
|
EndOfFileInformation.EndOfFile.QuadPart = 0xdeaddead;
|
||||||
|
Status = NtQueryInformationFile(hFile,
|
||||||
|
NULL,
|
||||||
|
&EndOfFileInformation,
|
||||||
|
sizeof(EndOfFileInformation),
|
||||||
|
FileEndOfFileInformation);
|
||||||
|
ok_hex(Status, STATUS_INVALID_INFO_CLASS);
|
||||||
|
ok(EndOfFileInformation.EndOfFile.QuadPart == 0xdeaddead, "EndOfFile is modified\n");
|
||||||
|
|
||||||
|
CloseHandle(hFile);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue