2 * Win32 process handles
4 * Copyright 1998 Alexandre Julliard
14 DEFAULT_DEBUG_CHANNEL(win32
)
16 /*********************************************************************
17 * CloseHandle (KERNEL32.23)
19 BOOL WINAPI
CloseHandle( HANDLE handle
)
21 struct close_handle_request req
;
24 CLIENT_SendRequest( REQ_CLOSE_HANDLE
, -1, 1, &req
, sizeof(req
) );
25 return !CLIENT_WaitReply( NULL
, NULL
, 0 );
29 /*********************************************************************
30 * GetHandleInformation (KERNEL32.336)
32 BOOL WINAPI
GetHandleInformation( HANDLE handle
, LPDWORD flags
)
34 struct get_handle_info_request req
;
35 struct get_handle_info_reply reply
;
38 CLIENT_SendRequest( REQ_GET_HANDLE_INFO
, -1, 1, &req
, sizeof(req
) );
39 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
)) return FALSE
;
40 if (flags
) *flags
= reply
.flags
;
45 /*********************************************************************
46 * SetHandleInformation (KERNEL32.653)
48 BOOL WINAPI
SetHandleInformation( HANDLE handle
, DWORD mask
, DWORD flags
)
50 struct set_handle_info_request req
;
55 CLIENT_SendRequest( REQ_SET_HANDLE_INFO
, -1, 1, &req
, sizeof(req
) );
56 return !CLIENT_WaitReply( NULL
, NULL
, 0 );
60 /*********************************************************************
61 * DuplicateHandle (KERNEL32.192)
63 BOOL WINAPI
DuplicateHandle( HANDLE source_process
, HANDLE source
,
64 HANDLE dest_process
, HANDLE
*dest
,
65 DWORD access
, BOOL inherit
, DWORD options
)
67 struct dup_handle_request req
;
68 struct dup_handle_reply reply
;
70 req
.src_process
= source_process
;
71 req
.src_handle
= source
;
72 req
.dst_process
= dest_process
;
74 req
.inherit
= inherit
;
75 req
.options
= options
;
77 CLIENT_SendRequest( REQ_DUP_HANDLE
, -1, 1, &req
, sizeof(req
) );
78 if (CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
)) return FALSE
;
79 if (dest
) *dest
= reply
.handle
;
84 /***********************************************************************
85 * ConvertToGlobalHandle (KERNEL32)
87 HANDLE WINAPI
ConvertToGlobalHandle(HANDLE hSrc
)
89 struct dup_handle_request req
;
90 struct dup_handle_reply reply
;
92 req
.src_process
= GetCurrentProcess();
93 req
.src_handle
= hSrc
;
97 req
.options
= DUP_HANDLE_MAKE_GLOBAL
| DUP_HANDLE_SAME_ACCESS
;
99 CLIENT_SendRequest( REQ_DUP_HANDLE
, -1, 1, &req
, sizeof(req
) );
100 CLIENT_WaitSimpleReply( &reply
, sizeof(reply
), NULL
);
104 /***********************************************************************
105 * SetHandleContext (KERNEL32)
107 BOOL WINAPI
SetHandleContext(HANDLE hnd
,DWORD context
) {
108 FIXME(win32
,"(%d,%ld), stub. The external WSOCK32 will not work with WINE, do not use it.\n",hnd
,context
);
109 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
113 /***********************************************************************
114 * GetHandleContext (KERNEL32)
116 DWORD WINAPI
GetHandleContext(HANDLE hnd
) {
117 FIXME(win32
,"(%d), stub. The external WSOCK32 will not work with WINE, do not use it.\n",hnd
);
118 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
122 /***********************************************************************
123 * CreateSocketHandle (KERNEL32)
125 HANDLE WINAPI
CreateSocketHandle(void) {
126 FIXME(win32
,"(), stub. The external WSOCK32 will not work with WINE, do not use it.\n");
127 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
128 return INVALID_HANDLE_VALUE
;