Module: wine Branch: master Commit: d57c41990acde38f085da1c8dd6051e5fd287fb7 URL: https://gitlab.winehq.org/wine/wine/-/commit/d57c41990acde38f085da1c8dd6051e...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Nov 24 11:27:44 2023 +0100
ntdll: Use RtlFindExportedRoutineByName to simplify loader initialization.
---
dlls/ntdll/loader.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 4bc7e66d76b..5b0d3f6b6ee 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -4268,8 +4268,6 @@ void loader_init( CONTEXT *context, void **entry ) if (!imports_fixup_done) { MEMORY_BASIC_INFORMATION meminfo; - ANSI_STRING base_thread_init_thunk = RTL_CONSTANT_STRING( "BaseThreadInitThunk" ); - ANSI_STRING ctrl_routine = RTL_CONSTANT_STRING( "CtrlRoutine" ); WINE_MODREF *kernel32; PEB *peb = NtCurrentTeb()->Peb;
@@ -4305,13 +4303,8 @@ void loader_init( CONTEXT *context, void **entry ) NtTerminateProcess( GetCurrentProcess(), status ); } node_kernel32 = kernel32->ldr.DdagNode; - if ((status = LdrGetProcedureAddress( kernel32->ldr.DllBase, &base_thread_init_thunk, - 0, (void **)&pBaseThreadInitThunk )) != STATUS_SUCCESS) - { - MESSAGE( "wine: could not find BaseThreadInitThunk in kernel32.dll, status %lx\n", status ); - NtTerminateProcess( GetCurrentProcess(), status ); - } - LdrGetProcedureAddress( kernel32->ldr.DllBase, &ctrl_routine, 0, (void **)&pCtrlRoutine ); + pBaseThreadInitThunk = RtlFindExportedRoutineByName( kernel32->ldr.DllBase, "BaseThreadInitThunk" ); + pCtrlRoutine = RtlFindExportedRoutineByName( kernel32->ldr.DllBase, "CtrlRoutine" );
actctx_init(); locale_init();