Professional Documents
Culture Documents
GetFileInformationByHandleEx function
(winbase.h)
Article • 07/28/20222 minutes to read
For a more basic version of this function for desktop apps, see
GetFileInformationByHandle.
Syntax
C++
BOOL GetFileInformationByHandleEx(
);
Parameters
[in] hFile
[in] FileInformationClass
A FILE_INFO_BY_HANDLE_CLASS enumeration
value that specifies the type of
information to be retrieved.
[out] 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. For a table of
valid structure types, see the Remarks section.
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getfileinformationbyhandleex 1/4
17/10/22, 15:49 GetFileInformationByHandleEx function (winbase.h) - Win32 apps | Microsoft Learn
[in] dwBufferSize
Return value
If the function succeeds, the return value is nonzero and file information data is
contained in the buffer
pointed to by the lpFileInformation parameter.
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.
The following table shows the valid file information class types and their corresponding
data structure types
for use with this function.
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getfileinformationbyhandleex 2/4
17/10/22, 15:49 GetFileInformationByHandleEx function (winbase.h) - Win32 apps | Microsoft Learn
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. For more information, see
About Transactional NTFS.
Technology Supported
Requirements
DLL Kernel32.dll
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getfileinformationbyhandleex 3/4
17/10/22, 15:49 GetFileInformationByHandleEx function (winbase.h) - Win32 apps | Microsoft Learn
See also
FILE_INFO_BY_HANDLE_CLASS
SetFileInformationByHandle
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getfileinformationbyhandleex 4/4