Skip to content

Latest commit

 

History

History
177 lines (138 loc) · 4.77 KB

nf-fileapi-getfileinformationbyhandle.md

File metadata and controls

177 lines (138 loc) · 4.77 KB
UIDtitledescriptionhelpviewer_keywordsold-locationtech.rootms.assetidms.datems.keywordsreq.headerreq.include-headerreq.target-typereq.target-min-winverclntreq.target-min-winversvrreq.kmdf-verreq.umdf-verreq.ddi-compliancereq.unicode-ansireq.idlreq.max-supportreq.namespacereq.assemblyreq.type-libraryreq.libreq.dllreq.irqltargetosreq.typenamesreq.redistms.customf1_keywordsdev_langstopic_typeapi_typeapi_locationapi_name
NF:fileapi.GetFileInformationByHandle
GetFileInformationByHandle function (fileapi.h)
Retrieves file information for the specified file. (GetFileInformationByHandle)
GetFileInformationByHandle
GetFileInformationByHandle function [Files]
_win32_getfileinformationbyhandle
base.getfileinformationbyhandle
fileapi/GetFileInformationByHandle
fs.getfileinformationbyhandle
winbase/GetFileInformationByHandle
fs\getfileinformationbyhandle.htm
fs
d026ee3a-c165-42a2-a4e1-efccdafbefc5
12/05/2018
GetFileInformationByHandle, GetFileInformationByHandle function [Files], _win32_getfileinformationbyhandle, base.getfileinformationbyhandle, fileapi/GetFileInformationByHandle, fs.getfileinformationbyhandle, winbase/GetFileInformationByHandle
fileapi.h
Windows.h
Windows
Windows XP [desktop apps only]
Windows Server 2003 [desktop apps only]
Kernel32.lib
Kernel32.dll
Windows
19H1
GetFileInformationByHandle
fileapi/GetFileInformationByHandle
c++
APIRef
kbSyntax
DllExport
Kernel32.dll
API-MS-Win-Core-File-l1-1-0.dll
KernelBase.dll
API-MS-Win-Core-File-l1-2-0.dll
API-MS-Win-Core-File-l1-2-1.dll
API-MS-Win-Core-File-l1-2-2.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
MinKernelBase.dll
GetFileInformationByHandle

GetFileInformationByHandle function

-description

Retrieves file information for the specified file.

For a more advanced version of this function, see GetFileInformationByHandleEx.

To set file information using a file handle, see SetFileInformationByHandle.

-parameters

-param hFile [in]

A handle to the file that contains the information to be retrieved.

This handle should not be a pipe handle.

-param lpFileInformation [out]

A pointer to a BY_HANDLE_FILE_INFORMATION structure that receives the file information.

-returns

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

Depending on the underlying network features of the operating system and the type of server connected to, the GetFileInformationByHandle function may fail, return partial information, or full information for the given file.

You can compare the VolumeSerialNumber and FileIndex members returned in the BY_HANDLE_FILE_INFORMATION structure to determine if two paths map to the same target; for example, you can compare two file paths and determine if they map to the same directory.

IIn Windows 8 and Windows Server 2012, this function is supported by the following technologies.

TechnologySupported
Server Message Block (SMB) 3.0 protocol Yes
SMB 3.0 Transparent Failover (TFO) Yes
SMB 3.0 with Scale-out File Shares (SO) Yes
Cluster Shared Volume File System (CsvFS) Yes
Resilient File System (ReFS) Yes
 

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.

-see-also

File Management Functions

GetFileInformationByHandleEx

SetFileInformationByHandle

close