Repository: GuillaumeGomez/sysinfo (language: rust)

Issue:
Incorrect CPU arch
**Describe the bug**
0.30.12 Win11

![](https://github.com/GuillaumeGomez/sysinfo/assets/32991121/57e59ed3-2859-4c85-80d8-e8a3cb969bce)

**To Reproduce**
Code:

```rust
println!("CPU Arch:{}", System::cpu_arch().unwrap());
```
Output:

`CPU Arch:x86`


Incorrect CPU arch
**Describe the bug**
0.30.12 Win11

![](https://github.com/GuillaumeGomez/sysinfo/assets/32991121/57e59ed3-2859-4c85-80d8-e8a3cb969bce)

**To Reproduce**
Code:

```rust
println!("CPU Arch:{}", System::cpu_arch().unwrap());
```
Output:

`CPU Arch:x86`




Discussion / hints:
The function retrieving this information is [here](https://github.com/GuillaumeGomez/sysinfo/blob/master/src/windows/system.rs#L493-L516). As you can see, quite a small one. Since I don't have an AMD computer, I can't test this myself so don't hesitate to send a patch, it'd be very welcome!
The function retrieving this information is [here](https://github.com/GuillaumeGomez/sysinfo/blob/master/src/windows/system.rs#L493-L516). As you can see, quite a small one. Since I don't have an AMD computer, I can't test this myself so don't hesitate to send a patch, it'd be very welcome!

Fix patch:
diff --git a/src/windows/cpu.rs b/src/windows/cpu.rs
index 1507d262d..1830bd2d0 100644
--- a/src/windows/cpu.rs
+++ b/src/windows/cpu.rs
@@ -21,10 +21,10 @@ use windows::Win32::System::Performance::{
 use windows::Win32::System::Power::{
     CallNtPowerInformation, ProcessorInformation, PROCESSOR_POWER_INFORMATION,
 };
-use windows::Win32::System::SystemInformation;
+use windows::Win32::System::SystemInformation::{self, GetSystemInfo};
 use windows::Win32::System::SystemInformation::{
-    GetLogicalProcessorInformationEx, GetSystemInfo, RelationAll, RelationProcessorCore,
-    SYSTEM_INFO, SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX,
+    GetLogicalProcessorInformationEx, RelationAll, RelationProcessorCore, SYSTEM_INFO,
+    SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX,
 };
 use windows::Win32::System::Threading::{
     CreateEventA, RegisterWaitForSingleObject, INFINITE, WT_EXECUTEDEFAULT,
diff --git a/src/windows/system.rs b/src/windows/system.rs
index d593837b1..0ebb6e71e 100644
--- a/src/windows/system.rs
+++ b/src/windows/system.rs
@@ -24,7 +24,7 @@ use windows::Win32::System::ProcessStatus::{K32GetPerformanceInfo, PERFORMANCE_I
 use windows::Win32::System::Registry::{
     RegCloseKey, RegOpenKeyExW, RegQueryValueExW, HKEY, HKEY_LOCAL_MACHINE, KEY_READ, REG_NONE,
 };
-use windows::Win32::System::SystemInformation;
+use windows::Win32::System::SystemInformation::{self, GetSystemInfo};
 use windows::Win32::System::SystemInformation::{
     ComputerNamePhysicalDnsHostname, GetComputerNameExW, GetTickCount64, GlobalMemoryStatusEx,
     MEMORYSTATUSEX, SYSTEM_INFO,
@@ -493,7 +493,8 @@ impl SystemInner {
     pub(crate) fn cpu_arch() -> Option<String> {
         unsafe {
             // https://docs.microsoft.com/fr-fr/windows/win32/api/sysinfoapi/ns-sysinfoapi-system_info
-            let info = SYSTEM_INFO::default();
+            let mut info = SYSTEM_INFO::default();
+            GetSystemInfo(&mut info);
             match info.Anonymous.Anonymous.wProcessorArchitecture {
                 SystemInformation::PROCESSOR_ARCHITECTURE_ALPHA => Some("alpha".to_string()),
                 SystemInformation::PROCESSOR_ARCHITECTURE_ALPHA64 => Some("alpha64".to_string()),


Test patch: