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
b35f0007
Commit
b35f0007
authored
Oct 13, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Move LdrInitializeThunk to the CPU backends.
parent
db89311a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
27 deletions
+39
-27
loader.c
dlls/ntdll/loader.c
+2
-14
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-1
signal_arm.c
dlls/ntdll/signal_arm.c
+7
-6
signal_arm64.c
dlls/ntdll/signal_arm64.c
+7
-6
signal_i386.c
dlls/ntdll/signal_i386.c
+11
-0
signal_x86_64.c
dlls/ntdll/signal_x86_64.c
+11
-0
No files found.
dlls/ntdll/loader.c
View file @
b35f0007
...
@@ -4188,28 +4188,17 @@ static void release_address_space(void)
...
@@ -4188,28 +4188,17 @@ static void release_address_space(void)
}
}
/******************************************************************
/******************************************************************
*
LdrInitializeThunk (NTDLL.@)
*
loader_init
*
*
* Attach to all the loaded dlls.
* Attach to all the loaded dlls.
* If this is the first time, perform the full process initialization.
* If this is the first time, perform the full process initialization.
*/
*/
void
WINAPI
LdrInitializeThunk
(
CONTEXT
*
context
,
ULONG_PTR
unknown2
,
ULONG_PTR
unknown3
,
ULONG_PTR
unknown4
)
void
loader_init
(
CONTEXT
*
context
,
void
**
entry
)
{
{
static
int
attach_done
;
static
int
attach_done
;
NTSTATUS
status
;
NTSTATUS
status
;
ULONG_PTR
cookie
;
ULONG_PTR
cookie
;
WINE_MODREF
*
wm
;
WINE_MODREF
*
wm
;
void
**
entry
;
#ifdef __i386__
entry
=
(
void
**
)
&
context
->
Eax
;
#elif defined(__x86_64__)
entry
=
(
void
**
)
&
context
->
Rcx
;
#elif defined(__arm__)
entry
=
(
void
**
)
&
context
->
R0
;
#elif defined(__aarch64__)
entry
=
(
void
**
)
&
context
->
X0
;
#endif
if
(
process_detaching
)
NtTerminateThread
(
GetCurrentThread
(),
0
);
if
(
process_detaching
)
NtTerminateThread
(
GetCurrentThread
(),
0
);
...
@@ -4335,7 +4324,6 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
...
@@ -4335,7 +4324,6 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
}
}
RtlLeaveCriticalSection
(
&
loader_section
);
RtlLeaveCriticalSection
(
&
loader_section
);
signal_start_thread
(
context
);
}
}
...
...
dlls/ntdll/ntdll_misc.h
View file @
b35f0007
...
@@ -68,12 +68,12 @@ extern const char *debugstr_exception_code( DWORD code ) DECLSPEC_HIDDEN;
...
@@ -68,12 +68,12 @@ extern const char *debugstr_exception_code( DWORD code ) DECLSPEC_HIDDEN;
extern
void
set_native_thread_name
(
DWORD
tid
,
const
char
*
name
)
DECLSPEC_HIDDEN
;
extern
void
set_native_thread_name
(
DWORD
tid
,
const
char
*
name
)
DECLSPEC_HIDDEN
;
/* init routines */
/* init routines */
extern
void
loader_init
(
CONTEXT
*
context
,
void
**
entry
)
DECLSPEC_HIDDEN
;
extern
void
version_init
(
void
)
DECLSPEC_HIDDEN
;
extern
void
version_init
(
void
)
DECLSPEC_HIDDEN
;
extern
void
debug_init
(
void
)
DECLSPEC_HIDDEN
;
extern
void
debug_init
(
void
)
DECLSPEC_HIDDEN
;
extern
void
actctx_init
(
void
)
DECLSPEC_HIDDEN
;
extern
void
actctx_init
(
void
)
DECLSPEC_HIDDEN
;
extern
void
locale_init
(
void
)
DECLSPEC_HIDDEN
;
extern
void
locale_init
(
void
)
DECLSPEC_HIDDEN
;
extern
void
init_user_process_params
(
void
)
DECLSPEC_HIDDEN
;
extern
void
init_user_process_params
(
void
)
DECLSPEC_HIDDEN
;
extern
void
CDECL
DECLSPEC_NORETURN
signal_start_thread
(
CONTEXT
*
ctx
)
DECLSPEC_HIDDEN
;
extern
void
get_resource_lcids
(
LANGID
*
user
,
LANGID
*
user_neutral
,
LANGID
*
system
)
DECLSPEC_HIDDEN
;
extern
void
get_resource_lcids
(
LANGID
*
user
,
LANGID
*
user_neutral
,
LANGID
*
system
)
DECLSPEC_HIDDEN
;
/* module handling */
/* module handling */
...
...
dlls/ntdll/signal_arm.c
View file @
b35f0007
...
@@ -1487,13 +1487,14 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
...
@@ -1487,13 +1487,14 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
return
0
;
return
0
;
}
}
/******************************************************************
*****
/******************************************************************
*
signal_start_thread
*
LdrInitializeThunk (NTDLL.@)
*/
*/
__ASM_GLOBAL_FUNC
(
signal_start_thread
,
void
WINAPI
LdrInitializeThunk
(
CONTEXT
*
context
,
ULONG_PTR
unk2
,
ULONG_PTR
unk3
,
ULONG_PTR
unk4
)
"mov sp, r0
\n\t
"
/* context */
{
"mov r1, #1
\n\t
"
loader_init
(
context
,
(
void
**
)
&
context
->
R0
);
"b "
__ASM_NAME
(
"NtContinue"
)
)
NtContinue
(
context
,
TRUE
);
}
/**********************************************************************
/**********************************************************************
* DbgBreakPoint (NTDLL.@)
* DbgBreakPoint (NTDLL.@)
...
...
dlls/ntdll/signal_arm64.c
View file @
b35f0007
...
@@ -1524,13 +1524,14 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
...
@@ -1524,13 +1524,14 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
return
0
;
return
0
;
}
}
/******************************************************************
*****
/******************************************************************
*
signal_start_thread
*
LdrInitializeThunk (NTDLL.@)
*/
*/
__ASM_GLOBAL_FUNC
(
signal_start_thread
,
void
WINAPI
LdrInitializeThunk
(
CONTEXT
*
context
,
ULONG_PTR
unk2
,
ULONG_PTR
unk3
,
ULONG_PTR
unk4
)
"mov sp, x0
\n\t
"
/* context */
{
"mov x1, #1
\n\t
"
loader_init
(
context
,
(
void
**
)
&
context
->
X0
);
"b "
__ASM_NAME
(
"NtContinue"
)
)
NtContinue
(
context
,
TRUE
);
}
/**********************************************************************
/**********************************************************************
* DbgBreakPoint (NTDLL.@)
* DbgBreakPoint (NTDLL.@)
...
...
dlls/ntdll/signal_i386.c
View file @
b35f0007
...
@@ -537,6 +537,7 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
...
@@ -537,6 +537,7 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
/***********************************************************************
/***********************************************************************
* signal_start_thread
* signal_start_thread
*/
*/
extern
void
CDECL
DECLSPEC_NORETURN
signal_start_thread
(
CONTEXT
*
ctx
)
DECLSPEC_HIDDEN
;
__ASM_GLOBAL_FUNC
(
signal_start_thread
,
__ASM_GLOBAL_FUNC
(
signal_start_thread
,
"movl 4(%esp),%esi
\n\t
"
/* context */
"movl 4(%esp),%esi
\n\t
"
/* context */
"leal -12(%esi),%edi
\n\t
"
"leal -12(%esi),%edi
\n\t
"
...
@@ -554,6 +555,16 @@ __ASM_GLOBAL_FUNC( signal_start_thread,
...
@@ -554,6 +555,16 @@ __ASM_GLOBAL_FUNC( signal_start_thread,
"movl %esi,(%esp)
\n\t
"
"movl %esi,(%esp)
\n\t
"
"call "
__ASM_STDCALL
(
"NtContinue"
,
8
)
)
"call "
__ASM_STDCALL
(
"NtContinue"
,
8
)
)
/******************************************************************
* LdrInitializeThunk (NTDLL.@)
*/
void
WINAPI
LdrInitializeThunk
(
CONTEXT
*
context
,
ULONG_PTR
unk2
,
ULONG_PTR
unk3
,
ULONG_PTR
unk4
)
{
loader_init
(
context
,
(
void
**
)
&
context
->
Eax
);
signal_start_thread
(
context
);
}
/**********************************************************************
/**********************************************************************
* DbgBreakPoint (NTDLL.@)
* DbgBreakPoint (NTDLL.@)
*/
*/
...
...
dlls/ntdll/signal_x86_64.c
View file @
b35f0007
...
@@ -1590,6 +1590,7 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
...
@@ -1590,6 +1590,7 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
/***********************************************************************
/***********************************************************************
* signal_start_thread
* signal_start_thread
*/
*/
extern
void
CDECL
DECLSPEC_NORETURN
signal_start_thread
(
CONTEXT
*
ctx
)
DECLSPEC_HIDDEN
;
__ASM_GLOBAL_FUNC
(
signal_start_thread
,
__ASM_GLOBAL_FUNC
(
signal_start_thread
,
"movq %rcx,%rbx
\n\t
"
/* context */
"movq %rcx,%rbx
\n\t
"
/* context */
/* clear the thread stack */
/* clear the thread stack */
...
@@ -1607,6 +1608,16 @@ __ASM_GLOBAL_FUNC( signal_start_thread,
...
@@ -1607,6 +1608,16 @@ __ASM_GLOBAL_FUNC( signal_start_thread,
"call "
__ASM_NAME
(
"NtContinue"
)
)
"call "
__ASM_NAME
(
"NtContinue"
)
)
/******************************************************************
* LdrInitializeThunk (NTDLL.@)
*/
void
WINAPI
LdrInitializeThunk
(
CONTEXT
*
context
,
ULONG_PTR
unk2
,
ULONG_PTR
unk3
,
ULONG_PTR
unk4
)
{
loader_init
(
context
,
(
void
**
)
&
context
->
Rcx
);
signal_start_thread
(
context
);
}
/**********************************************************************
/**********************************************************************
* DbgBreakPoint (NTDLL.@)
* DbgBreakPoint (NTDLL.@)
*/
*/
...
...
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