lib/facter/hardwaremodel.rb in facter-1.6.18 vs lib/facter/hardwaremodel.rb in facter-1.7.0.rc1
- old
+ new
@@ -34,15 +34,16 @@
# http://msdn.microsoft.com/en-us/library/windows/desktop/windows.system.processorarchitecture.aspx
# Also, arm and neutral are included because they are valid for the upcoming
# windows 8 release. --jeffweiss 23 May 2012
require 'facter/util/wmi'
model = ""
- Facter::Util::WMI.execquery("select Architecture, Level from Win32_Processor").each do |cpu|
+ Facter::Util::WMI.execquery("select Architecture, Level, AddressWidth from Win32_Processor").each do |cpu|
model =
case cpu.Architecture
when 11 then 'neutral' # PROCESSOR_ARCHITECTURE_NEUTRAL
when 10 then 'i686' # PROCESSOR_ARCHITECTURE_IA32_ON_WIN64
- when 9 then 'x64' # PROCESSOR_ARCHITECTURE_AMD64
+ when 9 then # PROCESSOR_ARCHITECTURE_AMD64
+ cpu.AddressWidth == 32 ? "i#{cpu.Level}86" : 'x64' # 32 bit OS on 64 bit CPU
when 8 then 'msil' # PROCESSOR_ARCHITECTURE_MSIL
when 7 then 'alpha64' # PROCESSOR_ARCHITECTURE_ALPHA64
when 6 then 'ia64' # PROCESSOR_ARCHITECTURE_IA64
when 5 then 'arm' # PROCESSOR_ARCHITECTURE_ARM
when 4 then 'shx' # PROCESSOR_ARCHITECTURE_SHX