Skip to main content
GetFileAttributesExFromApp function

Retrieves attributes for a specified file or directory. The behavior of this function is identical to GetFileAttributesEx, except that this function adheres to the Universal Windows Platform app security model.


BOOL WINAPI GetFileAttributesExFromApp(
  _In_  LPCWSTR                lpFileName,
  _Out_ LPVOID                 lpFileInformation


lpFileName [in]

The name of the file or directory.

In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function (GetFileAttributesExFromAppW), and prepend "\\?\" to the path. For more information, see Naming a File.

For the unicode version of this function (GetFileAttributesExFromAppW), you can opt-in to remove the MAX_PATH character limitation without prepending "\\?\". See the "Maximum Path Limitation" section of Naming Files, Paths, and Namespaces for details.

fInfoLevelId [in]

A class of attribute information to retrieve.

This parameter can be the following value from the GET_FILEEX_INFO_LEVELS enumeration.


The lpFileInformation parameter is a WIN32_FILE_ATTRIBUTE_DATA structure.


lpFileInformation [out]

A pointer to a buffer that receives the attribute information.

The type of attribute information that is stored into this buffer is determined by the value of fInfoLevelId.

Return value

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is zero (0). To get extended error information, call GetLastError.


Minimum supported client

Windows 10, version 1803 [desktop apps only]

Minimum supported server

Windows Server [desktop apps only]


WinBase.h (include Windows.h)





Unicode and ANSI names

GetFileAttributesFromAppW (Unicode) and GetFileAttributesFromAppA (ANSI)