Alexandre Julliard : kernel32: Move some initialization code to ntdll.
Alexandre Julliard
julliard at winehq.org
Wed Dec 4 16:13:04 CST 2019
Module: wine
Branch: master
Commit: 331947c993c06b63ccc3adbe5500b24fbf79e3ed
URL: https://source.winehq.org/git/wine.git/?a=commit;h=331947c993c06b63ccc3adbe5500b24fbf79e3ed
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Dec 3 19:54:56 2019 +0100
kernel32: Move some initialization code to ntdll.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernel32/process.c | 9 ---------
dlls/ntdll/debugtools.c | 2 ++
dlls/ntdll/env.c | 1 +
3 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 72a93a7fe7..779c13cb54 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -170,20 +170,11 @@ void * CDECL __wine_kernel_init(void)
{
static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2',0};
- PEB *peb = NtCurrentTeb()->Peb;
- RTL_USER_PROCESS_PARAMETERS *params = peb->ProcessParameters;
-
- /* Initialize everything */
-
- setbuf(stdout,NULL);
- setbuf(stderr,NULL);
kernel32_handle = GetModuleHandleW(kernel32W);
RtlSetUnhandledExceptionFilter( UnhandledExceptionFilter );
LOCALE_Init();
- if (!params->CurrentDirectory.Handle) chdir("/"); /* avoid locking removable devices */
-
return start_process_wrapper;
}
diff --git a/dlls/ntdll/debugtools.c b/dlls/ntdll/debugtools.c
index 64355ab3b8..546d527323 100644
--- a/dlls/ntdll/debugtools.c
+++ b/dlls/ntdll/debugtools.c
@@ -284,6 +284,8 @@ int __cdecl __wine_dbg_header( enum __wine_debug_class cls, struct __wine_debug_
*/
void debug_init(void)
{
+ setbuf( stdout, NULL );
+ setbuf( stderr, NULL );
ntdll_get_thread_data()->debug_info = &initial_info;
init_done = TRUE;
}
diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c
index ebeda01ff8..116a57a8e7 100644
--- a/dlls/ntdll/env.c
+++ b/dlls/ntdll/env.c
@@ -1546,5 +1546,6 @@ done:
RtlInitUnicodeString( &curdir, windows_dir );
RtlSetCurrentDirectory_U( &curdir );
}
+ if (!params->CurrentDirectory.Handle) chdir("/"); /* avoid locking removable devices */
set_wow64_environment( ¶ms->Environment );
}
More information about the wine-cvs
mailing list