// This must be used if OSVERSIONINFO is defined as a struct
[ DllImport( "kernel32" )]
static extern bool GetVersionEx( OSVERSIONINFO osvi );
// This must be used if OSVERSIONINFO is defined as a class
[ DllImport( "kernel32" )]
static extern bool GetVersionEx( [In, Out] OSVERSIONINFO osvi );
<DllImport("kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
Public Function GetVersionEx(ByRef lpVersionInformation As OSVERSIONINFO) As Boolean
None.
Please add some!
Using the OSVERSIONINFO class and corresponding signature:
Console.WriteLine( "\nPassing OSVERSIONINFO as class" );
OSVERSIONINFO osvi = new OSVERSIONINFO();
osvi.OSVersionInfoSize = Marshal.SizeOf( osvi );
GetVersionEx( osvi );
Console.WriteLine( "Class size: {0}", osvi.OSVersionInfoSize );
Using the OSVERSIONINFO struct and corresponding signature:
Console.WriteLine( "\nPassing OSVERSIONINFO as struct" );
OSVERSIONINFO osvi2 = new OSVERSIONINFO();
osvi2.OSVersionInfoSize = Marshal.SizeOf( osvi2 );
GetVersionEx( ref osvi2 );
Console.WriteLine( "Struct size: {0}", osvi2.OSVersionInfoSize );
System.Environment.OSVersion property