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
8c103f29
Commit
8c103f29
authored
Sep 19, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add support for setting a platform-specific initial context.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9979c793
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
11 deletions
+24
-11
loader.c
dlls/ntdll/loader.c
+3
-1
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+2
-2
server.c
dlls/ntdll/server.c
+4
-3
signal_arm.c
dlls/ntdll/signal_arm.c
+3
-1
signal_arm64.c
dlls/ntdll/signal_arm64.c
+3
-1
signal_i386.c
dlls/ntdll/signal_i386.c
+3
-1
signal_powerpc.c
dlls/ntdll/signal_powerpc.c
+3
-1
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+3
-1
No files found.
dlls/ntdll/loader.c
View file @
8c103f29
...
...
@@ -3115,6 +3115,7 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
WINE_MODREF
*
wm
;
LPCWSTR
load_path
;
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
CONTEXT
context
=
{
0
};
kernel32_start_process
=
kernel_start
;
if
(
main_exe_file
)
NtClose
(
main_exe_file
);
/* at this point the main module is created */
...
...
@@ -3145,7 +3146,7 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
InsertHeadList
(
&
peb
->
LdrData
->
InMemoryOrderModuleList
,
&
wm
->
ldr
.
InMemoryOrderModuleList
);
if
((
status
=
virtual_alloc_thread_stack
(
NtCurrentTeb
(),
0
,
0
))
!=
STATUS_SUCCESS
)
goto
error
;
if
((
status
=
server_init_process_done
())
!=
STATUS_SUCCESS
)
goto
error
;
if
((
status
=
server_init_process_done
(
&
context
))
!=
STATUS_SUCCESS
)
goto
error
;
actctx_init
();
load_path
=
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
DllPath
.
Buffer
;
...
...
@@ -3157,6 +3158,7 @@ void WINAPI LdrInitializeThunk( void *kernel_start, ULONG_PTR unknown2,
virtual_release_address_space
();
virtual_clear_thread_stack
();
if
(
context
.
ContextFlags
)
NtSetContextThread
(
GetCurrentThread
(),
&
context
);
wine_switch_to_stack
(
start_process
,
wm
->
ldr
.
EntryPoint
,
NtCurrentTeb
()
->
Tib
.
StackBase
);
error:
...
...
dlls/ntdll/ntdll_misc.h
View file @
8c103f29
...
...
@@ -67,7 +67,7 @@ extern LPCSTR debugstr_ObjectAttributes(const OBJECT_ATTRIBUTES *oa) DECLSPEC_HI
extern
NTSTATUS
signal_alloc_thread
(
TEB
**
teb
)
DECLSPEC_HIDDEN
;
extern
void
signal_free_thread
(
TEB
*
teb
)
DECLSPEC_HIDDEN
;
extern
void
signal_init_thread
(
TEB
*
teb
)
DECLSPEC_HIDDEN
;
extern
void
signal_init_process
(
void
)
DECLSPEC_HIDDEN
;
extern
void
signal_init_process
(
CONTEXT
*
context
,
LPTHREAD_START_ROUTINE
entry
)
DECLSPEC_HIDDEN
;
extern
void
version_init
(
const
WCHAR
*
appname
)
DECLSPEC_HIDDEN
;
extern
void
debug_init
(
void
)
DECLSPEC_HIDDEN
;
extern
HANDLE
thread_init
(
void
)
DECLSPEC_HIDDEN
;
...
...
@@ -82,7 +82,7 @@ extern timeout_t server_start_time DECLSPEC_HIDDEN;
extern
unsigned
int
server_cpus
DECLSPEC_HIDDEN
;
extern
BOOL
is_wow64
DECLSPEC_HIDDEN
;
extern
void
server_init_process
(
void
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
server_init_process_done
(
void
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
server_init_process_done
(
CONTEXT
*
context
)
DECLSPEC_HIDDEN
;
extern
size_t
server_init_thread
(
void
*
entry_point
)
DECLSPEC_HIDDEN
;
extern
void
DECLSPEC_NORETURN
abort_thread
(
int
status
)
DECLSPEC_HIDDEN
;
extern
void
DECLSPEC_NORETURN
terminate_thread
(
int
status
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/server.c
View file @
8c103f29
...
...
@@ -1421,10 +1421,11 @@ void server_init_process(void)
/***********************************************************************
* server_init_process_done
*/
NTSTATUS
server_init_process_done
(
void
)
NTSTATUS
server_init_process_done
(
CONTEXT
*
context
)
{
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
IMAGE_NT_HEADERS
*
nt
=
RtlImageNtHeader
(
peb
->
ImageBaseAddress
);
void
*
entry
=
(
char
*
)
peb
->
ImageBaseAddress
+
nt
->
OptionalHeader
.
AddressOfEntryPoint
;
NTSTATUS
status
;
/* Install signal handlers; this cannot be done earlier, since we cannot
...
...
@@ -1433,7 +1434,7 @@ NTSTATUS server_init_process_done(void)
* We do need the handlers in place by the time the request is over, so
* we set them up here. If we segfault between here and the server call
* something is very wrong... */
signal_init_process
();
signal_init_process
(
context
,
entry
);
/* Signal the parent process to continue */
SERVER_START_REQ
(
init_process_done
)
...
...
@@ -1442,7 +1443,7 @@ NTSTATUS server_init_process_done(void)
#ifdef __i386__
req
->
ldt_copy
=
wine_server_client_ptr
(
&
wine_ldt_copy
);
#endif
req
->
entry
=
wine_server_client_ptr
(
(
char
*
)
peb
->
ImageBaseAddress
+
nt
->
OptionalHeader
.
AddressOfEntryPoint
);
req
->
entry
=
wine_server_client_ptr
(
entry
);
req
->
gui
=
(
nt
->
OptionalHeader
.
Subsystem
!=
IMAGE_SUBSYSTEM_WINDOWS_CUI
);
status
=
wine_server_call
(
req
);
}
...
...
dlls/ntdll/signal_arm.c
View file @
8c103f29
...
...
@@ -981,7 +981,7 @@ void signal_init_thread( TEB *teb )
/**********************************************************************
* signal_init_process
*/
void
signal_init_process
(
void
)
void
signal_init_process
(
CONTEXT
*
context
,
LPTHREAD_START_ROUTINE
entry
)
{
struct
sigaction
sig_act
;
...
...
@@ -1010,6 +1010,8 @@ void signal_init_process(void)
sig_act
.
sa_sigaction
=
trap_handler
;
if
(
sigaction
(
SIGTRAP
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
#endif
/* FIXME: set the initial context */
return
;
error
:
...
...
dlls/ntdll/signal_arm64.c
View file @
8c103f29
...
...
@@ -852,7 +852,7 @@ void signal_init_thread( TEB *teb )
/**********************************************************************
* signal_init_process
*/
void
signal_init_process
(
void
)
void
signal_init_process
(
CONTEXT
*
context
,
LPTHREAD_START_ROUTINE
entry
)
{
struct
sigaction
sig_act
;
...
...
@@ -881,6 +881,8 @@ void signal_init_process(void)
sig_act
.
sa_sigaction
=
trap_handler
;
if
(
sigaction
(
SIGTRAP
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
#endif
/* FIXME: set the initial context */
return
;
error
:
...
...
dlls/ntdll/signal_i386.c
View file @
8c103f29
...
...
@@ -2557,7 +2557,7 @@ void signal_init_thread( TEB *teb )
/**********************************************************************
* signal_init_process
*/
void
signal_init_process
(
void
)
void
signal_init_process
(
CONTEXT
*
context
,
LPTHREAD_START_ROUTINE
entry
)
{
struct
sigaction
sig_act
;
...
...
@@ -2599,6 +2599,8 @@ void signal_init_process(void)
#endif
wine_ldt_init_locking
(
ldt_lock
,
ldt_unlock
);
/* FIXME: set the initial context */
return
;
error:
...
...
dlls/ntdll/signal_powerpc.c
View file @
8c103f29
...
...
@@ -1054,7 +1054,7 @@ void signal_init_thread( TEB *teb )
/**********************************************************************
* signal_init_process
*/
void
signal_init_process
(
void
)
void
signal_init_process
(
CONTEXT
*
context
,
LPTHREAD_START_ROUTINE
entry
)
{
struct
sigaction
sig_act
;
...
...
@@ -1083,6 +1083,8 @@ void signal_init_process(void)
sig_act
.
sa_sigaction
=
trap_handler
;
if
(
sigaction
(
SIGTRAP
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
#endif
/* FIXME: set the initial context */
return
;
error:
...
...
dlls/ntdll/signal_x86_64.c
View file @
8c103f29
...
...
@@ -3102,7 +3102,7 @@ void signal_init_thread( TEB *teb )
/**********************************************************************
* signal_init_process
*/
void
signal_init_process
(
void
)
void
signal_init_process
(
CONTEXT
*
context
,
LPTHREAD_START_ROUTINE
entry
)
{
struct
sigaction
sig_act
;
...
...
@@ -3131,6 +3131,8 @@ void signal_init_process(void)
sig_act
.
sa_sigaction
=
trap_handler
;
if
(
sigaction
(
SIGTRAP
,
&
sig_act
,
NULL
)
==
-
1
)
goto
error
;
#endif
/* FIXME: set the initial context */
return
;
error
:
...
...
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