Module: wine Branch: master Commit: bdef5c550894366f471d703e143da6332ede6c4a URL: http://source.winehq.org/git/wine.git/?a=commit;h=bdef5c550894366f471d703e14...
Author: Sebastian Lackner sebastian@fds-team.de Date: Wed Jun 10 07:47:51 2015 +0200
ntdll/tests: Add tests for info struct size for FileDispositionInformation.
---
dlls/ntdll/tests/file.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 2df0edc..86a4516 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -1460,9 +1460,26 @@ static void test_file_disposition_information(void) IO_STATUS_BLOCK io; FILE_DISPOSITION_INFORMATION fdi; BOOL fileDeleted; + DWORD fdi2;
GetTempPathA( MAX_PATH, tmp_path );
+ /* tests for info struct size */ + GetTempFileNameA( tmp_path, "dis", 0, buffer ); + handle = CreateFileA( buffer, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0 ); + ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" ); + res = pNtSetInformationFile( handle, &io, &fdi, 0, FileDispositionInformation ); + todo_wine + ok( res == STATUS_INFO_LENGTH_MISMATCH, "expected STATUS_INFO_LENGTH_MISMATCH, got %x\n", res ); + fdi2 = 0x100; + res = pNtSetInformationFile( handle, &io, &fdi2, sizeof(fdi2), FileDispositionInformation ); + todo_wine + ok( res == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %x\n", res ); + CloseHandle( handle ); + fileDeleted = GetFileAttributesA( buffer ) == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND; + ok( !fileDeleted, "File shouldn't have been deleted\n" ); + DeleteFileA( buffer ); + /* cannot set disposition on file not opened with delete access */ GetTempFileNameA( tmp_path, "dis", 0, buffer ); handle = CreateFileA(buffer, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);