Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Development
System Services
System Information
 GetNativeSystemInfo function
GetNativeSystemInfo function

Applies to: desktop apps | Metro style apps

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

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

IsWow64Process
System Information Functions
SYSTEM_INFO

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
If using .NET 3.5+, there is built in support for it (Environment.Is64BitOperatingSystem).      Shimmy Weitzhandler   |   Edit   |   Show History
Environment.Is64BitOperatingSystem is what you're looking for, check it out: http://msdn.microsoft.com/en-us/library/system.environment.is64bitoperatingsystem.aspx.
Tags What's this?: Add a tag
Flag as ContentBug
VB.NET      eriklitze   |   Edit   |   Show History

The .NET 4.0 framework now provides information in System.Environment Class.
System.Environment.Is64BitOperatingSystem
System.Environment.Is64BitProcess

Tags What's this?: Add a tag
Flag as ContentBug
example output compared to GetSystemInfo()      JuanchoPanza   |   Edit   |   Show History
Compiled as 32-bit running under WoW64 on:
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
Tags What's this?: Add a tag
Flag as ContentBug
VB.NET Determine x32 or x64 platform example      eriklitze   |   Edit   |   Show History


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

Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker