Swap out deprecated mem::uninitialized()

This commit is contained in:
Félix Saparelli 2019-11-19 00:38:58 +13:00
parent 6e64a2c152
commit 90b9a85c0c
No known key found for this signature in database
GPG Key ID: 25940898BB90EA51
1 changed files with 13 additions and 15 deletions

View File

@ -334,22 +334,20 @@ mod imp {
} }
pub fn wait(&self) { pub fn wait(&self) {
unsafe { loop {
loop { let mut code: DWORD = 0;
let mut code: DWORD = 0; let mut key: ULONG_PTR = 0;
let mut key: ULONG_PTR = 0; let mut overlapped = mem::MaybeUninit::<LPOVERLAPPED>::uninit();
let mut overlapped: LPOVERLAPPED = mem::uninitialized(); unsafe { GetQueuedCompletionStatus(
GetQueuedCompletionStatus( self.completion_port,
self.completion_port, &mut code,
&mut code, &mut key,
&mut key, overlapped.as_mut_ptr(),
&mut overlapped, INFINITE,
INFINITE, ); }
);
if code == JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO && (key as HANDLE) == self.job { if code == JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO && (key as HANDLE) == self.job {
break; break;
}
} }
} }
} }