1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 use shared::minwindef::{BOOL, DWORD, LPDWORD, LPVOID, ULONG};
7 use um::minwinbase::{LPOVERLAPPED, LPSECURITY_ATTRIBUTES};
8 use um::winnt::{HANDLE, LPCWSTR, LPWSTR, PHANDLE};
9 extern "system" {
CreatePipe( hReadPipe: PHANDLE, hWritePipe: PHANDLE, lpPipeAttributes: LPSECURITY_ATTRIBUTES, nSize: DWORD, ) -> BOOL10     pub fn CreatePipe(
11         hReadPipe: PHANDLE,
12         hWritePipe: PHANDLE,
13         lpPipeAttributes: LPSECURITY_ATTRIBUTES,
14         nSize: DWORD,
15     ) -> BOOL;
ConnectNamedPipe( hNamedPipe: HANDLE, lpOverlapped: LPOVERLAPPED, ) -> BOOL16     pub fn ConnectNamedPipe(
17         hNamedPipe: HANDLE,
18         lpOverlapped: LPOVERLAPPED,
19     ) -> BOOL;
DisconnectNamedPipe( hNamedPipe: HANDLE, ) -> BOOL20     pub fn DisconnectNamedPipe(
21         hNamedPipe: HANDLE,
22     ) -> BOOL;
SetNamedPipeHandleState( hNamedPipe: HANDLE, lpMode: LPDWORD, lpMaxCollectionCount: LPDWORD, lpCollectDataTimeout: LPDWORD, ) -> BOOL23     pub fn SetNamedPipeHandleState(
24         hNamedPipe: HANDLE,
25         lpMode: LPDWORD,
26         lpMaxCollectionCount: LPDWORD,
27         lpCollectDataTimeout: LPDWORD,
28     ) -> BOOL;
PeekNamedPipe( hNamedPipe: HANDLE, lpBuffer: LPVOID, nBufferSize: DWORD, lpBytesRead: LPDWORD, lpTotalBytesAvail: LPDWORD, lpBytesLeftThisMessage: LPDWORD, ) -> BOOL29     pub fn PeekNamedPipe(
30         hNamedPipe: HANDLE,
31         lpBuffer: LPVOID,
32         nBufferSize: DWORD,
33         lpBytesRead: LPDWORD,
34         lpTotalBytesAvail: LPDWORD,
35         lpBytesLeftThisMessage: LPDWORD,
36     ) -> BOOL;
TransactNamedPipe( hNamedPipe: HANDLE, lpInBuffer: LPVOID, nInBufferSize: DWORD, lpOutBuffer: LPVOID, nOutBufferSize: DWORD, lpBytesRead: LPDWORD, lpOverlapped: LPOVERLAPPED, ) -> BOOL37     pub fn TransactNamedPipe(
38         hNamedPipe: HANDLE,
39         lpInBuffer: LPVOID,
40         nInBufferSize: DWORD,
41         lpOutBuffer: LPVOID,
42         nOutBufferSize: DWORD,
43         lpBytesRead: LPDWORD,
44         lpOverlapped: LPOVERLAPPED,
45     ) -> BOOL;
CreateNamedPipeW( lpName: LPCWSTR, dwOpenMode: DWORD, dwPipeMode: DWORD, nMaxInstances: DWORD, nOutBufferSize: DWORD, nInBufferSize: DWORD, nDefaultTimeOut: DWORD, lpSecurityAttributes: LPSECURITY_ATTRIBUTES, ) -> HANDLE46     pub fn CreateNamedPipeW(
47         lpName: LPCWSTR,
48         dwOpenMode: DWORD,
49         dwPipeMode: DWORD,
50         nMaxInstances: DWORD,
51         nOutBufferSize: DWORD,
52         nInBufferSize: DWORD,
53         nDefaultTimeOut: DWORD,
54         lpSecurityAttributes: LPSECURITY_ATTRIBUTES,
55     ) -> HANDLE;
WaitNamedPipeW( lpNamedPipeName: LPCWSTR, nTimeOut: DWORD, ) -> BOOL56     pub fn WaitNamedPipeW(
57         lpNamedPipeName: LPCWSTR,
58         nTimeOut: DWORD,
59     ) -> BOOL;
GetNamedPipeClientComputerNameW( Pipe: HANDLE, ClientComputerName: LPWSTR, ClientComputerNameLength: ULONG, ) -> BOOL60     pub fn GetNamedPipeClientComputerNameW(
61         Pipe: HANDLE,
62         ClientComputerName: LPWSTR,
63         ClientComputerNameLength: ULONG,
64     ) -> BOOL;
ImpersonateNamedPipeClient( hNamedPipe: HANDLE, ) -> BOOL65     pub fn ImpersonateNamedPipeClient(
66         hNamedPipe: HANDLE,
67     ) -> BOOL;
GetNamedPipeInfo( hNamedPipe: HANDLE, lpFlags: LPDWORD, lpOutBufferSize: LPDWORD, lpInBufferSize: LPDWORD, lpMaxInstances: LPDWORD, ) -> BOOL68     pub fn GetNamedPipeInfo(
69         hNamedPipe: HANDLE,
70         lpFlags: LPDWORD,
71         lpOutBufferSize: LPDWORD,
72         lpInBufferSize: LPDWORD,
73         lpMaxInstances: LPDWORD,
74     ) -> BOOL;
GetNamedPipeHandleStateW( hNamedPipe: HANDLE, lpState: LPDWORD, lpCurInstances: LPDWORD, lpMaxCollectionCount: LPDWORD, lpCollectDataTimeout: LPDWORD, lpUserName: LPWSTR, nMaxUserNameSize: DWORD, ) -> BOOL75     pub fn GetNamedPipeHandleStateW(
76         hNamedPipe: HANDLE,
77         lpState: LPDWORD,
78         lpCurInstances: LPDWORD,
79         lpMaxCollectionCount: LPDWORD,
80         lpCollectDataTimeout: LPDWORD,
81         lpUserName: LPWSTR,
82         nMaxUserNameSize: DWORD,
83     ) -> BOOL;
CallNamedPipeW( lpNamedPipeName: LPCWSTR, lpInBuffer: LPVOID, nInBufferSize: DWORD, lpOutBuffer: LPVOID, nOutBufferSize: DWORD, lpBytesRead: LPDWORD, nTimeOut: DWORD, ) -> BOOL84     pub fn CallNamedPipeW(
85         lpNamedPipeName: LPCWSTR,
86         lpInBuffer: LPVOID,
87         nInBufferSize: DWORD,
88         lpOutBuffer: LPVOID,
89         nOutBufferSize: DWORD,
90         lpBytesRead: LPDWORD,
91         nTimeOut: DWORD,
92     ) -> BOOL;
93 }
94