File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
src/libstd/sys/windows/ext Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ use os::windows::raw;
1515use net;
1616use sys_common:: { self , AsInner , FromInner , IntoInner } ;
1717use sys;
18+ use io;
1819use sys:: c;
1920
2021/// Raw HANDLEs.
@@ -71,6 +72,27 @@ impl AsRawHandle for fs::File {
7172 }
7273}
7374
75+ #[ stable( feature = "asraw_stdio" , since = "1.21.0" ) ]
76+ impl AsRawHandle for io:: Stdin {
77+ fn as_raw_handle ( & self ) -> RawHandle {
78+ unsafe { c:: GetStdHandle ( c:: STD_INPUT_HANDLE ) } as RawHandle
79+ }
80+ }
81+
82+ #[ stable( feature = "asraw_stdio" , since = "1.21.0" ) ]
83+ impl AsRawHandle for io:: Stdout {
84+ fn as_raw_handle ( & self ) -> RawHandle {
85+ unsafe { c:: GetStdHandle ( c:: STD_OUTPUT_HANDLE ) } as RawHandle
86+ }
87+ }
88+
89+ #[ stable( feature = "asraw_stdio" , since = "1.21.0" ) ]
90+ impl AsRawHandle for io:: Stderr {
91+ fn as_raw_handle ( & self ) -> RawHandle {
92+ unsafe { c:: GetStdHandle ( c:: STD_ERROR_HANDLE ) } as RawHandle
93+ }
94+ }
95+
7496#[ stable( feature = "from_raw_os" , since = "1.1.0" ) ]
7597impl FromRawHandle for fs:: File {
7698 unsafe fn from_raw_handle ( handle : RawHandle ) -> fs:: File {
You can’t perform that action at this time.
0 commit comments