We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
GetProcessId
1 parent 4ebb0ef commit 7b9f467Copy full SHA for 7b9f467
library/std/src/sys/pal/windows/process.rs
@@ -394,6 +394,7 @@ impl Command {
394
Process {
395
handle: Handle::from_raw_handle(pi.hProcess),
396
main_thread_handle: Handle::from_raw_handle(pi.hThread),
397
+ id: pi.dwProcessId,
398
},
399
pipes,
400
))
@@ -657,6 +658,7 @@ impl From<io::Stderr> for Stdio {
657
658
pub struct Process {
659
handle: Handle,
660
main_thread_handle: Handle,
661
+ id: u32,
662
}
663
664
impl Process {
@@ -675,7 +677,7 @@ impl Process {
675
677
676
678
679
pub fn id(&self) -> u32 {
- unsafe { c::GetProcessId(self.handle.as_raw_handle()) }
680
+ self.id
681
682
683
pub fn main_thread_handle(&self) -> BorrowedHandle<'_> {
0 commit comments