Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
a003f0ae
Commit
a003f0ae
authored
Sep 19, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Store the kernel32 process entry point in a global variable.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
30215311
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
14 deletions
+5
-14
loader.c
dlls/ntdll/loader.c
+3
-14
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-0
thread.c
dlls/ntdll/thread.c
+1
-0
No files found.
dlls/ntdll/loader.c
View file @
a003f0ae
...
...
@@ -100,12 +100,6 @@ struct builtin_load_info
static
struct
builtin_load_info
default_load_info
;
static
struct
builtin_load_info
*
builtin_load_info
=
&
default_load_info
;
struct
start_params
{
void
*
kernel_start
;
LPTHREAD_START_ROUTINE
entry
;
};
static
HANDLE
main_exe_file
;
static
UINT
tls_module_count
;
/* number of modules with TLS directory */
static
IMAGE_TLS_DIRECTORY
*
tls_dirs
;
/* array of TLS directories */
...
...
@@ -3106,8 +3100,7 @@ static void load_global_options(void)
*/
static
void
start_process
(
void
*
arg
)
{
struct
start_params
*
start_params
=
(
struct
start_params
*
)
arg
;
call_thread_entry_point
(
start_params
->
kernel_start
,
start_params
->
entry
);
call_thread_entry_point
(
kernel32_start_process
,
arg
);
}
/******************************************************************
...
...
@@ -3122,8 +3115,8 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
WINE_MODREF
*
wm
;
LPCWSTR
load_path
;
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
struct
start_params
start_params
;
kernel32_start_process
=
kernel_start
;
if
(
main_exe_file
)
NtClose
(
main_exe_file
);
/* at this point the main module is created */
/* allocate the modref for the main exe (if not already done) */
...
...
@@ -3159,16 +3152,12 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
if
((
status
=
fixup_imports
(
wm
,
load_path
))
!=
STATUS_SUCCESS
)
goto
error
;
heap_set_debug_flags
(
GetProcessHeap
()
);
/* Store original entrypoint (in case it gets corrupted) */
start_params
.
kernel_start
=
kernel_start
;
start_params
.
entry
=
wm
->
ldr
.
EntryPoint
;
status
=
wine_call_on_stack
(
attach_process_dlls
,
wm
,
NtCurrentTeb
()
->
Tib
.
StackBase
);
if
(
status
!=
STATUS_SUCCESS
)
goto
error
;
virtual_release_address_space
();
virtual_clear_thread_stack
();
wine_switch_to_stack
(
start_process
,
&
start_params
,
NtCurrentTeb
()
->
Tib
.
StackBase
);
wine_switch_to_stack
(
start_process
,
wm
->
ldr
.
EntryPoint
,
NtCurrentTeb
()
->
Tib
.
StackBase
);
error:
ERR
(
"Main exe initialization for %s failed, status %x
\n
"
,
...
...
dlls/ntdll/ntdll_misc.h
View file @
a003f0ae
...
...
@@ -114,6 +114,7 @@ extern UNICODE_STRING system_dir DECLSPEC_HIDDEN;
typedef
LONG
(
WINAPI
*
PUNHANDLED_EXCEPTION_FILTER
)(
PEXCEPTION_POINTERS
);
extern
PUNHANDLED_EXCEPTION_FILTER
unhandled_exception_filter
DECLSPEC_HIDDEN
;
extern
LPTHREAD_START_ROUTINE
kernel32_start_process
DECLSPEC_HIDDEN
;
/* redefine these to make sure we don't reference kernel symbols */
#define GetProcessHeap() (NtCurrentTeb()->Peb->ProcessHeap)
...
...
dlls/ntdll/thread.c
View file @
a003f0ae
...
...
@@ -51,6 +51,7 @@ WINE_DECLARE_DEBUG_CHANNEL(relay);
struct
_KUSER_SHARED_DATA
*
user_shared_data
=
NULL
;
PUNHANDLED_EXCEPTION_FILTER
unhandled_exception_filter
=
NULL
;
LPTHREAD_START_ROUTINE
kernel32_start_process
=
NULL
;
/* info passed to a starting thread */
struct
startup_info
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment