Export (0) Print
Expand All
2 out of 4 rated this helpful - Rate this topic

GetFileVersionInfoEx function

Retrieves version information for the specified file.

Syntax


BOOL WINAPI GetFileVersionInfoEx(
  _In_        DWORD dwFlags,
  _In_        LPCTSTR lptstrFilename,
  _Reserved_  DWORD dwHandle,
  _In_        DWORD dwLen,
  _Out_       LPVOID lpData
);

Parameters

dwFlags [in]

Type: DWORD

Controls the MUI DLLs (if any) from which the version resource is extracted. The value of this flag must match the flags passed to the corresponding GetFileVersionInfoSizeEx call, which was used to determine the buffer size that is passed in the dwLen parameter. Zero or more of the following flags.

ValueMeaning
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
0x02

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.

FILE_VER_GET_PREFETCHED
0x04

Indicates a preference for version.dll to attempt to preload the image outside of the loader lock to avoid contention. This flag does not change the behavior or semantics of the function.

 

lptstrFilename [in]

Type: LPCTSTR

The name of the file. If a full path is not specified, the function uses the search sequence specified by the LoadLibrary function.

dwHandle

Type: DWORD

This parameter is ignored.

dwLen [in]

Type: DWORD

The size, in bytes, of the buffer pointed to by the lpData parameter.

Call the GetFileVersionInfoSizeEx function first to determine the size, in bytes, of a file's version information. The dwLen parameter should be equal to or greater than that value.

If the buffer pointed to by lpData is not large enough, the function truncates the file's version information to the size of the buffer.

lpData [out]

Type: LPVOID

When this function returns, contains a pointer to a buffer that contains the file-version information.

You can use this value in a subsequent call to the VerQueryValue function to retrieve data from the buffer.

Return value

Type: BOOL

If the function succeeds, the return value is nonzero.

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. To retrieve information from the file-version information buffer, use the VerQueryValue function.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Winver.h (include Windows.h)

Library

Version.lib

DLL

Version.dll

Unicode and ANSI names

GetFileVersionInfoExW (Unicode) and GetFileVersionInfoExA (ANSI)

See also

Reference
GetFileVersionInfo
GetFileVersionInfoSizeEx
VerQueryValue
VS_VERSIONINFO
Conceptual
Version Information

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.