Commit 29f320ed authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move process initialization to NtUserInitializeClientPfnArrays.

On wow64 64-bit win32u.dll is always loaded, causing win32u.so to initialize at earlier stage than it would otherwise do. This patch makes it more consistent across environments.
parent a17bb304
......@@ -246,6 +246,14 @@ DLGPROC get_dialog_proc( DLGPROC ret, BOOL ansi )
return ansi ? proc->procA : proc->procW;
}
static void init_user(void)
{
gdi_init();
winstation_init();
sysparams_init();
register_desktop_class();
}
/***********************************************************************
* NtUserInitializeClientPfnArrays (win32u.@)
*/
......@@ -253,6 +261,8 @@ NTSTATUS WINAPI NtUserInitializeClientPfnArrays( const struct user_client_procs
const struct user_client_procs *client_procsW,
const void *client_workers, HINSTANCE user_module )
{
static pthread_once_t init_once = PTHREAD_ONCE_INIT;
winproc_array[WINPROC_BUTTON].procA = client_procsA->pButtonWndProc;
winproc_array[WINPROC_BUTTON].procW = client_procsW->pButtonWndProc;
winproc_array[WINPROC_COMBO].procA = client_procsA->pComboWndProc;
......@@ -283,6 +293,8 @@ NTSTATUS WINAPI NtUserInitializeClientPfnArrays( const struct user_client_procs
winproc_array[WINPROC_MESSAGE].procW = client_procsW->pMessageWndProc;
user32_module = user_module;
pthread_once( &init_once, init_user );
return STATUS_SUCCESS;
}
......
......@@ -1153,7 +1153,7 @@ static struct unix_funcs unix_funcs =
__wine_send_input,
};
NTSTATUS gdi_init(void)
void gdi_init(void)
{
pthread_mutexattr_t attr;
unsigned int dpi;
......@@ -1165,11 +1165,10 @@ NTSTATUS gdi_init(void)
NtQuerySystemInformation( SystemBasicInformation, &system_info, sizeof(system_info), NULL );
init_gdi_shared();
if (!gdi_shared) return STATUS_NO_MEMORY;
if (!gdi_shared) return;
dpi = font_init();
init_stock_objects( dpi );
return 0;
}
NTSTATUS callbacks_init( void *args )
......
......@@ -314,13 +314,7 @@ static SYSTEM_SERVICE_TABLE syscall_table =
static NTSTATUS init( void *dispatcher )
{
NTSTATUS status;
if ((status = ntdll_init_syscalls( 1, &syscall_table, dispatcher ))) return status;
if ((status = gdi_init())) return status;
winstation_init();
sysparams_init();
register_desktop_class();
return STATUS_SUCCESS;
return ntdll_init_syscalls( 1, &syscall_table, dispatcher );
}
unixlib_entry_t __wine_unix_call_funcs[] =
......
......@@ -411,7 +411,7 @@ static inline void release_win_ptr( struct tagWND *ptr )
}
extern void wrappers_init( unixlib_handle_t handle ) DECLSPEC_HIDDEN;
extern NTSTATUS gdi_init(void) DECLSPEC_HIDDEN;
extern void gdi_init(void) DECLSPEC_HIDDEN;
extern NTSTATUS callbacks_init( void *args ) DECLSPEC_HIDDEN;
extern void winstation_init(void) DECLSPEC_HIDDEN;
extern void sysparams_init(void) DECLSPEC_HIDDEN;
......
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