GetFileVersionInfoSizeW function (winver.h)

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

Syntax

DWORD GetFileVersionInfoSizeW(
  [in]            LPCWSTR lptstrFilename,
  [out, optional] LPDWORD lpdwHandle
);

Parameters

[in] lptstrFilename

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

A pointer to a variable that the function sets to zero.

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 GetFileVersionInfoSize function before calling the GetFileVersionInfo function. The size returned by GetFileVersionInfoSize indicates the buffer size required for the version information returned by GetFileVersionInfo.

Note

The winver.h header defines GetFileVersionInfoSize as an alias that 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 is 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 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [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

GetFileVersionInfo

Reference

VS_VERSIONINFO

VerQueryValue

Version Information