Skip to content

Commit 952400b

Browse files
committed
1 parent 08798a9 commit 952400b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/std/src/sys/windows/process.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ impl Command {
376376
Process {
377377
handle: Handle::from_raw_handle(pi.hProcess),
378378
main_thread_handle: Handle::from_raw_handle(pi.hThread),
379+
id: pi.dwProcessId,
379380
},
380381
pipes,
381382
))
@@ -639,6 +640,7 @@ impl From<io::Stderr> for Stdio {
639640
pub struct Process {
640641
handle: Handle,
641642
main_thread_handle: Handle,
643+
id: u32,
642644
}
643645

644646
impl Process {
@@ -657,7 +659,7 @@ impl Process {
657659
}
658660

659661
pub fn id(&self) -> u32 {
660-
unsafe { c::GetProcessId(self.handle.as_raw_handle()) }
662+
self.id
661663
}
662664

663665
pub fn main_thread_handle(&self) -> BorrowedHandle<'_> {

0 commit comments

Comments
 (0)