GetFileVersionInfoSize function
Applies to: desktop apps only
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 WINAPI GetFileVersionInfoSize( __in LPCTSTR lptstrFilename, __out_opt LPDWORD lpdwHandle );
Parameters
- lptstrFilename [in]
-
Type: LPCTSTR
The name of the file of interest. The function uses the search sequence specified by the LoadLibrary function.
- lpdwHandle [out, optional]
-
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.
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names | GetFileVersionInfoSizeW (Unicode) and GetFileVersionInfoSizeA (ANSI) |
See also
- Reference
- GetFileVersionInfo
- VS_VERSIONINFO
- VerQueryValue
- Conceptual
- Version Information
Send comments about this topic to Microsoft
Build date: 2/3/2012
- 3/7/2012
- barelytired
- 3/8/2012
- barelytired
c:\windows\SoftwareDistribution\Download\f0d77e49e427eb2d1efc93bd6563100109b56899
DWORD dwThisFileVersionInfoSize = GetFileVersionInfoSize(strName.GetString(), &dwZero);
dwThisFileVersionInfoSize = 1892
FileSize = 351,936 bytes
If I run the program in Release mode it returns:
Company Name: Microsoft Corporation
Internal Name: mpas-d_bd1.exe
Product Name: Microsoft Malware Protection
Product Version: 1.117.3022.0
If I run the program in Visual Studio 2010 (Version 10.0.40219.1 SP1Rel) debug mode it hangs after I call some code after calling
GetFileVersionInfoSize
I have uploaded the file to my website: http://www.file-utilities.com/GF.zip
- 1/23/2012
- AllanIsKing