@@ -306,6 +306,8 @@ sub PRODUCT_EDUCATION_N () { 0x7A } # Windows 10 Education
306
306
307
307
sub PRODUCT_UNLICENSED () { 0xABCDABCD } # product has not been activated and is no longer in the grace period
308
308
309
+ sub PROCESSOR_ARCHITECTURE_ARM64 () { 12 } # ARM64
310
+ sub PROCESSOR_ARCHITECTURE_ARM () { 5 } # ARM
309
311
sub PROCESSOR_ARCHITECTURE_AMD64 () { 9 } # x64 (AMD or Intel)
310
312
sub PROCESSOR_ARCHITECTURE_IA64 () { 6 } # Intel Itanium Processor Family (IPF)
311
313
sub PROCESSOR_ARCHITECTURE_INTEL () { 0 } # x86
@@ -319,6 +321,14 @@ sub _GetProcessorArchitecture {
319
321
2200 => PROCESSOR_ARCHITECTURE_IA64,
320
322
8664 => PROCESSOR_ARCHITECTURE_AMD64,
321
323
}-> {Win32::GetChipName()};
324
+
325
+ if (!defined ($arch )) {
326
+ $arch = {
327
+ 5 => PROCESSOR_ARCHITECTURE_ARM,
328
+ 12 => PROCESSOR_ARCHITECTURE_ARM64,
329
+ }-> {Win32::GetChipArch()};
330
+ }
331
+
322
332
return defined ($arch ) ? $arch : PROCESSOR_ARCHITECTURE_UNKNOWN;
323
333
}
324
334
@@ -890,10 +900,17 @@ $ENV{PROCESSOR_ARCHITECTURE}. This might not work on Win9X.
890
900
891
901
=item Win32::GetChipName()
892
902
893
- Returns the processor type: 386, 486 or 586 for x86 processors, 8664
894
- for the x64 processor and 2200 for the Itanium. Since it returns the
895
- native processor type it will return a 64-bit processor type even when
896
- called from a 32-bit Perl running on 64-bit Windows.
903
+ Returns the processor type: 386, 486 or 586 for x86 processors, 8664 for the x64
904
+ processor and 2200 for the Itanium. For arm/arm64 processor, the value is marked
905
+ as "Reserved" (not specified, but usually 0) in Microsoft documentation, so it's
906
+ better to use GetChipArch(). Since it returns the native processor type it will
907
+ return a 64-bit processor type even when called from a 32-bit Perl running on
908
+ 64-bit Windows.
909
+
910
+ =item Win32::GetChipArch()
911
+
912
+ Returns the processor architecture: 0 for x86 processors, 5 for arm, 6 for
913
+ Itanium, 9 for x64 and 12 for arm64, and 0xFFFF for unknown architecture.
897
914
898
915
=item Win32::GetConsoleCP()
899
916
0 commit comments