2020-05-14 15:17:06 +02:00
|
|
|
/*
|
|
|
|
* Ntdll Unix interface
|
|
|
|
*
|
|
|
|
* Copyright (C) 2020 Alexandre Julliard
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __NTDLL_UNIXLIB_H
|
|
|
|
#define __NTDLL_UNIXLIB_H
|
|
|
|
|
2020-05-29 14:17:55 +02:00
|
|
|
#include "wine/server.h"
|
2020-05-17 11:07:02 +02:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
2020-06-02 17:08:59 +02:00
|
|
|
struct msghdr;
|
2020-06-25 10:32:47 +02:00
|
|
|
struct _DISPATCHER_CONTEXT;
|
2020-06-01 12:52:05 +02:00
|
|
|
|
2020-05-14 15:17:06 +02:00
|
|
|
/* increment this when you change the function table */
|
2020-07-22 14:27:33 +02:00
|
|
|
#define NTDLL_UNIXLIB_VERSION 93
|
2020-05-14 15:17:06 +02:00
|
|
|
|
|
|
|
struct unix_funcs
|
|
|
|
{
|
2020-05-30 14:21:09 +02:00
|
|
|
/* Nt* functions */
|
2020-06-01 12:52:05 +02:00
|
|
|
TEB * (WINAPI *NtCurrentTeb)(void);
|
2020-05-30 14:21:09 +02:00
|
|
|
|
2020-06-05 16:54:17 +02:00
|
|
|
/* other Win32 API functions */
|
|
|
|
NTSTATUS (WINAPI *DbgUiIssueRemoteBreakin)( HANDLE process );
|
2020-06-25 18:07:38 +02:00
|
|
|
LONGLONG (WINAPI *RtlGetSystemTimePrecise)(void);
|
2020-06-09 12:39:49 +02:00
|
|
|
NTSTATUS (WINAPI *RtlWaitOnAddress)( const void *addr, const void *cmp, SIZE_T size,
|
|
|
|
const LARGE_INTEGER *timeout );
|
|
|
|
void (WINAPI *RtlWakeAddressAll)( const void *addr );
|
|
|
|
void (WINAPI *RtlWakeAddressSingle)( const void *addr );
|
2020-06-05 16:54:17 +02:00
|
|
|
|
2020-06-09 12:35:01 +02:00
|
|
|
/* fast locks */
|
2020-06-09 13:05:58 +02:00
|
|
|
NTSTATUS (CDECL *fast_RtlpWaitForCriticalSection)( RTL_CRITICAL_SECTION *crit, int timeout );
|
|
|
|
NTSTATUS (CDECL *fast_RtlpUnWaitCriticalSection)( RTL_CRITICAL_SECTION *crit );
|
|
|
|
NTSTATUS (CDECL *fast_RtlDeleteCriticalSection)( RTL_CRITICAL_SECTION *crit );
|
2020-06-09 12:35:01 +02:00
|
|
|
NTSTATUS (CDECL *fast_RtlTryAcquireSRWLockExclusive)( RTL_SRWLOCK *lock );
|
|
|
|
NTSTATUS (CDECL *fast_RtlAcquireSRWLockExclusive)( RTL_SRWLOCK *lock );
|
|
|
|
NTSTATUS (CDECL *fast_RtlTryAcquireSRWLockShared)( RTL_SRWLOCK *lock );
|
|
|
|
NTSTATUS (CDECL *fast_RtlAcquireSRWLockShared)( RTL_SRWLOCK *lock );
|
|
|
|
NTSTATUS (CDECL *fast_RtlReleaseSRWLockExclusive)( RTL_SRWLOCK *lock );
|
|
|
|
NTSTATUS (CDECL *fast_RtlReleaseSRWLockShared)( RTL_SRWLOCK *lock );
|
2020-06-09 12:38:37 +02:00
|
|
|
NTSTATUS (CDECL *fast_RtlSleepConditionVariableSRW)( RTL_CONDITION_VARIABLE *variable,
|
|
|
|
RTL_SRWLOCK *lock,
|
|
|
|
const LARGE_INTEGER *timeout, ULONG flags );
|
|
|
|
NTSTATUS (CDECL *fast_RtlSleepConditionVariableCS)( RTL_CONDITION_VARIABLE *variable,
|
|
|
|
RTL_CRITICAL_SECTION *cs,
|
|
|
|
const LARGE_INTEGER *timeout );
|
|
|
|
NTSTATUS (CDECL *fast_RtlWakeConditionVariable)( RTL_CONDITION_VARIABLE *variable, int count );
|
2020-06-09 12:35:01 +02:00
|
|
|
|
2020-06-26 09:12:11 +02:00
|
|
|
/* math functions */
|
|
|
|
double (CDECL *atan)( double d );
|
|
|
|
double (CDECL *ceil)( double d );
|
|
|
|
double (CDECL *cos)( double d );
|
|
|
|
double (CDECL *fabs)( double d );
|
|
|
|
double (CDECL *floor)( double d );
|
|
|
|
double (CDECL *log)( double d );
|
|
|
|
double (CDECL *pow)( double x, double y );
|
|
|
|
double (CDECL *sin)( double d );
|
|
|
|
double (CDECL *sqrt)( double d );
|
|
|
|
double (CDECL *tan)( double d );
|
|
|
|
|
2020-05-17 11:09:30 +02:00
|
|
|
/* environment functions */
|
2020-06-11 10:50:11 +02:00
|
|
|
NTSTATUS (CDECL *get_initial_environment)( WCHAR **wargv[], WCHAR *env, SIZE_T *size );
|
2020-06-29 12:10:58 +02:00
|
|
|
NTSTATUS (CDECL *get_startup_info)( startup_info_t *info, SIZE_T *total_size, SIZE_T *info_size );
|
2020-06-24 09:21:48 +02:00
|
|
|
NTSTATUS (CDECL *get_dynamic_environment)( WCHAR *env, SIZE_T *size );
|
2020-06-29 10:39:27 +02:00
|
|
|
void (CDECL *get_initial_console)( HANDLE *handle, HANDLE *std_in,
|
|
|
|
HANDLE *std_out, HANDLE *std_err );
|
2020-06-17 16:19:38 +02:00
|
|
|
void (CDECL *get_initial_directory)( UNICODE_STRING *dir );
|
2020-07-01 10:37:16 +02:00
|
|
|
USHORT * (CDECL *get_unix_codepage_data)(void);
|
2020-06-11 11:38:16 +02:00
|
|
|
void (CDECL *get_locales)( WCHAR *sys, WCHAR *user );
|
2020-05-17 11:09:30 +02:00
|
|
|
const char * (CDECL *get_version)(void);
|
|
|
|
const char * (CDECL *get_build_id)(void);
|
|
|
|
void (CDECL *get_host_version)( const char **sysname, const char **release );
|
|
|
|
|
2020-05-17 11:04:47 +02:00
|
|
|
/* virtual memory functions */
|
2020-06-02 17:08:59 +02:00
|
|
|
NTSTATUS (CDECL *virtual_map_section)( HANDLE handle, PVOID *addr_ptr, unsigned short zero_bits_64, SIZE_T commit_size,
|
|
|
|
const LARGE_INTEGER *offset_ptr, SIZE_T *size_ptr, ULONG alloc_type,
|
|
|
|
ULONG protect, pe_image_info_t *image_info );
|
|
|
|
ssize_t (CDECL *virtual_locked_recvmsg)( int fd, struct msghdr *hdr, int flags );
|
|
|
|
void (CDECL *virtual_release_address_space)(void);
|
2020-05-17 11:07:02 +02:00
|
|
|
|
2020-06-01 12:52:05 +02:00
|
|
|
/* thread/process functions */
|
2020-06-18 09:05:30 +02:00
|
|
|
NTSTATUS (CDECL *exec_process)( UNICODE_STRING *path, UNICODE_STRING *cmdline, NTSTATUS status );
|
2020-06-01 12:52:05 +02:00
|
|
|
|
2020-05-29 14:17:55 +02:00
|
|
|
/* server functions */
|
2020-05-29 15:53:42 +02:00
|
|
|
unsigned int (CDECL *server_call)( void *req_ptr );
|
2020-05-29 14:17:55 +02:00
|
|
|
void (CDECL *server_send_fd)( int fd );
|
2020-05-29 15:35:16 +02:00
|
|
|
NTSTATUS (CDECL *server_fd_to_handle)( int fd, unsigned int access, unsigned int attributes,
|
|
|
|
HANDLE *handle );
|
|
|
|
NTSTATUS (CDECL *server_handle_to_fd)( HANDLE handle, unsigned int access, int *unix_fd,
|
|
|
|
unsigned int *options );
|
|
|
|
void (CDECL *server_release_fd)( HANDLE handle, int unix_fd );
|
2020-06-09 12:32:41 +02:00
|
|
|
void (CDECL *server_init_process_done)( void *relay );
|
2020-05-29 14:17:55 +02:00
|
|
|
|
2020-06-12 14:20:16 +02:00
|
|
|
/* file functions */
|
2020-07-09 09:59:08 +02:00
|
|
|
NTSTATUS (CDECL *nt_to_unix_file_name)( const UNICODE_STRING *nameW, char *nameA, SIZE_T *size,
|
2020-06-26 14:26:55 +02:00
|
|
|
UINT disposition );
|
2020-07-09 10:03:15 +02:00
|
|
|
NTSTATUS (CDECL *unix_to_nt_file_name)( const char *name, WCHAR *buffer, SIZE_T *size );
|
2020-06-12 14:20:16 +02:00
|
|
|
void (CDECL *set_show_dot_files)( BOOL enable );
|
|
|
|
|
2020-06-23 19:39:12 +02:00
|
|
|
/* loader functions */
|
|
|
|
NTSTATUS (CDECL *load_so_dll)( UNICODE_STRING *nt_name, void **module );
|
2020-06-23 12:32:43 +02:00
|
|
|
NTSTATUS (CDECL *load_builtin_dll)( const WCHAR *name, void **module,
|
|
|
|
pe_image_info_t *image_info );
|
2020-06-23 19:39:12 +02:00
|
|
|
NTSTATUS (CDECL *unload_builtin_dll)( void *module );
|
|
|
|
void (CDECL *init_builtin_dll)( void *module );
|
2020-06-25 10:32:47 +02:00
|
|
|
NTSTATUS (CDECL *unwind_builtin_dll)( ULONG type, struct _DISPATCHER_CONTEXT *dispatch,
|
|
|
|
CONTEXT *context );
|
2020-06-23 19:39:12 +02:00
|
|
|
|
2020-05-17 11:07:02 +02:00
|
|
|
/* debugging functions */
|
|
|
|
unsigned char (CDECL *dbg_get_channel_flags)( struct __wine_debug_channel *channel );
|
|
|
|
const char * (CDECL *dbg_strdup)( const char *str );
|
|
|
|
int (CDECL *dbg_output)( const char *str );
|
|
|
|
int (CDECL *dbg_header)( enum __wine_debug_class cls, struct __wine_debug_channel *channel,
|
|
|
|
const char *function );
|
2020-05-14 15:17:06 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __NTDLL_UNIXLIB_H */
|