Request for version.dll

Announcements and discussion for PInvoke

Moderators: Luke Jefferson, Bart Read, Robert

Request for version.dll

Postby l8p2 » Fri Aug 31, 2012 7:36 pm

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);
l8p2
 
Posts: 1
Joined: Fri Aug 31, 2012 7:32 pm

Postby Chris.Allen » Mon Sep 03, 2012 11:32 am

Hi- but what is your question exactly?
Chris.Allen
 
Posts: 594
Joined: Thu Mar 12, 2009 4:17 pm

Postby Brian Donahue » Mon Sep 03, 2012 11:39 am

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!
Brian Donahue
 
Posts: 6668
Joined: Mon Aug 23, 2004 10:48 am

Postby Lord KiRon » Thu Mar 14, 2013 8:47 am

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.
Lord KiRon
 
Posts: 1
Joined: Thu Mar 14, 2013 8:43 am

Postby Brian Donahue » Thu Mar 14, 2013 11:02 am

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.
Brian Donahue
 
Posts: 6668
Joined: Mon Aug 23, 2004 10:48 am

Postby Brian Donahue » Thu Mar 14, 2013 11:03 am

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.
Brian Donahue
 
Posts: 6668
Joined: Mon Aug 23, 2004 10:48 am


Return to PInvoke.Net

Who is online

Users browsing this forum: No registered users and 0 guests