GetNativeSystemInfo function
Retrieves information about the current system to an application running under WOW64. If the function is called from a 64-bit application, it is equivalent to the GetSystemInfo function.
Syntax
void WINAPI GetNativeSystemInfo( __out LPSYSTEM_INFO lpSystemInfo );
Parameters
- lpSystemInfo [out]
-
A pointer to a SYSTEM_INFO structure that receives the information.
Return value
This function does not return a value.
Remarks
To determine whether a Win32-based application is running under WOW64, call the IsWow64Process function.
To compile an application that uses this function, define _WIN32_WINNT as 0x0501 or later. For more information, see Using the Windows Headers.
Examples
For an example, see Getting the System Version.
Requirements
|
Minimum supported client | Windows XP |
|---|---|
|
Minimum supported server | Windows Server 2003 |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 9/7/2011
- 10/1/2011
- Shimmy Weitzhandler
- 10/1/2011
- Shimmy Weitzhandler
The .NET 4.0 framework now provides information in System.Environment Class.
System.Environment.Is64BitOperatingSystem
System.Environment.Is64BitProcess
- 7/16/2010
- eriklitze
Windows Server 2008/Windows Vista Version 6002 (Service Pack 2) MP (4 procs) Free x64
Product: WinNt, suite: SingleUserTS
Here's example GetSystemInfo() output:
0:000:x86> dt si
Local var @ 0x17f5cc Type _SYSTEM_INFO
+0x000 dwOemId : 0
+0x000 wProcessorArchitecture : 0
+0x002 wReserved : 0
+0x004 dwPageSize : 0x1000
+0x008 lpMinimumApplicationAddress : 0x00010000
+0x00c lpMaximumApplicationAddress : 0x7ffeffff
+0x010 dwActiveProcessorMask : 0xf
+0x014 dwNumberOfProcessors : 4
+0x018 dwProcessorType : 0x24a
+0x01c dwAllocationGranularity : 0x10000
+0x020 wProcessorLevel : 0xf
+0x022 wProcessorRevision : 0x401
And GetNativeSystemInfo():
0:000:x86> dt si
Local var @ 0x17f5cc Type _SYSTEM_INFO
+0x000 dwOemId : 9
+0x000 wProcessorArchitecture : 9
+0x002 wReserved : 0
+0x004 dwPageSize : 0x1000
+0x008 lpMinimumApplicationAddress : 0x00010000
+0x00c lpMaximumApplicationAddress : 0xfffeffff
+0x010 dwActiveProcessorMask : 0xf
+0x014 dwNumberOfProcessors : 4
+0x018 dwProcessorType : 0x21d8
+0x01c dwAllocationGranularity : 0x10000
+0x020 wProcessorLevel : 0xf
+0x022 wProcessorRevision : 0x401
On another CPU fields may vary.
Juanito
- 3/16/2010
- JuanchoPanza
Private Const PROCESSOR_ARCHITECTURE_INTEL = 0
Private Const PROCESSOR_ARCHITECTURE_IA64 = 6
Private Const PROCESSOR_ARCHITECTURE_AMD64 = 9
Private Const PROCESSOR_ARCHITECTURE_UNKNOWN = &HFFFF
<StructLayout(LayoutKind.Sequential)> _
Public Structure SYSTEM_INFO
Dim wProcessorArchitecture As Short
Dim wReserved As Short
Dim dwPageSize As Integer
Dim lpMinimumApplicationAddress As IntPtr
Dim lpMaximumApplicationAddress As IntPtr
Dim dwActiveProcessorMask As IntPtr
Dim dwNumberOfProcessors As Integer
Dim dwProcessorType As Integer
Dim dwAllocationGranularity As Integer
Dim wProcessorLevel As Short
Dim wProcessorRevision As Short
End Structure
Declare Auto Sub GetNativeSystemInfo Lib "kernel32.dll" (ByRef lpSystemInfo As SYSTEM_INFO)
Public Shared Function IsPlatformX64() As Boolean
Dim sysInfo As SYSTEM_INFO
Dim osv As OperatingSystem
Dim fOk As Boolean = False
osv = Environment.OSVersion
If osv.Version.Major > 5 Or (osv.Version.Major = 5 And osv.Version.Minor >= 1) Then
GetNativeSystemInfo(sysInfo)
Select Case sysInfo.wProcessorArchitecture
Case PROCESSOR_ARCHITECTURE_IA64, PROCESSOR_ARCHITECTURE_AMD64
fOk = True
End Select
End If
Return fOk
End Function
