Commit d10410ea authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Add fallback implementations for the Unix library functions.

parent 1b447409
......@@ -76,8 +76,6 @@ static DWORD (WINAPI *pCtrlRoutine)(void *);
SYSTEM_DLL_INIT_BLOCK LdrSystemDllInitBlock = { 0xf0 };
const struct unix_funcs *unix_funcs = NULL;
/* windows directory */
const WCHAR windows_dir[] = L"C:\\windows";
/* system directory with trailing backslash */
......@@ -4443,6 +4441,44 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
}
static NTSTATUS CDECL load_so_dll_fallback( UNICODE_STRING *nt_name, void **module )
{
return STATUS_INVALID_IMAGE_FORMAT;
}
static void CDECL init_builtin_dll_fallback( void *module )
{
}
static NTSTATUS CDECL init_unix_lib_fallback( void *module, DWORD reason, const void *ptr_in, void *ptr_out )
{
return STATUS_DLL_NOT_FOUND;
}
static NTSTATUS CDECL unwind_builtin_dll_fallback( ULONG type, struct _DISPATCHER_CONTEXT *dispatch,
CONTEXT *context )
{
return STATUS_UNSUCCESSFUL;
}
static LONGLONG WINAPI RtlGetSystemTimePrecise_fallback(void)
{
LARGE_INTEGER now;
NtQuerySystemTime( &now );
return now.QuadPart;
}
static const struct unix_funcs unix_fallbacks =
{
load_so_dll_fallback,
init_builtin_dll_fallback,
init_unix_lib_fallback,
unwind_builtin_dll_fallback,
RtlGetSystemTimePrecise_fallback,
};
const struct unix_funcs *unix_funcs = &unix_fallbacks;
/***********************************************************************
* __wine_set_unix_funcs
*/
......
......@@ -2156,14 +2156,14 @@ static ULONG_PTR get_image_address(void)
*/
static struct unix_funcs unix_funcs =
{
#ifdef __aarch64__
NtCurrentTeb,
#endif
RtlGetSystemTimePrecise,
load_so_dll,
init_builtin_dll,
init_unix_lib,
unwind_builtin_dll,
RtlGetSystemTimePrecise,
#ifdef __aarch64__
NtCurrentTeb,
#endif
};
......
......@@ -26,24 +26,21 @@
struct _DISPATCHER_CONTEXT;
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 132
#define NTDLL_UNIXLIB_VERSION 133
struct unix_funcs
{
/* Nt* functions */
#ifdef __aarch64__
TEB * (WINAPI *NtCurrentTeb)(void);
#endif
/* other Win32 API functions */
LONGLONG (WINAPI *RtlGetSystemTimePrecise)(void);
/* loader functions */
NTSTATUS (CDECL *load_so_dll)( UNICODE_STRING *nt_name, void **module );
void (CDECL *init_builtin_dll)( void *module );
NTSTATUS (CDECL *init_unix_lib)( void *module, DWORD reason, const void *ptr_in, void *ptr_out );
NTSTATUS (CDECL *unwind_builtin_dll)( ULONG type, struct _DISPATCHER_CONTEXT *dispatch,
CONTEXT *context );
/* other Win32 API functions */
LONGLONG (WINAPI *RtlGetSystemTimePrecise)(void);
#ifdef __aarch64__
TEB * (WINAPI *NtCurrentTeb)(void);
#endif
};
#endif /* __NTDLL_UNIXLIB_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment