From: "Vincas Miliƫnas" Subject: [PATCH 1/6] include: Added definitions used by GetFileInformationByHandleEx for FileIdBothDirectoryInfo. (try 2) Message-Id: <5075A44C.1060306@gmail.com> Date: Wed, 10 Oct 2012 19:37:32 +0300 Sorry for the previous email, forgot the try/resend game tags. Another important notice is that the FileIdBothDirectoryInfo class is implemented by using the NtQueryDirectoryFile function, which returns FILE_ID_BOTH_DIR_INFORMATION struct, while GetFileInformationByHandleEx is meant to return FILE_ID_BOTH_DIR_INFO. The difference between FILE_ID_BOTH_DIR_INFO and FILE_ID_BOTH_DIR_INFORMATION structs is that the latter uses DWORDs, while the former uses ULONGs. DWORD and ULONG are defined as unsigned long both in WINE and windows, thus the two structures are binary compatible, their sizes are 4 bytes both in 32bit and 64bit compiled code. Changelog: [PATCH 1/6] include: Added definitions used by GetFileInformationByHandleEx for FileIdBothDirectoryInfo. [PATCH 4/6] include: Added definitions used by OpenFileById. * Removed unused definitions and split it into two patches. * Renamed DUMMYUNIONNAME to u. [PATCH 2/6] kernel32/tests: Added tests of FileIdBothDirectoryInfo for GetFileInformationByHandleEx. * No changes. [PATCH 3/6] kernel32: Added implementation of FileIdBothDirectoryInfo for GetFileInformationByHandleEx. * No changes. [PATCH 5/6] kernel32/tests: Added tests for OpenFileById. * Fixed an error to identify the temp file by its name rather then to expect it to be the first non-directory entry returned. * Fixed an error where the handle returned by OpenFileById wasn't used to read the contents of the temp file. [PATCH 6/6] kernel32: Added implementation for OpenFileById. * Removed an unnecessary result handle check after NtCreateFile returned success. * Removed an unnecessary else statement. * Removed unnecessary curly braces. --- include/winbase.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/include/winbase.h b/include/winbase.h index c1e62a3..2e97048 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -740,6 +740,49 @@ typedef struct _BY_HANDLE_FILE_INFORMATION DWORD nFileIndexLow; } BY_HANDLE_FILE_INFORMATION, *PBY_HANDLE_FILE_INFORMATION, *LPBY_HANDLE_FILE_INFORMATION ; +typedef enum _FILE_INFO_BY_HANDLE_CLASS { + FileBasicInfo, + FileStandardInfo, + FileNameInfo, + FileRenameInfo, + FileDispositionInfo, + FileAllocationInfo, + FileEndOfFileInfo, + FileStreamInfo, + FileCompressionInfo, + FileAttributeTagInfo, + FileIdBothDirectoryInfo, + FileIdBothDirectoryRestartInfo, + FileIoPriorityHintInfo, + FileRemoteProtocolInfo, + FileFullDirectoryInfo, + FileFullDirectoryRestartInfo, + FileStorageInfo, + FileAlignmentInfo, + FileIdInfo, + FileIdExtdDirectoryInfo, + FileIdExtdDirectoryRestartInfo, + MaximumFileInfoByHandlesClass +} FILE_INFO_BY_HANDLE_CLASS, *PFILE_INFO_BY_HANDLE_CLASS; + +typedef struct _FILE_ID_BOTH_DIR_INFO { + DWORD NextEntryOffset; + DWORD FileIndex; + LARGE_INTEGER CreationTime; + LARGE_INTEGER LastAccessTime; + LARGE_INTEGER LastWriteTime; + LARGE_INTEGER ChangeTime; + LARGE_INTEGER EndOfFile; + LARGE_INTEGER AllocationSize; + DWORD FileAttributes; + DWORD FileNameLength; + DWORD EaSize; + CCHAR ShortNameLength; + WCHAR ShortName[12]; + LARGE_INTEGER FileId; + WCHAR FileName[1]; +} FILE_ID_BOTH_DIR_INFO, *PFILE_ID_BOTH_DIR_INFO; + #define PIPE_ACCESS_INBOUND 1 #define PIPE_ACCESS_OUTBOUND 2 #define PIPE_ACCESS_DUPLEX 3