AMD64位的架构不能装32位的OS?

可以的。

所以,以下代码就正确了(修改:PROCESSOR_ARCHITECTURE_AMD64虽然看起来很硬件,但其实是一个软件层次上的tag,而且下面的代码没有问题):

        if (osvi.dwMajorVersion >= 6)
        {
            if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
                Result = Result + " 64-bit";
            else if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
                Result = Result + " 32-bit";
        }

而且64bit的os也不是从windows 6版本才有的。5.2的时候就有了。具体最早什么时候还有待考究。

SYSTEM_INFO structure

 

Contains information about the current computer system. This includes the architecture and type of the processor, the number of processors in the system, the page size, and other such information.

Syntax

C++
 
typedef struct _SYSTEM_INFO {
  union {
    DWORD  dwOemId;
    struct {
      WORD wProcessorArchitecture;
      WORD wReserved;
    };
  };
  DWORD     dwPageSize;
  LPVOID    lpMinimumApplicationAddress;
  LPVOID    lpMaximumApplicationAddress;
  DWORD_PTR dwActiveProcessorMask;
  DWORD     dwNumberOfProcessors;
  DWORD     dwProcessorType;
  DWORD     dwAllocationGranularity;
  WORD      wProcessorLevel;
  WORD      wProcessorRevision;
} SYSTEM_INFO;

Members

dwOemId

An obsolete member that is retained for compatibility. Applications should use the wProcessorArchitecture branch of the union.

wProcessorArchitecture

The processor architecture of the installed operating system. This member can be one of the following values.

ValueMeaning
PROCESSOR_ARCHITECTURE_AMD64 9

x64 (AMD or Intel)

PROCESSOR_ARCHITECTURE_ARM Reserved

ARM

PROCESSOR_ARCHITECTURE_IA64 6

Intel Itanium-based

PROCESSOR_ARCHITECTURE_INTEL 0

x86

PROCESSOR_ARCHITECTURE_UNKNOWN 0xffff

Unknown architecture.

 

wReserved

This member is reserved for future use.

dwPageSize

The page size and the granularity of page protection and commitment. This is the page size used by the VirtualAlloc function.

lpMinimumApplicationAddress

A pointer to the lowest memory address accessible to applications and dynamic-link libraries (DLLs).

lpMaximumApplicationAddress

A pointer to the highest memory address accessible to applications and DLLs.

dwActiveProcessorMask

A mask representing the set of processors configured into the system. Bit 0 is processor 0; bit 31 is processor 31.

dwNumberOfProcessors

The number of logical processors in the current group. To retrieve this value, use the GetLogicalProcessorInformation function.

Note  For information about the physical processors shared by logical processors, call GetLogicalProcessorInformationEx with the RelationshipType parameter set to RelationProcessorPackage (3).

dwProcessorType

An obsolete member that is retained for compatibility. Use the wProcessorArchitecture, wProcessorLevel, and wProcessorRevision members to determine the type of processor.

PROCESSOR_INTEL_386 (386) PROCESSOR_INTEL_486 (486) PROCESSOR_INTEL_PENTIUM (586) PROCESSOR_INTEL_IA64 (2200) PROCESSOR_AMD_X8664 (8664) PROCESSOR_ARM (Reserved)
dwAllocationGranularity

The granularity for the starting address at which virtual memory can be allocated. For more information, see VirtualAlloc.

wProcessorLevel

The architecture-dependent processor level. It should be used only for display purposes. To determine the feature set of a processor, use the IsProcessorFeaturePresent function.

If wProcessorArchitecture is PROCESSOR_ARCHITECTURE_INTEL, wProcessorLevel is defined by the CPU vendor.

If wProcessorArchitecture is PROCESSOR_ARCHITECTURE_IA64, wProcessorLevel is set to 1.

wProcessorRevision

The architecture-dependent processor revision. The following table shows how the revision value is assembled for each type of processor architecture.

ProcessorValue
Intel Pentium, Cyrix, or NextGen 586The high byte is the model and the low byte is the stepping. For example, if the value is xxyy, the model number and stepping can be displayed as follows:

Model xx, Stepping yy

Intel 80386 or 80486A value of the form xxyz.

If xx is equal to 0xFF, y - 0xA is the model number, and z is the stepping identifier.

If xx is not equal to 0xFF, xx + 'A' is the stepping letter and yz is the minor stepping.

ARMReserved.

 

Examples

For an example, see Getting Hardware Information.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps | Windows Store apps]

Minimum supported server

Windows 2000 Server [desktop apps | Windows Store apps]

Header

Winbase.h (include Windows.h)

See also

GetNativeSystemInfo GetSystemInfo MapViewOfFile MapViewOfFileEx

 

 

Build date: 11/16/2013

参考:http://msdn.microsoft.com/zh-tw/library/windows/desktop/ms724958

转载于:https://www.cnblogs.com/tupx/p/3459373.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值