Request for version.dll

l8p2l8p2 Posts: 2
edited March 14, 2013 6:03AM in PInvoke.Net
Adding the following:
[DllImport("Version.dll", SetLastError = true)]
public static extern bool GetFileVersionInfo(
/*_in_*/ string sFilename,
/*_reserved_*/ int handle,
/*_in_ */ int size,
/*_out_ */ byte[] infoBuffer);

[DllImport("Version.dll", SetLastError = true)]
public static extern int GetFileVersionInfoSize(
/*_in_*/ string sFilename,
/*_out_opt_*/ out int handle);

// The third parameter - "out byte* pValue"
// Ansi encoding
[DllImport("Version.dll", SetLastError = true)]
unsafe public static extern bool VerQueryValue(
/*_in_*/ byte[] pBlock,
/*_in_*/ string pSubBlock,
/*_out_*/ out byte* pValue,
/*_out_*/ out uint len);

// This VerQueryValue overload is marked with 'unsafe' because
// it uses a short*:
[DllImport("Version.dll")]
unsafe public static extern bool VerQueryValue(
/*_in_*/ byte[] pBlock,
/*_in_*/ string pSubBlock,
/*_out_*/ out short* pValue,
/*_out_*/ out uint len);

Comments

  • Hi- but what is your question exactly?
  • I've added the version module to the PInvoke Wiki now, so if you want to contribute functions to that bit of the wiki, please feel free.

    Thanks!
  • Hi guys,
    Several things:

    1. The topic is here since August but this was not added to site, the "version" node on site is empty

    2. The GetFileVersionInfo() added to wrong category - kernel32 , although it shows correct DllImport in signature - version.dll

    3. The pinvoke stated here is wrong, it's not x64 bit compatible as handles (like in GetFileVersionInfoSize) should not be defined to int ans so on.
  • Please feel free to edit - this is user-contributed content and not moderated by Red Gate.

    There is a "version" module in PInvoke wiki, right there on the left-hand side.
  • You can add functions to "version" by typing in the banner on the top of the page you get when you expand the "version" node.
Sign In or Register to comment.