]> git.lizzy.rs Git - rust.git/blobdiff - src/shims/windows/foreign_items.rs
Add getpid shim
[rust.git] / src / shims / windows / foreign_items.rs
index 1a9b2300f723cddf5ad0ef8d11fc1f42fe4df0a7..8b7742e0a4ae32d4cc64e60c91bd7f2912ed7d0a 100644 (file)
@@ -415,6 +415,15 @@ fn emulate_foreign_item_by_name(
                 // There is only one thread, so this always succeeds and returns TRUE.
                 this.write_scalar(Scalar::from_i32(1), dest)?;
             }
+            "GetCurrentThread" if this.frame_in_std() => {
+                let [] = this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
+                this.write_scalar(Scalar::from_machine_isize(1, this), dest)?;
+            }
+            "GetCurrentProcessId" if this.frame_in_std() => {
+                let [] = this.check_shim(abi, Abi::System { unwind: false }, link_name, args)?;
+                let result = this.GetCurrentProcessId()?;
+                this.write_scalar(Scalar::from_u32(result), dest)?;
+            }
 
             _ => return Ok(EmulateByNameResult::NotSupported),
         }