You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// * Handle is invalid: Impossible with current API
411
-
// * Permission issues: Impossible due to admin required for open
412
-
// It's safe to ignore the return value
413
-
let _ = self.inner_close(CloseAction::Nothing);
414
-
}
396
+
let _ = unsafe{BOOL(WinDivertClose(self.handle.0))}.ok();
415
397
}
416
398
}
417
399
418
-
/// Action parameter for [`WinDivert::close()`](`fn@WinDivert::close`)
419
-
pubenumCloseAction{
420
-
/// Close the handle and try to uninstall the WinDivert driver.
421
-
Uninstall,
422
-
/// Close the handle without uninstalling the driver.
423
-
Nothing,
400
+
/// Struct that allows remote signaling the shutdown on the associated handle
401
+
#[derive(Debug)]
402
+
pubstructShutdownHandle{
403
+
handle:Weak<HANDLE>,
424
404
}
425
405
426
-
implDefaultforCloseAction{
427
-
fndefault() -> Self{
428
-
Self::Nothing
406
+
implShutdownHandle{
407
+
/// Shuts down the associated handle
408
+
/// This will prevent any further send, as well as stopping ongoing recv
409
+
/// Ongoing recv operations might not end immediately, all queued events/packets from the driver to the associated handle must be exhausted before reaching the `WinDivertRecvError::NoData` result.
0 commit comments