File tree 1 file changed +8
-0
lines changed
library/std/src/os/windows/io
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ pub struct OwnedHandle {
68
68
/// `NULL`. This ensures that such FFI calls cannot start using the handle without
69
69
/// checking for `NULL` first.
70
70
///
71
+ /// This type concerns any value other than `NULL` to be valid, including `INVALID_HANDLE_VALUE`.
72
+ /// This is because APIs that use `NULL` as their sentry value don't treat `INVALID_HANDLE_VALUE`
73
+ /// as special.
74
+ ///
71
75
/// If this holds a valid handle, it will close the handle on drop.
72
76
#[ repr( transparent) ]
73
77
#[ unstable( feature = "io_safety" , issue = "87074" ) ]
@@ -84,6 +88,10 @@ pub struct HandleOrNull(OwnedHandle);
84
88
/// `INVALID_HANDLE_VALUE`. This ensures that such FFI calls cannot start using the handle without
85
89
/// checking for `INVALID_HANDLE_VALUE` first.
86
90
///
91
+ /// This type concerns any value other than `INVALID_HANDLE_VALUE` to be valid, including `NULL`.
92
+ /// This is because APIs that use `INVALID_HANDLE_VALUE` as their sentry value may return `NULL`
93
+ /// under `windows_subsystem = "windows"` or other situations where I/O devices are detached.
94
+ ///
87
95
/// If this holds a valid handle, it will close the handle on drop.
88
96
#[ repr( transparent) ]
89
97
#[ unstable( feature = "io_safety" , issue = "87074" ) ]
You can’t perform that action at this time.
0 commit comments