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 08798a9 commit 952400bCopy full SHA for 952400b
library/std/src/sys/windows/process.rs
@@ -376,6 +376,7 @@ impl Command {
376
Process {
377
handle: Handle::from_raw_handle(pi.hProcess),
378
main_thread_handle: Handle::from_raw_handle(pi.hThread),
379
+ id: pi.dwProcessId,
380
},
381
pipes,
382
))
@@ -639,6 +640,7 @@ impl From<io::Stderr> for Stdio {
639
640
pub struct Process {
641
handle: Handle,
642
main_thread_handle: Handle,
643
+ id: u32,
644
}
645
646
impl Process {
@@ -657,7 +659,7 @@ impl Process {
657
659
658
660
661
pub fn id(&self) -> u32 {
- unsafe { c::GetProcessId(self.handle.as_raw_handle()) }
662
+ self.id
663
664
665
pub fn main_thread_handle(&self) -> BorrowedHandle<'_> {
0 commit comments