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 kernel32, prefix the name with the module name and a period.
GetVersion (kernel32)
.
C# Signatures:
// This must be used if OSVERSIONINFO is defined as a struct or Class - The previous [In,Out] parameter defined for
// a class could cause buffer overrun errors.
[ DllImport( "kernel32" )]
static extern bool GetVersionEx( ref OSVERSIONINFO osvi );
VB.Net Signatures:
' This must be used if OSVERSIONINFO is defined as a struct
<DllImport("kernel32")> _
Private Shared Function GetVersionEx(ByRef osvi As OSVERSIONINFO) As Boolean
End Function
' This must be used if OSVERSIONINFO is defined as a class
<DllImport("kernel32")> _
Private Shared Function GetVersionEx(<[In](), Out()> ByVal osvi As OSVERSIONINFO) As Boolean
End Function
Friend Function IsWinVista() As Boolean
Dim osInfo As System.OperatingSystem = System.Environment.OSVersion
Return (osInfo.Platform = PlatformID.Win32NT AndAlso osInfo.Version.Major = 6)
End Function
[DllImport("kernel32.dll")]
public static extern uint GetVersion();
}
}
Friend Function IsWinXP() As Boolean
Dim osInfo As System.OperatingSystem = System.Environment.OSVersion
Return (osInfo.Platform = PlatformID.Win32NT AndAlso osInfo.Version.Major = 5 AndAlso osInfo.Version.Minor >= 1)
End Function
Alternative Managed API:
GetVersionEx(), Operating System Version(), VerifyVersionInfo()
Obtains extended information about the version of the operating system that is currently running.
9/30/2010 7:30:48 AM - -125.239.167.15
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.
11/7/2012 10:31:51 AM - -74.212.48.23
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).