#[non_exhaustive]pub enum HandleCaptureFailure {
NullHandle,
InvalidHandleValue,
PseudoHandle,
DuplicateHandle,
CopySecurity,
}Expand description
Why a handle could not be captured.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NullHandle
The source handle was null.
InvalidHandleValue
The source handle was INVALID_HANDLE_VALUE.
Rejected explicitly rather than passed through, because
INVALID_HANDLE_VALUE is also the current-process pseudo-handle:
DuplicateHandle would accept it and hand back a perfectly valid handle
to the current process, so an unchecked CreateFileW failure would be
captured as a successful open of something else entirely.
PseudoHandle
The source handle was one of the other Win32 pseudo-handles.
A pseudo-handle names whatever the using thread is, so duplicating one on the caller’s thread and using the result on a worker would silently change what it refers to.
DuplicateHandle
Windows refused to duplicate the source handle.
A handle that has already been closed fails here, with
ERROR_INVALID_HANDLE.
CopySecurity
The security attributes a request owns could not be copied, because the memory for the copy could not be allocated.
Reported by a request’s try_clone, which copies them along with any handle it owns.