kernel32: Added implementation of FileIdBothDirectoryInfo for GetFileInformationByHandleEx.
This commit is contained in:
parent
9cec60bb1e
commit
6314cf0295
|
@ -863,6 +863,59 @@ BOOL WINAPI GetFileInformationByHandle( HANDLE hFile, BY_HANDLE_FILE_INFORMATION
|
|||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetFileInformationByHandleEx (KERNEL32.@)
|
||||
*/
|
||||
BOOL WINAPI GetFileInformationByHandleEx( HANDLE handle, FILE_INFO_BY_HANDLE_CLASS class,
|
||||
LPVOID info, DWORD size )
|
||||
{
|
||||
NTSTATUS status;
|
||||
IO_STATUS_BLOCK io;
|
||||
|
||||
switch (class)
|
||||
{
|
||||
case FileBasicInfo:
|
||||
case FileStandardInfo:
|
||||
case FileNameInfo:
|
||||
case FileRenameInfo:
|
||||
case FileDispositionInfo:
|
||||
case FileAllocationInfo:
|
||||
case FileEndOfFileInfo:
|
||||
case FileStreamInfo:
|
||||
case FileCompressionInfo:
|
||||
case FileAttributeTagInfo:
|
||||
case FileIoPriorityHintInfo:
|
||||
case FileRemoteProtocolInfo:
|
||||
case FileFullDirectoryInfo:
|
||||
case FileFullDirectoryRestartInfo:
|
||||
case FileStorageInfo:
|
||||
case FileAlignmentInfo:
|
||||
case FileIdInfo:
|
||||
case FileIdExtdDirectoryInfo:
|
||||
case FileIdExtdDirectoryRestartInfo:
|
||||
FIXME( "%p, %u, %p, %u\n", handle, class, info, size );
|
||||
SetLastError( ERROR_CALL_NOT_IMPLEMENTED );
|
||||
return FALSE;
|
||||
|
||||
case FileIdBothDirectoryRestartInfo:
|
||||
case FileIdBothDirectoryInfo:
|
||||
status = NtQueryDirectoryFile( handle, NULL, NULL, NULL, &io, info, size,
|
||||
FileIdBothDirectoryInformation, FALSE, NULL,
|
||||
(class == FileIdBothDirectoryRestartInfo) );
|
||||
if (status != STATUS_SUCCESS)
|
||||
{
|
||||
SetLastError( RtlNtStatusToDosError( status ) );
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
SetLastError( ERROR_INVALID_PARAMETER );
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetFileSize (KERNEL32.@)
|
||||
*
|
||||
|
|
|
@ -533,6 +533,7 @@
|
|||
@ stdcall GetFileAttributesExW(wstr long ptr)
|
||||
@ stdcall GetFileAttributesW(wstr)
|
||||
@ stdcall GetFileInformationByHandle(long ptr)
|
||||
@ stdcall GetFileInformationByHandleEx(long long ptr long)
|
||||
@ stdcall GetFileSize(long ptr)
|
||||
@ stdcall GetFileSizeEx(long ptr)
|
||||
@ stdcall GetFileTime(long ptr ptr ptr)
|
||||
|
|
|
@ -3303,7 +3303,6 @@ static void test_GetFileInformationByHandleEx(void)
|
|||
{
|
||||
SetLastError(0xdeadbeef);
|
||||
ret = pGetFileInformationByHandleEx(directory, checks[i].handleClass, checks[i].ptr, checks[i].size);
|
||||
todo_wine
|
||||
ok(!ret && GetLastError() == checks[i].errorCode, "GetFileInformationByHandleEx: expected error %u, "
|
||||
"got %u.\n", checks[i].errorCode, GetLastError());
|
||||
}
|
||||
|
@ -3314,18 +3313,14 @@ static void test_GetFileInformationByHandleEx(void)
|
|||
ret = pGetFileInformationByHandleEx(directory, FileIdBothDirectoryInfo, buffer, sizeof(buffer));
|
||||
if (!ret && GetLastError() == ERROR_NO_MORE_FILES)
|
||||
break;
|
||||
todo_wine
|
||||
ok(ret, "GetFileInformationByHandleEx: failed to query for FileIdBothDirectoryInfo, got error %u.\n", GetLastError());
|
||||
if (!ret)
|
||||
break;
|
||||
bothDirInfo = (FILE_ID_BOTH_DIR_INFO *)buffer;
|
||||
while (TRUE)
|
||||
{
|
||||
todo_wine
|
||||
ok(bothDirInfo->FileAttributes != 0xffffffff, "GetFileInformationByHandleEx: returned invalid file attributes.\n");
|
||||
todo_wine
|
||||
ok(bothDirInfo->FileId.u.LowPart != 0xffffffff, "GetFileInformationByHandleEx: returned invalid file id.\n");
|
||||
todo_wine
|
||||
ok(bothDirInfo->FileNameLength != 0xffffffff, "GetFileInformationByHandleEx: returned invalid file name length.\n");
|
||||
if (!bothDirInfo->NextEntryOffset)
|
||||
break;
|
||||
|
|
|
@ -2042,6 +2042,7 @@ NTSTATUS WINAPI NtQueryDirectoryFile( HANDLE handle, HANDLE event,
|
|||
case FileIdBothDirectoryInformation:
|
||||
case FileIdFullDirectoryInformation:
|
||||
if (length < dir_info_size( info_class, 1 )) return io->u.Status = STATUS_INFO_LENGTH_MISMATCH;
|
||||
if (!buffer) return io->u.Status = STATUS_ACCESS_VIOLATION;
|
||||
break;
|
||||
default:
|
||||
FIXME( "Unsupported file info class %d\n", info_class );
|
||||
|
|
Loading…
Reference in New Issue