Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "OSVERSIONINFO" in [All]

Structures

.

public struct CEOSVERSIONINFO

.

    public UInt32 dwOSVersionInfoSize;

.

Public Structure CEOSVERSIONINFO

.

    Public dwOSVersionInfoSize As UInt32

.
Documentation
[CEOSVERSIONINFO] on MSDN
.
Summary
The OSVERSIONINFOEX structure contains operating system version information. The information includes major and minor version numbers, a build number, a platform identifier, and information about product suites and the latest Service Pack installed on the system.
.

struct OSVERSIONINFOEX {

.

   public int dwOSVersionInfoSize;  

.

  struct OSVERSIONINFOEX

.

    public uint dwOSVersionInfoSize;

.

Structure OSVERSIONINFOEX

.

   Public dwOSVersionInfoSize As Integer

.

End Structure 'OSVERSIONINFOEX

.
Documentation
[OSVERSIONINFOEX] on MSDN
.
Summary
The OSVERSIONINFOEX structure contains operating system version information. The information includes major and minor version numbers, a build number, a platform identifier, and information about product suites and the latest Service Pack installed on the system.
.

struct OSVERSIONINFOEX {

.

   public int dwOSVersionInfoSize;  

.

Structure OSVERSIONINFOEX

.

   Public dwOSVersionInfoSize As Integer

.

End Structure 'OSVERSIONINFOEX

.
Documentation
[OSVERSIONINFOEX] on MSDN

kernel32

.
Summary
Is used to get OSVERSIONINFOEX, you can try the System.Environment.OSVersion class.
.

private static extern bool GetVersionEx(ref OSVERSIONINFOEX osvi);

.

private struct OSVERSIONINFOEX

.

    public uint dwOSVersionInfoSize;

.

    (ByRef lpVersionInformation As OSVERSIONINFOEX) As Boolean

.

    Structure OSVERSIONINFOEX

.

    Public dwOSVersionInfoSize As Integer

.

    End Structure 'OSVERSIONINFOEX

.

    Dim osv As New OSVERSIONINFOEX

.

    osv.dwOSVersionInfoSize = Marshal.SizeOf(osv)

.

    Dim osv As New OSVERSIONINFOEX

.

    osv.dwOSVersionInfoSize = Marshal.SizeOf(osv)

.

don't forget to set the dwOSVersionInfoSize  

.

OSVERSIONINFOEX osVersionInfo = new OSVERSIONINFOEX();

.

osVersionInfo.dwOSVersionInfoSize = Marshal.SizeOf(osVersionInfo); // don't forget this line, please!

.

GetVersionEx(ref osVersionInfo);

.

   Private Declare Ansi Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (ByRef i As OSVERSIONINFO) As Boolean

.

   Public Structure OSVERSIONINFO

.

       Public dwOSVersionInfoSize As Integer

.

// This must be used if OSVERSIONINFO is defined as a struct or Class - The previous [In,Out] parameter defined for

.

static extern bool GetVersionEx( ref OSVERSIONINFO osvi );  

.

' This must be used if OSVERSIONINFO is defined as a struct

.

Private Shared Function GetVersionEx(ByRef osvi As OSVERSIONINFO) As Boolean

.

' This must be used if OSVERSIONINFO is defined as a class

.

Private Shared Function GetVersionEx(<[In](), Out()> ByVal osvi As OSVERSIONINFO) As Boolean

.

OSVERSIONINFO

.

If you forget to set the OSVersionInfoSize field of the OSVERSIONINFO struct, the function will return false. GetLastError() will return:

.

Using the OSVERSIONINFO class and corresponding signature:

.

Console.WriteLine( "\nPassing OSVERSIONINFO as class" );

.

OSVERSIONINFO osvi = new OSVERSIONINFO();

.

osvi.OSVersionInfoSize = Marshal.SizeOf( 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(ref typeof(OSVERSIONINFO) );

.

Console.WriteLine( "Struct size:   {0}", osvi2.OSVersionInfoSize );

.

// This must be used if OSVERSIONINFO is defined as a struct or Class - The previous [In,Out] parameter defined for

.

static extern bool GetVersionEx( ref OSVERSIONINFO osvi );  

.

' This must be used if OSVERSIONINFO is defined as a struct

.

Private Shared Function GetVersionEx(ByRef osvi As OSVERSIONINFO) As Boolean

.

' This must be used if OSVERSIONINFO is defined as a class

.

Private Shared Function GetVersionEx(<[In](), Out()> ByVal osvi As OSVERSIONINFO) As Boolean

.

OSVERSIONINFO

.

If you forget to set the OSVersionInfoSize field of the OSVERSIONINFO struct, the function will return false. GetLastError() will return:

.

Using the OSVERSIONINFO class and corresponding signature:

.

Console.WriteLine( "\nPassing OSVERSIONINFO as class" );

.

OSVERSIONINFO osvi = new OSVERSIONINFO();

.

osvi.OSVersionInfoSize = Marshal.SizeOf( 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(ref typeof(OSVERSIONINFO) );

.

Console.WriteLine( "Struct size:   {0}", osvi2.OSVersionInfoSize );

.

    Dim osv As New OSVERSIONINFOEX

.

    osv.dwOSVersionInfoSize = Marshal.SizeOf(osv)

.

    Dim osv As New OSVERSIONINFOEX

.

    osv.dwOSVersionInfoSize = Marshal.SizeOf(osv)

.

static extern bool VerifyVersionInfo([In] ref OSVERSIONINFOEX lpVersionInfo,

.

private struct OSVERSIONINFOEX

.

   public uint dwOSVersionInfoSize;

rapi

.

public static extern int CeGetVersionEx(ref CEOSVERSIONINFO ceosver);

.

CEOSVERSIONINFO

user32

.

    Private Structure OSVERSIONINFO

.

    Dim dwOSVersionInfoSize As Integer

.

    Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (ByRef lpVersionInformation As OSVERSIONINFO) As Integer

.

    Dim o As OSVERSIONINFO

.

    o.dwOSVersionInfoSize = Len(o)

.

    Dim o As OSVERSIONINFO

.

    o.dwOSVersionInfoSize = Len(o)


 
Access PInvoke.net directly from VS: