wined3d: Correctly destroy the adapter on format initialization failure in no3d mode.
[wine/zf.git] / dlls / ntdll / server.c
bloba3ad3e6887159c9e2d915321ac3c9a29c1acb2b2
1 /*
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
21 #include <assert.h>
22 #include <ctype.h>
23 #include <stdarg.h>
24 #include <stdio.h>
25 #include <string.h>
26 #include <sys/types.h>
28 #include "ntstatus.h"
29 #define WIN32_NO_STATUS
30 #include "windef.h"
31 #include "winnt.h"
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.
43 * PARAMS
44 * req_ptr [I/O] Function dependent data
46 * RETURNS
47 * Depends on server function being called, but usually an NTSTATUS code.
49 * NOTES
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 )
53 *| {
54 *| req->handle = handle;
55 *| req->op = SET_EVENT;
56 *| ret = wine_server_call( req );
57 *| }
58 *| SERVER_END_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.
71 * PARAMS
72 * fd [I] file descriptor to send
74 * RETURNS
75 * nothing
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.
88 * PARAMS
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.
94 * RETURNS
95 * NTSTATUS code
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.
108 * PARAMS
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.
114 * RETURNS
115 * NTSTATUS code
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.
129 * PARAMS
130 * handle [I] Wine file handle.
131 * unix_fd [I] Unix file descriptor to release.
133 * RETURNS
134 * nothing
136 void CDECL wine_server_release_fd( HANDLE handle, int unix_fd )
138 unix_funcs->server_release_fd( handle, unix_fd );