Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/kernel32/file.c | 4 +++- dlls/kernel32/tests/file.c | 23 ++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index 30c8dbd1d9..bd10260acc 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -1095,7 +1095,6 @@ BOOL WINAPI SetFileInformationByHandle( HANDLE file, FILE_INFO_BY_HANDLE_CLASS c
switch (class) { - case FileBasicInfo: case FileNameInfo: case FileRenameInfo: case FileAllocationInfo: @@ -1114,6 +1113,9 @@ BOOL WINAPI SetFileInformationByHandle( HANDLE file, FILE_INFO_BY_HANDLE_CLASS c SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); return FALSE;
+ case FileBasicInfo: + status = NtSetInformationFile( file, &io, info, size, FileBasicInformation ); + break; case FileDispositionInfo: status = NtSetInformationFile( file, &io, info, size, FileDispositionInformation ); break; diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index b22ae19f2e..0c5b133260 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -4973,8 +4973,10 @@ static void test_SetFileInformationByHandle(void) FILE_COMPRESSION_INFO compressinfo; FILE_DISPOSITION_INFO dispinfo; DECLSPEC_ALIGN(8) FILE_IO_PRIORITY_HINT_INFO hintinfo; + FILE_BASIC_INFO basicinfo = { 0 }; char tempFileName[MAX_PATH]; char tempPath[MAX_PATH]; + LARGE_INTEGER atime; HANDLE file; BOOL ret;
@@ -4991,7 +4993,7 @@ static void test_SetFileInformationByHandle(void) ret = GetTempFileNameA(tempPath, "abc", 0, tempFileName); ok(ret, "GetTempFileNameA failed, got error %u.\n", GetLastError());
- file = CreateFileA(tempFileName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + file = CreateFileA(tempFileName, GENERIC_READ | FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_DELETE_ON_CLOSE, NULL); ok(file != INVALID_HANDLE_VALUE, "failed to open the temp file, error %u.\n", GetLastError());
@@ -5044,6 +5046,25 @@ static void test_SetFileInformationByHandle(void) todo_wine ok(!ret && GetLastError() == ERROR_BAD_LENGTH, "got %d, error %d\n", ret, GetLastError());
+ SetLastError(0xdeadbeef); + ret = pSetFileInformationByHandle(file, FileBasicInfo, &basicinfo, 0); +todo_wine + ok(!ret && GetLastError() == ERROR_BAD_LENGTH, "got %d, error %d\n", ret, GetLastError()); + + memset(&basicinfo, 0, sizeof(basicinfo)); + ret = pGetFileInformationByHandleEx(file, FileBasicInfo, &basicinfo, sizeof(basicinfo)); + ok(ret, "Failed to get basic info, error %d.\n", GetLastError()); + atime = basicinfo.LastAccessTime; + + basicinfo.LastAccessTime.QuadPart++; + ret = pSetFileInformationByHandle(file, FileBasicInfo, &basicinfo, sizeof(basicinfo)); + ok(ret, "Failed to set basic info, error %d.\n", GetLastError()); + + memset(&basicinfo, 0, sizeof(basicinfo)); + ret = pGetFileInformationByHandleEx(file, FileBasicInfo, &basicinfo, sizeof(basicinfo)); + ok(ret, "Failed to get basic info, error %d.\n", GetLastError()); + ok(atime.QuadPart + 1 == basicinfo.LastAccessTime.QuadPart, "Unexpected access time.\n"); + dispinfo.DeleteFile = TRUE; ret = pSetFileInformationByHandle(file, FileDispositionInfo, &dispinfo, sizeof(dispinfo)); ok(ret, "setting FileDispositionInfo failed, error %d\n", GetLastError());
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=54952
Your paranoid android.
=== debian10 (32 bit report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00438134).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (32 bit Chinese:China report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00438134).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (32 bit WoW report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00438134).
Report errors: kernel32:virtual prints too much data (91050 bytes)
=== debian10 (64 bit WoW report) ===
kernel32: Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x00438134).
Report errors: kernel32:virtual prints too much data (91050 bytes)