Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Structures, prefix the name with the module name and a period.
OSVERSIONINFO (Structures)
.
C# Definition:
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
struct OSVERSIONINFOEX {
public int dwOSVersionInfoSize;
public int dwMajorVersion;
public int dwMinorVersion;
public int dwBuildNumber;
public int dwPlatformId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)]
public string szCSDVersion;
public UInt16 wServicePackMajor;
public UInt16 wServicePackMinor;
public UInt16 wSuiteMask;
public byte wProductType;
public byte wReserved;
}
C# Definitions:
// Use this when the unmanaged API expects the structure passed by-value, or
// or if you want to pass it by-reference as a pointer to a structure
struct OSVERSIONINFO {
public uint dwOSVersionInfoSize;
public uint dwMajorVersion;
public uint dwMinorVersion;
public uint dwBuildNumber;
public uint dwPlatformId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string szCSDVersion;
public Int16 wServicePackMajor;
public Int16 wServicePackMinor;
public Int16 wSuiteMask;
public Byte wProductType;
public Byte wReserved;
}
C# Definition (with Enums):
[StructLayout(LayoutKind.Sequential)]
struct OSVERSIONINFOEX
{
public uint dwOSVersionInfoSize;
public uint dwMajorVersion;
public uint dwMinorVersion;
public uint dwBuildNumber;
public uint dwPlatformId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] public string szCSDVersion;
public ushort wServicePackMajor;
public ushort wServicePackMinor;
public SuiteMask wSuiteMask;
public ProductType wProductType;
public byte wReserved;
}
// Use this when you want to pass it by-value even though the unmanaged API
// expects a pointer to a structure. Being a class adds an extra level of indirection.
[StructLayout(LayoutKind.Sequential)]
class OSVERSIONINFO
{
public uint dwOSVersionInfoSize;
public uint dwMajorVersion;
public uint dwMinorVersion;
public uint dwBuildNumber;
public uint dwPlatformId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
public string szCSDVersion;
public Int16 wServicePackMajor;
public Int16 wServicePackMinor;
public Int16 wSuiteMask;
public Byte wProductType;
public Byte wReserved;
}
' Use this when the unmanaged API expects the structure passed by-value, or
' or if you want to pass it by-reference as a pointer to a structure
' If you plan to call "GetVersionExW" Use CharSet.Unicode
' If you are calling "GetVersionExA", Use CharSet.Ansi
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)> _
Structure OSVERSIONINFO
Public dwOSVersionInfoSize As Int32
Public dwMajorVersion As Int32
Public dwMinorVersion As Int32
Public dwBuildNumber As Int32
Public dwPlatformId As Int32
<VBFixedString(128), MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> Public szCSDVersion As String
Public wServicePackMajor As Int16
Public wServicePackMinor As Int16
Public wSuiteMask As Int16
Public wProductType As Byte
Public wReserved As Byte
End Structure
[Flags]
enum SuiteMask : ushort
{
VER_SUITE_BACKOFFICE = 0x00000004,
VER_SUITE_BLADE = 0x00000400,
VER_SUITE_COMPUTE_SERVER = 0x00004000,
VER_SUITE_DATACENTER = 0x00000080,
VER_SUITE_ENTERPRISE = 0x00000002,
VER_SUITE_EMBEDDEDNT = 0x00000040,
VER_SUITE_PERSONAL = 0x00000200,
VER_SUITE_SINGLEUSERTS = 0x00000100,
VER_SUITE_SMALLBUSINESS = 0x00000001,
VER_SUITE_SMALLBUSINESS_RESTRICTED = 0x00000020,
VER_SUITE_STORAGE_SERVER = 0x00002000,
VER_SUITE_TERMINAL = 0x00000010,
VER_SUITE_WH_SERVER = 0x00008000,
}
' Use this when you want to pass it by-value even though the unmanaged API
' expects a pointer to a structure. Being a class adds an extra level of indirection.
<StructLayout(LayoutKind.Sequential)> _
Class OSVERSIONINFO
Public dwOSVersionInfoSize As Int32
Public dwMajorVersion As Int32
Public dwMinorVersion As Int32
Public dwBuildNumber As Int32
Public dwPlatformId As Int32
<VBFixedString(128), MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> Public szCSDVersion As String
Public wServicePackMajor As Int16
Public wServicePackMinor As Int16
Public wSuiteMask As Int16
Public wProductType As Byte
Public wReserved As Byte
End Class
Public dwOSVersionInfoSize As Integer
Public dwMajorVersion As Integer
Public dwMinorVersion As Integer
Public dwBuildNumber As Integer
Public dwPlatformId As Integer
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)> _
Public szCSDVersion As String
Public wServicePackMajor As UInt16
Public wServicePackMinor As UInt16
Public wSuiteMask As UInt16
Public wProductType As Byte
Public wReserved As Byte
End Structure 'OSVERSIONINFOEX
User-Defined Field Types:
None.
Notes:
Use the overloaded API call GetVersionEx().
TODO - a short description
3/16/2007 8:17:31 AM - -63.69.129.2
Click to read this page
4/6/2008 7:23:14 AM - anonymous
Please edit this page!
Do you have...
helpful tips?
corrections to the existing content?
alternate definitions?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.