Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
1581fb61
Commit
1581fb61
authored
Aug 26, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Get rid of the server_init_process_done() Unix library callback.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d9625e5a
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
27 additions
and
22 deletions
+27
-22
loader.c
dlls/ntdll/loader.c
+22
-8
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+0
-1
loader.c
dlls/ntdll/unix/loader.c
+1
-1
server.c
dlls/ntdll/unix/server.c
+2
-2
signal_arm.c
dlls/ntdll/unix/signal_arm.c
+0
-1
signal_arm64.c
dlls/ntdll/unix/signal_arm64.c
+0
-1
signal_i386.c
dlls/ntdll/unix/signal_i386.c
+0
-2
signal_x86_64.c
dlls/ntdll/unix/signal_x86_64.c
+0
-1
unix_private.h
dlls/ntdll/unix/unix_private.h
+1
-1
unixlib.h
dlls/ntdll/unixlib.h
+1
-4
No files found.
dlls/ntdll/loader.c
View file @
1581fb61
...
...
@@ -58,6 +58,8 @@ WINE_DECLARE_DEBUG_CHANNEL(imports);
typedef
DWORD
(
CALLBACK
*
DLLENTRYPROC
)(
HMODULE
,
DWORD
,
LPVOID
);
typedef
void
(
CALLBACK
*
LDRENUMPROC
)(
LDR_DATA_TABLE_ENTRY
*
,
void
*
,
BOOLEAN
*
);
static
void
(
WINAPI
*
kernel32_start_process
)(
LPTHREAD_START_ROUTINE
,
void
*
);
const
struct
unix_funcs
*
unix_funcs
=
NULL
;
/* windows directory */
...
...
@@ -3409,15 +3411,30 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule)
* Attach to all the loaded dlls.
* If this is the first time, perform the full process initialization.
*/
void
WINAPI
LdrInitializeThunk
(
CONTEXT
*
context
,
void
**
entry
,
ULONG_PTR
unknown3
,
ULONG_PTR
unknown4
)
void
WINAPI
LdrInitializeThunk
(
CONTEXT
*
context
,
ULONG_PTR
unknown2
,
ULONG_PTR
unknown3
,
ULONG_PTR
unknown4
)
{
static
int
attach_done
;
int
i
;
NTSTATUS
status
;
ULONG_PTR
cookie
;
WINE_MODREF
*
wm
;
void
**
entry
;
LPCWSTR
load_path
=
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
DllPath
.
Buffer
;
#ifdef __i386__
entry
=
(
void
**
)
&
context
->
Eax
;
if
(
!
context
->
Eip
)
context
->
Eip
=
(
DWORD_PTR
)
kernel32_start_process
;
#elif defined(__x86_64__)
entry
=
(
void
**
)
&
context
->
Rcx
;
if
(
!
context
->
Rip
)
context
->
Rip
=
(
DWORD_PTR
)
kernel32_start_process
;
#elif defined(__arm__)
entry
=
(
void
**
)
&
context
->
R0
;
if
(
!
context
->
Pc
)
context
->
Pc
=
(
DWORD_PTR
)
kernel32_start_process
;
#elif defined(__aarch64__)
entry
=
(
void
**
)
&
context
->
X0
;
if
(
!
context
->
Pc
)
context
->
Pc
=
(
DWORD_PTR
)
kernel32_start_process
;
#endif
if
(
process_detaching
)
NtTerminateThread
(
GetCurrentThread
(),
0
);
RtlEnterCriticalSection
(
&
loader_section
);
...
...
@@ -3891,9 +3908,9 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
/***********************************************************************
*
__wine_
process_init
* process_init
*/
void
__wine_
process_init
(
void
)
static
void
process_init
(
void
)
{
static
const
WCHAR
ntdllW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'3'
,
'2'
,
'\\'
,
...
...
@@ -3901,7 +3918,6 @@ void __wine_process_init(void)
static
const
WCHAR
kernel32W
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'3'
,
'2'
,
'\\'
,
'k'
,
'e'
,
'r'
,
'n'
,
'e'
,
'l'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
0
};
void
(
WINAPI
*
kernel32_start_process
)(
LPTHREAD_START_ROUTINE
,
void
*
)
=
NULL
;
RTL_USER_PROCESS_PARAMETERS
*
params
;
WINE_MODREF
*
wm
;
NTSTATUS
status
;
...
...
@@ -3951,7 +3967,7 @@ void __wine_process_init(void)
/* setup the load callback and create ntdll modref */
RtlInitUnicodeString
(
&
nt_name
,
ntdllW
);
NtQueryVirtualMemory
(
GetCurrentProcess
(),
__wine_
process_init
,
MemoryBasicInformation
,
NtQueryVirtualMemory
(
GetCurrentProcess
(),
process_init
,
MemoryBasicInformation
,
&
meminfo
,
sizeof
(
meminfo
),
NULL
);
status
=
build_builtin_module
(
params
->
DllPath
.
Buffer
,
&
nt_name
,
meminfo
.
AllocationBase
,
0
,
&
wm
);
assert
(
!
status
);
...
...
@@ -4034,8 +4050,6 @@ void __wine_process_init(void)
teb
->
Tib
.
StackBase
=
stack
.
StackBase
;
teb
->
Tib
.
StackLimit
=
stack
.
StackLimit
;
teb
->
DeallocationStack
=
stack
.
DeallocationStack
;
unix_funcs
->
server_init_process_done
(
kernel32_start_process
);
}
/***********************************************************************
...
...
@@ -4045,5 +4059,5 @@ void CDECL __wine_set_unix_funcs( int version, const struct unix_funcs *funcs )
{
assert
(
version
==
NTDLL_UNIXLIB_VERSION
);
unix_funcs
=
funcs
;
__wine_
process_init
();
process_init
();
}
dlls/ntdll/ntdll_misc.h
View file @
1581fb61
...
...
@@ -120,7 +120,6 @@ static inline TEB64 *NtCurrentTeb64(void) { return (TEB64 *)NtCurrentTeb()->GdiB
#define HASH_STRING_ALGORITHM_INVALID 0xffffffff
NTSTATUS
WINAPI
RtlHashUnicodeString
(
PCUNICODE_STRING
,
BOOLEAN
,
ULONG
,
ULONG
*
);
void
WINAPI
LdrInitializeThunk
(
CONTEXT
*
,
void
**
,
ULONG_PTR
,
ULONG_PTR
);
#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
#define InterlockedCompareExchange64(dest,xchg,cmp) RtlInterlockedCompareExchange64(dest,xchg,cmp)
...
...
dlls/ntdll/unix/loader.c
View file @
1581fb61
...
...
@@ -1349,7 +1349,6 @@ static struct unix_funcs unix_funcs =
virtual_map_section
,
virtual_release_address_space
,
exec_process
,
server_init_process_done
,
set_show_dot_files
,
load_so_dll
,
load_builtin_dll
,
...
...
@@ -1382,6 +1381,7 @@ static void start_main_thread(void)
init_files
();
NtCreateKeyedEvent
(
&
keyed_event
,
GENERIC_READ
|
GENERIC_WRITE
,
NULL
,
0
);
p__wine_set_unix_funcs
(
NTDLL_UNIXLIB_VERSION
,
&
unix_funcs
);
server_init_process_done
();
}
...
...
dlls/ntdll/unix/server.c
View file @
1581fb61
...
...
@@ -1453,7 +1453,7 @@ void server_init_process(void)
/***********************************************************************
* server_init_process_done
*/
void
CDECL
server_init_process_done
(
void
*
relay
)
void
server_init_process_done
(
void
)
{
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
IMAGE_NT_HEADERS
*
nt
=
get_exe_nt_header
();
...
...
@@ -1486,7 +1486,7 @@ void CDECL server_init_process_done( void *relay )
SERVER_END_REQ
;
assert
(
!
status
);
signal_start_thread
(
entry
,
peb
,
suspend
,
relay
,
pLdrInitializeThunk
,
NtCurrentTeb
()
);
signal_start_thread
(
entry
,
peb
,
suspend
,
NULL
,
pLdrInitializeThunk
,
NtCurrentTeb
()
);
}
...
...
dlls/ntdll/unix/signal_arm.c
View file @
1581fb61
...
...
@@ -1036,7 +1036,6 @@ __ASM_GLOBAL_FUNC( signal_start_thread,
"sub sp, r4, #0x1000
\n\t
"
/* attach dlls */
"bl "
__ASM_NAME
(
"get_initial_context"
)
"
\n\t
"
"add r1, r0, #4
\n\t
"
/* &context->R0 */
"mov lr, #0
\n\t
"
"bx r5"
)
...
...
dlls/ntdll/unix/signal_arm64.c
View file @
1581fb61
...
...
@@ -1136,7 +1136,6 @@ __ASM_GLOBAL_FUNC( signal_start_thread,
"sub sp, x5, #0x1000
\n\t
"
/* attach dlls */
"bl "
__ASM_NAME
(
"get_initial_context"
)
"
\n\t
"
"add x1, x0, #4
\n\t
"
/* &context->X0 */
"mov lr, #0
\n\t
"
"br x19"
)
...
...
dlls/ntdll/unix/signal_i386.c
View file @
1581fb61
...
...
@@ -2452,8 +2452,6 @@ __ASM_GLOBAL_FUNC( signal_start_thread,
"pushl 8(%ebp)
\n\t
"
/* entry */
"call "
__ASM_NAME
(
"get_initial_context"
)
"
\n\t
"
"movl %eax,(%esp)
\n\t
"
/* context */
"leal 0xb0(%eax),%eax
\n\t
"
/* &context->Eax */
"movl %eax,4(%esp)
\n\t
"
"movl 24(%ebp),%edx
\n\t
"
/* thunk */
"xorl %ebp,%ebp
\n\t
"
"pushl $0
\n\t
"
...
...
dlls/ntdll/unix/signal_x86_64.c
View file @
1581fb61
...
...
@@ -2713,7 +2713,6 @@ __ASM_GLOBAL_FUNC( signal_start_thread,
/* attach dlls */
"call "
__ASM_NAME
(
"get_initial_context"
)
"
\n\t
"
"movq %rax,%rcx
\n\t
"
/* context */
"leaq 0x80(%rcx),%rdx
\n\t
"
/* &context->Rcx */
"xorq %rax,%rax
\n\t
"
"pushq %rax
\n\t
"
"jmp *%rbx"
)
...
...
dlls/ntdll/unix/unix_private.h
View file @
1581fb61
...
...
@@ -120,7 +120,6 @@ extern NTSTATUS CDECL virtual_map_section( HANDLE handle, PVOID *addr_ptr, unsig
ULONG
protect
,
pe_image_info_t
*
image_info
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
virtual_release_address_space
(
void
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
server_init_process_done
(
void
*
relay
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
exec_process
(
UNICODE_STRING
*
path
,
UNICODE_STRING
*
cmdline
,
NTSTATUS
status
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
CDECL
unwind_builtin_dll
(
ULONG
type
,
struct
_DISPATCHER_CONTEXT
*
dispatch
,
CONTEXT
*
context
)
DECLSPEC_HIDDEN
;
...
...
@@ -170,6 +169,7 @@ extern unsigned int server_queue_process_apc( HANDLE process, const apc_call_t *
extern
int
server_get_unix_fd
(
HANDLE
handle
,
unsigned
int
wanted_access
,
int
*
unix_fd
,
int
*
needs_close
,
enum
server_fd_type
*
type
,
unsigned
int
*
options
)
DECLSPEC_HIDDEN
;
extern
void
server_init_process
(
void
)
DECLSPEC_HIDDEN
;
extern
void
server_init_process_done
(
void
)
DECLSPEC_HIDDEN
;
extern
size_t
server_init_thread
(
void
*
entry_point
,
BOOL
*
suspend
)
DECLSPEC_HIDDEN
;
extern
int
server_pipe
(
int
fd
[
2
]
)
DECLSPEC_HIDDEN
;
...
...
dlls/ntdll/unixlib.h
View file @
1581fb61
...
...
@@ -27,7 +27,7 @@
struct
_DISPATCHER_CONTEXT
;
/* increment this when you change the function table */
#define NTDLL_UNIXLIB_VERSION 9
8
#define NTDLL_UNIXLIB_VERSION 9
9
struct
unix_funcs
{
...
...
@@ -87,9 +87,6 @@ struct unix_funcs
/* thread/process functions */
NTSTATUS
(
CDECL
*
exec_process
)(
UNICODE_STRING
*
path
,
UNICODE_STRING
*
cmdline
,
NTSTATUS
status
);
/* server functions */
void
(
CDECL
*
server_init_process_done
)(
void
*
relay
);
/* file functions */
void
(
CDECL
*
set_show_dot_files
)(
BOOL
enable
);
...
...
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