Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8906211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:35:41+00:00 2026-06-15T02:35:41+00:00

I have this code – that is returning the file version (into a struct)

  • 0

I have this code – that is returning the file version (into a struct)
I’m using as example the shell32.dll
but there are some values that I don’t understand their meanings , and would love to get an explanation.

here is the code :

void GetFileVersion( PCHAR pFilePath  ,PVERSION pRetVersion)
{
DWORD               dwSize              = 0;
BYTE                *pVersionInfo       = NULL;
VS_FIXEDFILEINFO    *pFileInfo          = NULL;
UINT                pLenFileInfo        = 0;


/*getting the file version info size */
dwSize = GetFileVersionInfoSize( pFilePath, NULL );
if ( dwSize == 0 )
{
    printf( "Error in GetFileVersionInfoSize: %d\n", GetLastError() );
    return;
}

pVersionInfo = new BYTE[ dwSize ]; /*allocation of space for the verison size */

if ( !GetFileVersionInfo( pFilePath, 0, dwSize, pVersionInfo ) ) /*entering all info     data to pbVersionInfo*/
{
    printf( "Error in GetFileVersionInfo: %d\n", GetLastError() );
    delete[] pVersionInfo;
    return;
}

if ( !VerQueryValue( pVersionInfo, TEXT("\\"), (LPVOID*) &pFileInfo, &pLenFileInfo ) )
{
    printf( "Error in VerQueryValue: %d\n", GetLastError() );
    delete[] pVersionInfo;
    return;
}


/*checking if the allocation succeeded */
if (NULL == pRetVersion)
{
    printf("Allocation failed! \n" , GetLastError());
    return;
}


pRetVersion->major  =  ( pFileInfo->dwFileVersionMS >> 16 ) & 0xffff ;
pRetVersion->minor  =  ( pFileInfo->dwFileVersionMS) & 0xffff;
pRetVersion->hotfix =  ( pFileInfo->dwFileVersionLS >>  16 ) & 0xffff;
pRetVersion->other  =  ( pFileInfo->dwFileVersionLS) & 0xffff;      

}
  1. what is the the meaning of dwSize ? is this only the file version size? where can I see it while clicking on the shell32.dll?

  2. pLenFileinfo – what is this size ?

  3. when I look at the struct of VS_FIXEDFILEINFO there is only the version info information , Is there a wae to get for example : File description , Date modified , Original filename etc ? (all the other properties that are inside the “Details” )?

thanks !!!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:35:42+00:00Added an answer on June 15, 2026 at 2:35 am

    The file version information is of variable length. It contains a number of different pieces of information. The total length of all these different pieces is given by the return value of GetFileVersionInfoSize.

    When you call VerQueryValue you are asking for a specific individual piece of information within the overall version information. And the length of that specific part can never be larger that the overall size.

    The documentation for VerQueryFile contains sample code that extracts the file description.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code that I have written in Ruby, but when trying to
I have this code to create a config.ini file with Zend Framework but I
I have this code that performs an ajax call and loads the results into
I have this code that loads 5 images and puts them into the frame
I have this code in a single file : public class genIntro { public
I have this code in jQuery, that I want to reimplement with the prototype
I have this code #include <iostream> using namespace std; int main(int argc,char **argv) {
I have this code: myVariable which I want to change into trace(myVariable: + myVariable);
I have this code: http://jsfiddle.net/bUPWS/1/ but #div2 overflows #div1. How to bring the overflowed
have this code in a htaccess file to hide the final php extension of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.