@@ -23,8 +23,9 @@ use crate::sys_common::{AsInner, FromInner, IntoInner};
23
23
/// it is not captured or consumed.
24
24
///
25
25
/// Note that it *may* have the value `-1`, which in `BorrowedHandle` always
26
- /// represents the current process handle, and not `INVALID_HANDLE_VALUE`,
27
- /// despite the two having the same value. See [here] for the full story.
26
+ /// represents a valid handle value, such as [the current process handle], and
27
+ /// not `INVALID_HANDLE_VALUE`, despite the two having the same value. See
28
+ /// [here] for the full story.
28
29
///
29
30
/// And, it *may* have the value `NULL` (0), which can occur when consoles are
30
31
/// detached from processes, or when `windows_subsystem` is used.
@@ -34,6 +35,7 @@ use crate::sys_common::{AsInner, FromInner, IntoInner};
34
35
/// handle, which is then borrowed under the same lifetime.
35
36
///
36
37
/// [here]: https://devblogs.microsoft.com/oldnewthing/20040302-00/?p=40443
38
+ /// [the current process handle]: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentprocess#remarks
37
39
#[ derive( Copy , Clone ) ]
38
40
#[ repr( transparent) ]
39
41
#[ unstable( feature = "io_safety" , issue = "87074" ) ]
@@ -47,8 +49,9 @@ pub struct BorrowedHandle<'handle> {
47
49
/// This closes the handle on drop.
48
50
///
49
51
/// Note that it *may* have the value `-1`, which in `OwnedHandle` always
50
- /// represents the current process handle, and not `INVALID_HANDLE_VALUE`,
51
- /// despite the two having the same value. See [here] for the full story.
52
+ /// represents a valid handle value, such as [the current process handle], and
53
+ /// not `INVALID_HANDLE_VALUE`, despite the two having the same value. See
54
+ /// [here] for the full story.
52
55
///
53
56
/// And, it *may* have the value `NULL` (0), which can occur when consoles are
54
57
/// detached from processes, or when `windows_subsystem` is used.
@@ -61,6 +64,7 @@ pub struct BorrowedHandle<'handle> {
61
64
/// [`RegCloseKey`]: https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regclosekey
62
65
///
63
66
/// [here]: https://devblogs.microsoft.com/oldnewthing/20040302-00/?p=40443
67
+ /// [the current process handle]: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentprocess#remarks
64
68
#[ repr( transparent) ]
65
69
#[ unstable( feature = "io_safety" , issue = "87074" ) ]
66
70
pub struct OwnedHandle {
@@ -78,10 +82,11 @@ pub struct OwnedHandle {
78
82
/// checking for `NULL` first.
79
83
///
80
84
/// This type may hold any handle value that [`OwnedHandle`] may hold. As with `OwnedHandle`, when
81
- /// it holds `-1`, that value is interpreted as the current process handle, and not
82
- /// `INVALID_HANDLE_VALUE`.
85
+ /// it holds `-1`, that value is interpreted as a valid handle value, such as
86
+ /// [the current process handle], and not `INVALID_HANDLE_VALUE`.
83
87
///
84
88
/// If this holds a non-null handle, it will close the handle on drop.
89
+ /// [the current process handle]: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getcurrentprocess#remarks
85
90
#[ repr( transparent) ]
86
91
#[ unstable( feature = "io_safety" , issue = "87074" ) ]
87
92
#[ derive( Debug ) ]
0 commit comments