Commit 22da5bd7 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Move the loadorder support to the Unix library.

parent 9e38a680
......@@ -20,7 +20,6 @@ C_SRCS = \
heap.c \
large_int.c \
loader.c \
loadorder.c \
locale.c \
misc.c \
nt.c \
......@@ -48,6 +47,7 @@ C_SRCS = \
unix/env.c \
unix/file.c \
unix/loader.c \
unix/loadorder.c \
unix/process.c \
unix/registry.c \
unix/security.c \
......
......@@ -2627,7 +2627,7 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
if (nts && nts != STATUS_DLL_NOT_FOUND && nts != STATUS_INVALID_IMAGE_NOT_MZ) goto done;
main_exe = get_modref( NtCurrentTeb()->Peb->ImageBaseAddress );
loadorder = get_load_order( main_exe ? main_exe->ldr.BaseDllName.Buffer : NULL, &nt_name );
loadorder = unix_funcs->get_load_order( main_exe ? main_exe->ldr.BaseDllName.Buffer : NULL, &nt_name );
prev = NtCurrentTeb()->Tib.ArbitraryUserPointer;
NtCurrentTeb()->Tib.ArbitraryUserPointer = nt_name.Buffer + 4;
......
......@@ -90,19 +90,6 @@ extern int CDECL NTDLL__vsnwprintf( WCHAR *str, SIZE_T len, const WCHAR *format,
/* load order */
enum loadorder
{
LO_INVALID,
LO_DISABLED,
LO_NATIVE,
LO_BUILTIN,
LO_NATIVE_BUILTIN, /* native then builtin */
LO_BUILTIN_NATIVE, /* builtin then native */
LO_DEFAULT /* nothing specified, use default strategy */
};
extern enum loadorder get_load_order( const WCHAR *app_name, const UNICODE_STRING *nt_name ) DECLSPEC_HIDDEN;
#ifndef _WIN64
static inline TEB64 *NtCurrentTeb64(void) { return (TEB64 *)NtCurrentTeb()->GdiBatchCount; }
#endif
......
......@@ -1592,6 +1592,7 @@ static struct unix_funcs unix_funcs =
load_builtin_dll,
init_builtin_dll,
unwind_builtin_dll,
get_load_order,
__wine_dbg_get_channel_flags,
__wine_dbg_strdup,
__wine_dbg_output,
......
......@@ -382,6 +382,8 @@ static inline void context_init_xstate( CONTEXT *context, void *xstate_buffer )
}
#endif
extern enum loadorder CDECL get_load_order( const WCHAR *app_name, const UNICODE_STRING *nt_name ) DECLSPEC_HIDDEN;
static inline size_t ntdll_wcslen( const WCHAR *str )
{
const WCHAR *s = str;
......@@ -434,6 +436,20 @@ static inline WCHAR *ntdll_wcspbrk( const WCHAR *str, const WCHAR *accept )
return NULL;
}
static inline SIZE_T ntdll_wcsspn( const WCHAR *str, const WCHAR *accept )
{
const WCHAR *ptr;
for (ptr = str; *ptr; ptr++) if (!ntdll_wcschr( accept, *ptr )) break;
return ptr - str;
}
static inline SIZE_T ntdll_wcscspn( const WCHAR *str, const WCHAR *reject )
{
const WCHAR *ptr;
for (ptr = str; *ptr; ptr++) if (ntdll_wcschr( reject, *ptr )) break;
return ptr - str;
}
static inline WCHAR ntdll_towupper( WCHAR ch )
{
return ch + uctable[uctable[uctable[ch >> 8] + ((ch >> 4) & 0x0f)] + (ch & 0x0f)];
......@@ -478,6 +494,8 @@ static inline int ntdll_wcsnicmp( const WCHAR *str1, const WCHAR *str2, int n )
#define wcschr(str,ch) ntdll_wcschr(str,ch)
#define wcsrchr(str,ch) ntdll_wcsrchr(str,ch)
#define wcspbrk(str,ac) ntdll_wcspbrk(str,ac)
#define wcsspn(str,ac) ntdll_wcsspn(str,ac)
#define wcscspn(str,rej) ntdll_wcscspn(str,rej)
#define wcsicmp(s1, s2) ntdll_wcsicmp(s1,s2)
#define wcsnicmp(s1, s2,n) ntdll_wcsnicmp(s1,s2,n)
#define wcsupr(str) ntdll_wcsupr(str)
......
......@@ -25,8 +25,19 @@
struct _DISPATCHER_CONTEXT;
enum loadorder
{
LO_INVALID,
LO_DISABLED,
LO_NATIVE,
LO_BUILTIN,
LO_NATIVE_BUILTIN, /* native then builtin */
LO_BUILTIN_NATIVE, /* builtin then native */
LO_DEFAULT /* nothing specified, use default strategy */
};
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 116
#define NTDLL_UNIXLIB_VERSION 117
struct unix_funcs
{
......@@ -79,6 +90,7 @@ struct unix_funcs
void (CDECL *init_builtin_dll)( void *module );
NTSTATUS (CDECL *unwind_builtin_dll)( ULONG type, struct _DISPATCHER_CONTEXT *dispatch,
CONTEXT *context );
enum loadorder (CDECL *get_load_order)( const WCHAR *app_name, const UNICODE_STRING *nt_name );
/* debugging functions */
unsigned char (CDECL *dbg_get_channel_flags)( struct __wine_debug_channel *channel );
......
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