20 #ifndef WINPR_HANDLE_H
21 #define WINPR_HANDLE_H
26 #include <winpr/winpr.h>
27 #include <winpr/wtypes.h>
28 #include <winpr/security.h>
35 #define WINPR_FD_READ_BIT 0
36 #define WINPR_FD_READ (1 << WINPR_FD_READ_BIT)
38 #define WINPR_FD_WRITE_BIT 1
39 #define WINPR_FD_WRITE (1 << WINPR_FD_WRITE_BIT)
43 #define DUPLICATE_CLOSE_SOURCE 0x00000001
44 #define DUPLICATE_SAME_ACCESS 0x00000002
46 #define HANDLE_FLAG_INHERIT 0x00000001
47 #define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002
49 WINPR_API BOOL CloseHandle(HANDLE hObject);
51 WINPR_API BOOL DuplicateHandle(HANDLE hSourceProcessHandle, HANDLE hSourceHandle,
52 HANDLE hTargetProcessHandle, LPHANDLE lpTargetHandle,
53 DWORD dwDesiredAccess, BOOL bInheritHandle, DWORD dwOptions);
55 WINPR_API BOOL GetHandleInformation(HANDLE hObject, LPDWORD lpdwFlags);
56 WINPR_API BOOL SetHandleInformation(HANDLE hObject, DWORD dwMask, DWORD dwFlags);