2 * Wine server communication
4 * Copyright (C) 1998 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #include <sys/types.h>
29 #define WIN32_NO_STATUS
32 #include "wine/server.h"
33 #include "wine/debug.h"
34 #include "ntdll_misc.h"
36 BOOL is_wow64
= FALSE
;
38 /***********************************************************************
39 * wine_server_call (NTDLL.@)
41 * Perform a server call.
44 * req_ptr [I/O] Function dependent data
47 * Depends on server function being called, but usually an NTSTATUS code.
50 * Use the SERVER_START_REQ and SERVER_END_REQ to help you fill out the
51 * server request structure for the particular call. E.g:
52 *| SERVER_START_REQ( event_op )
54 *| req->handle = handle;
55 *| req->op = SET_EVENT;
56 *| ret = wine_server_call( req );
60 unsigned int CDECL
wine_server_call( void *req_ptr
)
62 return unix_funcs
->server_call( req_ptr
);
66 /***********************************************************************
67 * wine_server_send_fd (NTDLL.@)
69 * Send a file descriptor to the server.
72 * fd [I] file descriptor to send
77 void CDECL
wine_server_send_fd( int fd
)
79 unix_funcs
->server_send_fd( fd
);
83 /***********************************************************************
84 * wine_server_fd_to_handle (NTDLL.@)
86 * Allocate a file handle for a Unix file descriptor.
89 * fd [I] Unix file descriptor.
90 * access [I] Win32 access flags.
91 * attributes [I] Object attributes.
92 * handle [O] Address where Wine file handle will be stored.
97 int CDECL
wine_server_fd_to_handle( int fd
, unsigned int access
, unsigned int attributes
, HANDLE
*handle
)
99 return unix_funcs
->server_fd_to_handle( fd
, access
, attributes
, handle
);
103 /***********************************************************************
104 * wine_server_handle_to_fd (NTDLL.@)
106 * Retrieve the file descriptor corresponding to a file handle.
109 * handle [I] Wine file handle.
110 * access [I] Win32 file access rights requested.
111 * unix_fd [O] Address where Unix file descriptor will be stored.
112 * options [O] Address where the file open options will be stored. Optional.
117 int CDECL
wine_server_handle_to_fd( HANDLE handle
, unsigned int access
, int *unix_fd
,
118 unsigned int *options
)
120 return unix_funcs
->server_handle_to_fd( handle
, access
, unix_fd
, options
);
124 /***********************************************************************
125 * wine_server_release_fd (NTDLL.@)
127 * Release the Unix file descriptor returned by wine_server_handle_to_fd.
130 * handle [I] Wine file handle.
131 * unix_fd [I] Unix file descriptor to release.
136 void CDECL
wine_server_release_fd( HANDLE handle
, int unix_fd
)
138 unix_funcs
->server_release_fd( handle
, unix_fd
);