GetFileVersionInfoSizeExA function (winver.h)

Determines whether the operating system can retrieve version information for a specified file. If version information is available, GetFileVersionInfoSizeEx returns the size, in bytes, of that information.

Syntax

DWORD GetFileVersionInfoSizeExA(
  [in]            DWORD   dwFlags,
  [in]            LPCSTR  lpwstrFilename,
  [out, optional] LPDWORD lpdwHandle
);

Parameters

[in] dwFlags

Type: DWORD

Controls which MUI DLLs (if any) from which the version resource is extracted. Zero or more of the following flags.

Value Meaning
FILE_VER_GET_LOCALISED
0x01
Loads the entire version resource (both strings and binary version information) from the corresponding MUI file, if available.
FILE_VER_GET_NEUTRAL
0x002
Loads the version resource strings from the corresponding MUI file, if available, and loads the binary version information (VS_FIXEDFILEINFO) from the corresponding language-neutral file, if available.

[in] lpwstrFilename

Type: LPCTSTR

The name of the file of interest. The function uses the search sequence specified by the LoadLibrary function.

[out, optional] lpdwHandle

Type: LPDWORD

When this function returns, contains a pointer to a variable that is set to zero because this function sets it to zero. This parameter exists for historical reasons.

Return value

Type: DWORD

If the function succeeds, the return value is the size, in bytes, of the file's version information.

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

Remarks

Call the GetFileVersionInfoSizeEx function before calling the GetFileVersionInfoEx function. The size returned by GetFileVersionInfoSizeEx indicates the buffer size required for the version information returned by GetFileVersionInfoEx.

Note

The winver.h header defines GetFileVersionInfoSizeEx as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header winver.h (include Windows.h)
Library Version.lib
DLL Api-ms-win-core-version-l1-1-0.dll

See also

Conceptual

GetFileVersionInfoEx

GetFileVersionInfoSize

Reference

VS_VERSIONINFO

VerQueryValue

Version Information