Commit f4b07ee8 authored by Greg Smith's avatar Greg Smith Committed by Alexandre Julliard

kernel32: Ignore FileIoPriorityHintInfo in SetFileInformationByHandle().

parent 33de7fb7
......@@ -1103,7 +1103,6 @@ BOOL WINAPI SetFileInformationByHandle( HANDLE file, FILE_INFO_BY_HANDLE_CLASS c
case FileStreamInfo:
case FileIdBothDirectoryInfo:
case FileIdBothDirectoryRestartInfo:
case FileIoPriorityHintInfo:
case FileFullDirectoryInfo:
case FileFullDirectoryRestartInfo:
case FileStorageInfo:
......@@ -1118,7 +1117,9 @@ BOOL WINAPI SetFileInformationByHandle( HANDLE file, FILE_INFO_BY_HANDLE_CLASS c
case FileDispositionInfo:
status = NtSetInformationFile( file, &io, info, size, FileDispositionInformation );
break;
case FileIoPriorityHintInfo:
status = NtSetInformationFile( file, &io, info, size, FileIoPriorityHintInformation );
break;
case FileStandardInfo:
case FileCompressionInfo:
case FileAttributeTagInfo:
......
......@@ -4914,6 +4914,7 @@ static void test_SetFileInformationByHandle(void)
FILE_STANDARD_INFO stdinfo = { {{0}},{{0}},0,FALSE,FALSE };
FILE_COMPRESSION_INFO compressinfo;
FILE_DISPOSITION_INFO dispinfo;
DECLSPEC_ALIGN(8) FILE_IO_PRIORITY_HINT_INFO hintinfo;
char tempFileName[MAX_PATH];
char tempPath[MAX_PATH];
HANDLE file;
......@@ -4950,6 +4951,28 @@ static void test_SetFileInformationByHandle(void)
ret = pSetFileInformationByHandle(file, FileAttributeTagInfo, &fileattrinfo, sizeof(fileattrinfo));
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError());
SetLastError(0xdeadbeef);
hintinfo.PriorityHint = MaximumIoPriorityHintType;
ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo));
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError());
hintinfo.PriorityHint = IoPriorityHintNormal;
ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo));
ok(ret, "setting FileIoPriorityHintInfo got %d, error %d\n", ret, GetLastError());
hintinfo.PriorityHint = IoPriorityHintVeryLow;
ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo));
ok(ret, "setting FileIoPriorityHintInfo got %d, error %d\n", ret, GetLastError());
SetLastError(0xdeadbeef);
ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo) - 1);
ok(!ret && GetLastError() == ERROR_BAD_LENGTH, "got %d, error %d\n", ret, GetLastError());
SetLastError(0xdeadbeef);
hintinfo.PriorityHint = IoPriorityHintVeryLow - 1;
ret = pSetFileInformationByHandle(file, FileIoPriorityHintInfo, &hintinfo, sizeof(hintinfo));
ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "got %d, error %d\n", ret, GetLastError());
memset(&protinfo, 0, sizeof(protinfo));
protinfo.StructureVersion = 1;
protinfo.StructureSize = sizeof(protinfo);
......
......@@ -2671,6 +2671,18 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
io->u.Status = STATUS_INFO_LENGTH_MISMATCH;
break;
case FileIoPriorityHintInformation:
if (len >= sizeof(FILE_IO_PRIORITY_HINT_INFO))
{
FILE_IO_PRIORITY_HINT_INFO *info = ptr;
if (info->PriorityHint < MaximumIoPriorityHintType)
TRACE( "ignoring FileIoPriorityHintInformation %u\n", info->PriorityHint );
else
io->u.Status = STATUS_INVALID_PARAMETER;
}
else io->u.Status = STATUS_INFO_LENGTH_MISMATCH;
break;
case FileAllInformation:
io->u.Status = STATUS_INVALID_INFO_CLASS;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment