| Author |
Message |
l8p2
Joined: 31 Aug 2012 Posts: 1
|
Posted: Fri Aug 31, 2012 7:36 pm Post subject: Request for version.dll |
|
|
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 |
|
 |
Chris.Allen
Joined: 12 Mar 2009 Posts: 454
|
Posted: Mon Sep 03, 2012 11:32 am Post subject: |
|
|
| Hi- but what is your question exactly? |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6369 Location: Red Gate Software
|
Posted: Mon Sep 03, 2012 11:39 am Post subject: |
|
|
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
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
Lord KiRon
Joined: 14 Mar 2013 Posts: 1
|
Posted: Thu Mar 14, 2013 8:47 am Post subject: |
|
|
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 |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6369 Location: Red Gate Software
|
Posted: Thu Mar 14, 2013 11:02 am Post subject: |
|
|
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
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6369 Location: Red Gate Software
|
Posted: Thu Mar 14, 2013 11:03 am Post subject: |
|
|
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
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
|