Skip to content

Commit 87fffb9

Browse files
committed
Fix Intel CPUs not returning Model or Stepping
1 parent a0aa937 commit 87fffb9

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

includes/_WMIC.au3

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include-once
22

33
#include <Array.au3>
4+
#include <WinAPISys.au3>
45
#include <StringConstants.au3>
56

67
#include "GetDiskInfo.au3"
@@ -70,8 +71,8 @@ Func _GetCPUInfo($iFlag = 0)
7071
$sArch = $Obj_Item.AddressWidth
7172
$sVersion = $Obj_Item.Caption
7273
$sFamily = $Obj_Item.Level
73-
$sModel = $Obj_Item.Revision
74-
$sStepping = $Obj_Item.Stepping
74+
$sModel = $Obj_Item.Revision ; Doesn't work for Intel...
75+
$sStepping = $Obj_Item.Stepping ; Doesn't work for Intel...
7576
Next
7677

7778
$Col_Items = $Obj_WMIService.ExecQuery('Select * from Win32_ComputerSystem')
@@ -105,9 +106,17 @@ Func _GetCPUInfo($iFlag = 0)
105106
Case 6
106107
Return Number($sFamily)
107108
Case 7
108-
Return BitAND(BitShift($sModel, 8), 0xFF)
109+
If StringInStr($vName, "Intel") Then
110+
Return BitAND(BitShift(_WinAPI_GetSystemInfo()[9], 8), 0xFF)
111+
Else
112+
Return BitAND(BitShift($sModel, 8), 0xFF)
113+
EndIf
109114
Case 8
110-
Return BitAND($sStepping, 0xFF)
115+
If StringInStr($vName, "Intel") Then
116+
Return BitAND(_WinAPI_GetSystemInfo()[9], 0xFF)
117+
Else
118+
Return BitAND($sStepping, 0xFF)
119+
EndIf
111120
Case Else
112121
Return 0
113122
EndSwitch

0 commit comments

Comments
 (0)