GetFileInformationByHandleEx Function
Retrieves file information for the specified file.
BOOL WINAPI GetFileInformationByHandleEx(
__in HANDLE hFile,
__in FILE_INFO_BY_HANDLE_CLASS FileInformationClass,
__out LPVOID lpFileInformation,
__in DWORD dwBufferSize
);
Parameters
hFile
A handle to the file.
This handle should not be a pipe handle. The GetFileInformationByHandleEx function does not work with pipe handles.
FileInformationClass
The type of information to be returned to the calling application. For a list of values, see FILE_INFO_BY_HANDLE_CLASS.
lpFileInformation
A pointer to the buffer that receives the requested file information. The structure that is returned corresponds to the class that is specified by FileInformationClass.
FileInformationClass FileInformation structure returned
FileBasicInfo FILE_BASIC_INFO
FileStandardInfo FILE_STANDARD_INFO
FileNameInfo FILE_NAME_INFO
FileStreamInfo FILE_STREAM_INFO
FileCompressionInfo FILE_COMPRESSION_INFO
FileAttributeTagInfo FILE_ATTRIBUTE_TAG_INFO
FileIdBothDirectoryInfo FILE_ID_BOTH_DIR_INFO
FileIdBothDirectoryRestartInfo FILE_ID_BOTH_DIR_INFO
dwBufferSize
The size of the lpFileInformation buffer, in bytes.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
If FileInformationClass is FileStreamInfo and the calls succeed but no streams are returned, the error that is returned by GetLastError is ERROR_HANDLE_EOF.
Certain file information classes behave slightly differently on different operating system releases. These classes are supported by the underlying drivers, and any information they return is subject to change between operating system releases.
This function is declared in Fileextd.h and implemented in Fileextd.lib; both are available for download at MSDN on the Win32 FileID API Library page.
Transacted Operations
If there is a transaction bound to the thread at the time of the call, then the function returns the compressed file size of the isolated file view.
Requirements
这个函数貌似可以返回。。 只是我感觉你的SDK 里面没有的可能性极大。