ntdll: Use syscall thunks for system functions.
[wine.git] / dlls / ntdll / unixlib.h
blob931a681e167fa0a6de2c907fb0718b26c1d16413
1 /*
2 * Ntdll Unix interface
4 * Copyright (C) 2020 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 #ifndef __NTDLL_UNIXLIB_H
22 #define __NTDLL_UNIXLIB_H
24 #include "wine/server.h"
25 #include "wine/debug.h"
27 struct msghdr;
28 struct _DISPATCHER_CONTEXT;
30 /* increment this when you change the function table */
31 #define NTDLL_UNIXLIB_VERSION 87
33 struct unix_funcs
35 /* Nt* functions */
36 NTSTATUS (WINAPI *NtClose)( HANDLE handle );
37 TEB * (WINAPI *NtCurrentTeb)(void);
38 NTSTATUS (WINAPI *NtDuplicateObject)( HANDLE source_process, HANDLE source,
39 HANDLE dest_process, HANDLE *dest,
40 ACCESS_MASK access, ULONG attributes, ULONG options );
41 NTSTATUS (WINAPI *NtGetContextThread)( HANDLE handle, CONTEXT *context );
42 NTSTATUS (WINAPI *NtQueryObject)( HANDLE handle, OBJECT_INFORMATION_CLASS info_class,
43 void *ptr, ULONG len, ULONG *used_len );
44 NTSTATUS (WINAPI *NtQueryPerformanceCounter)( LARGE_INTEGER *counter, LARGE_INTEGER *frequency );
45 NTSTATUS (WINAPI *NtSetInformationObject)( HANDLE handle, OBJECT_INFORMATION_CLASS info_class,
46 void *ptr, ULONG len );
48 /* other Win32 API functions */
49 NTSTATUS (WINAPI *DbgUiIssueRemoteBreakin)( HANDLE process );
50 LONGLONG (WINAPI *RtlGetSystemTimePrecise)(void);
51 NTSTATUS (WINAPI *RtlWaitOnAddress)( const void *addr, const void *cmp, SIZE_T size,
52 const LARGE_INTEGER *timeout );
53 void (WINAPI *RtlWakeAddressAll)( const void *addr );
54 void (WINAPI *RtlWakeAddressSingle)( const void *addr );
56 /* fast locks */
57 NTSTATUS (CDECL *fast_RtlpWaitForCriticalSection)( RTL_CRITICAL_SECTION *crit, int timeout );
58 NTSTATUS (CDECL *fast_RtlpUnWaitCriticalSection)( RTL_CRITICAL_SECTION *crit );
59 NTSTATUS (CDECL *fast_RtlDeleteCriticalSection)( RTL_CRITICAL_SECTION *crit );
60 NTSTATUS (CDECL *fast_RtlTryAcquireSRWLockExclusive)( RTL_SRWLOCK *lock );
61 NTSTATUS (CDECL *fast_RtlAcquireSRWLockExclusive)( RTL_SRWLOCK *lock );
62 NTSTATUS (CDECL *fast_RtlTryAcquireSRWLockShared)( RTL_SRWLOCK *lock );
63 NTSTATUS (CDECL *fast_RtlAcquireSRWLockShared)( RTL_SRWLOCK *lock );
64 NTSTATUS (CDECL *fast_RtlReleaseSRWLockExclusive)( RTL_SRWLOCK *lock );
65 NTSTATUS (CDECL *fast_RtlReleaseSRWLockShared)( RTL_SRWLOCK *lock );
66 NTSTATUS (CDECL *fast_RtlSleepConditionVariableSRW)( RTL_CONDITION_VARIABLE *variable,
67 RTL_SRWLOCK *lock,
68 const LARGE_INTEGER *timeout, ULONG flags );
69 NTSTATUS (CDECL *fast_RtlSleepConditionVariableCS)( RTL_CONDITION_VARIABLE *variable,
70 RTL_CRITICAL_SECTION *cs,
71 const LARGE_INTEGER *timeout );
72 NTSTATUS (CDECL *fast_RtlWakeConditionVariable)( RTL_CONDITION_VARIABLE *variable, int count );
74 /* math functions */
75 double (CDECL *atan)( double d );
76 double (CDECL *ceil)( double d );
77 double (CDECL *cos)( double d );
78 double (CDECL *fabs)( double d );
79 double (CDECL *floor)( double d );
80 double (CDECL *log)( double d );
81 double (CDECL *pow)( double x, double y );
82 double (CDECL *sin)( double d );
83 double (CDECL *sqrt)( double d );
84 double (CDECL *tan)( double d );
86 /* environment functions */
87 NTSTATUS (CDECL *get_initial_environment)( WCHAR **wargv[], WCHAR *env, SIZE_T *size );
88 NTSTATUS (CDECL *get_startup_info)( startup_info_t *info, SIZE_T *total_size, SIZE_T *info_size );
89 NTSTATUS (CDECL *get_dynamic_environment)( WCHAR *env, SIZE_T *size );
90 void (CDECL *get_initial_console)( HANDLE *handle, HANDLE *std_in,
91 HANDLE *std_out, HANDLE *std_err );
92 void (CDECL *get_initial_directory)( UNICODE_STRING *dir );
93 USHORT * (CDECL *get_unix_codepage_data)(void);
94 void (CDECL *get_locales)( WCHAR *sys, WCHAR *user );
95 const char * (CDECL *get_version)(void);
96 const char * (CDECL *get_build_id)(void);
97 void (CDECL *get_host_version)( const char **sysname, const char **release );
99 /* virtual memory functions */
100 NTSTATUS (CDECL *virtual_map_section)( HANDLE handle, PVOID *addr_ptr, unsigned short zero_bits_64, SIZE_T commit_size,
101 const LARGE_INTEGER *offset_ptr, SIZE_T *size_ptr, ULONG alloc_type,
102 ULONG protect, pe_image_info_t *image_info );
103 NTSTATUS (CDECL *virtual_alloc_thread_stack)( INITIAL_TEB *stack, SIZE_T reserve_size, SIZE_T commit_size, SIZE_T *pthread_size );
104 ssize_t (CDECL *virtual_locked_recvmsg)( int fd, struct msghdr *hdr, int flags );
105 void (CDECL *virtual_release_address_space)(void);
106 void (CDECL *virtual_set_large_address_space)(void);
108 /* thread/process functions */
109 void (CDECL *exit_thread)( int status );
110 void (CDECL *exit_process)( int status );
111 NTSTATUS (CDECL *exec_process)( UNICODE_STRING *path, UNICODE_STRING *cmdline, NTSTATUS status );
113 /* server functions */
114 unsigned int (CDECL *server_call)( void *req_ptr );
115 void (CDECL *server_send_fd)( int fd );
116 NTSTATUS (CDECL *server_fd_to_handle)( int fd, unsigned int access, unsigned int attributes,
117 HANDLE *handle );
118 NTSTATUS (CDECL *server_handle_to_fd)( HANDLE handle, unsigned int access, int *unix_fd,
119 unsigned int *options );
120 void (CDECL *server_release_fd)( HANDLE handle, int unix_fd );
121 void (CDECL *server_init_process_done)( void *relay );
123 /* file functions */
124 NTSTATUS (CDECL *nt_to_unix_file_name)( const UNICODE_STRING *nameW, char *nameA, SIZE_T *size,
125 UINT disposition );
126 NTSTATUS (CDECL *unix_to_nt_file_name)( const char *name, WCHAR *buffer, SIZE_T *size );
127 void (CDECL *set_show_dot_files)( BOOL enable );
129 /* loader functions */
130 NTSTATUS (CDECL *load_so_dll)( UNICODE_STRING *nt_name, void **module );
131 NTSTATUS (CDECL *load_builtin_dll)( const WCHAR *name, void **module,
132 pe_image_info_t *image_info );
133 NTSTATUS (CDECL *unload_builtin_dll)( void *module );
134 void (CDECL *init_builtin_dll)( void *module );
135 NTSTATUS (CDECL *unwind_builtin_dll)( ULONG type, struct _DISPATCHER_CONTEXT *dispatch,
136 CONTEXT *context );
138 /* debugging functions */
139 unsigned char (CDECL *dbg_get_channel_flags)( struct __wine_debug_channel *channel );
140 const char * (CDECL *dbg_strdup)( const char *str );
141 int (CDECL *dbg_output)( const char *str );
142 int (CDECL *dbg_header)( enum __wine_debug_class cls, struct __wine_debug_channel *channel,
143 const char *function );
146 #endif /* __NTDLL_UNIXLIB_H */