Repository: GuillaumeGomez/sysinfo (language: rust)

Issue:
`Process` not filled on `i686-pc-windows-msvc`
Hi,

Using `sysinfo 0.30.0` and building for `i686-pc-windows-msvc`, the `Process` members are not all filled. All of this works fine with default target.
My best guess is that it comes from a 32/64 bits problem.

```rust
let mut system = System::new_all();
system.refresh_processes();
for (pid, process) in system.processes().iter() {
      if let Some(cwd) = process.cwd() {
        println!("cwd={}", cwd);
    } else {
        println!("nope");
    }
}
```

As far as I know, I noticed this for the following members:
- `cwd` (`None`)
- `cmd` (empy)
- `environ` (empy)
- `root` (`None`)



Discussion / hints:
I don't have this arch so you'll need to fix it (or someone else who has this arch). ^^'

Fix patch:
diff --git a/src/windows/process.rs b/src/windows/process.rs
index 063189596..57971f107 100644
--- a/src/windows/process.rs
+++ b/src/windows/process.rs
@@ -272,7 +272,7 @@ unsafe fn get_process_name(pid: Pid) -> Option<String> {
         ImageName: MaybeUninit::zeroed().assume_init(),
     };
     // `MaximumLength` MUST BE a power of 2: here 128
-    info.ImageName.MaximumLength = 1 << 7;
+    info.ImageName.MaximumLength = 1 << 15; // the returned name may be a full UNC path, up to 32767
 
     for i in 0.. {
         let local_alloc = LocalAlloc(
@@ -857,10 +857,6 @@ impl_RtlUserProcessParameters!(RTL_USER_PROCESS_PARAMETERS32);
 impl_RtlUserProcessParameters!(RTL_USER_PROCESS_PARAMETERS);
 
 unsafe fn get_process_params(process: &mut ProcessInner, refresh_kind: ProcessRefreshKind) {
-    if !cfg!(target_pointer_width = "64") {
-        sysinfo_debug!("Non 64 bit targets are not supported");
-        return;
-    }
     if !(refresh_kind.cmd().needs_update(|| process.cmd.is_empty())
         || refresh_kind
             .environ()
diff --git a/src/windows/system.rs b/src/windows/system.rs
index b09638e0f..460189353 100644
--- a/src/windows/system.rs
+++ b/src/windows/system.rs
@@ -153,16 +153,14 @@ impl SystemInner {
                 )
                 .as_bool()
                 {
-                    let swap_total = perf_info.PageSize.saturating_mul(
-                        perf_info
-                            .CommitLimit
-                            .saturating_sub(perf_info.PhysicalTotal),
-                    );
-                    let swap_used = perf_info.PageSize.saturating_mul(
-                        perf_info
-                            .CommitTotal
-                            .saturating_sub(perf_info.PhysicalTotal),
-                    );
+                    let page_size = perf_info.PageSize as u64;
+                    let physical_total = perf_info.PhysicalTotal as u64;
+                    let commit_limit = perf_info.CommitLimit as u64;
+                    let commit_total = perf_info.CommitTotal as u64;
+                    let swap_total =
+                        page_size.saturating_mul(commit_limit.saturating_sub(physical_total));
+                    let swap_used =
+                        page_size.saturating_mul(commit_total.saturating_sub(physical_total));
                     self.swap_total = swap_total as _;
                     self.swap_used = swap_used as _;
                 }


Test patch: