reactos/dll/win32/kernel32/kernel32_vista/GetFileInformationByHandleEx.c
2020-09-25 09:45:54 +02:00

70 lines
2 KiB
C

#include "k32_vista.h"
#include <ndk/rtlfuncs.h>
#include <ndk/iofuncs.h>
/* Taken from Wine kernel32/file.c */
/***********************************************************************
* 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 FileStreamInfo:
case FileCompressionInfo:
case FileAttributeTagInfo:
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 FileBasicInfo:
status = NtQueryInformationFile( handle, &io, info, size, FileBasicInformation );
break;
case FileStandardInfo:
status = NtQueryInformationFile( handle, &io, info, size, FileStandardInformation );
break;
case FileNameInfo:
status = NtQueryInformationFile( handle, &io, info, size, FileNameInformation );
break;
case FileIdBothDirectoryRestartInfo:
case FileIdBothDirectoryInfo:
status = NtQueryDirectoryFile( handle, NULL, NULL, NULL, &io, info, size,
FileIdBothDirectoryInformation, FALSE, NULL,
(class == FileIdBothDirectoryRestartInfo) );
break;
case FileRenameInfo:
case FileDispositionInfo:
case FileAllocationInfo:
case FileIoPriorityHintInfo:
case FileEndOfFileInfo:
default:
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
if (status != STATUS_SUCCESS)
{
SetLastError( RtlNtStatusToDosError( status ) );
return FALSE;
}
return TRUE;
}