FreeRDP
include/winpr/handle.h
1 
20 #ifndef WINPR_HANDLE_H
21 #define WINPR_HANDLE_H
22 
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <string.h>
26 #include <winpr/winpr.h>
27 #include <winpr/wtypes.h>
28 #include <winpr/security.h>
29 
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif
34 
35 #define WINPR_FD_READ_BIT 0
36 #define WINPR_FD_READ (1 << WINPR_FD_READ_BIT)
37 
38 #define WINPR_FD_WRITE_BIT 1
39 #define WINPR_FD_WRITE (1 << WINPR_FD_WRITE_BIT)
40 
41 #ifndef _WIN32
42 
43 #define DUPLICATE_CLOSE_SOURCE 0x00000001
44 #define DUPLICATE_SAME_ACCESS 0x00000002
45 
46 #define HANDLE_FLAG_INHERIT 0x00000001
47 #define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002
48 
49  WINPR_API BOOL CloseHandle(HANDLE hObject);
50 
51  WINPR_API BOOL DuplicateHandle(HANDLE hSourceProcessHandle, HANDLE hSourceHandle,
52  HANDLE hTargetProcessHandle, LPHANDLE lpTargetHandle,
53  DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwOptions);
54 
55  WINPR_API BOOL GetHandleInformation(HANDLE hObject, LPDWORD lpdwFlags);
56  WINPR_API BOOL SetHandleInformation(HANDLE hObject, DWORD dwMask, DWORD dwFlags);
57 
58 #endif
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
64 #endif /* WINPR_HANDLE_H */