Red Gate forums :: View topic - Request for version.dll
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
PInvoke.Net
PInvoke.Net forum

Request for version.dll

Search in PInvoke.Net forum
Post new topic   Reply to topic
Jump to:  
Author Message
l8p2



Joined: 31 Aug 2012
Posts: 1

PostPosted: Fri Aug 31, 2012 7:36 pm    Post subject: Request for version.dll Reply with quote

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);
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 588

PostPosted: Mon Sep 03, 2012 11:32 am    Post subject: Reply with quote

Hi- but what is your question exactly?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6646

PostPosted: Mon Sep 03, 2012 11:39 am    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Lord KiRon



Joined: 14 Mar 2013
Posts: 1

PostPosted: Thu Mar 14, 2013 8:47 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6646

PostPosted: Thu Mar 14, 2013 11:02 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6646

PostPosted: Thu Mar 14, 2013 11:03 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group