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
50fca716
Commit
50fca716
authored
Jul 13, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Moved the calling of the process entry point to LdrInitializeThunk.
parent
38440f56
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
22 deletions
+16
-22
process.c
dlls/kernel/process.c
+0
-17
loader.c
dlls/ntdll/loader.c
+15
-4
winternl.h
include/winternl.h
+1
-1
No files found.
dlls/kernel/process.c
View file @
50fca716
...
@@ -54,7 +54,6 @@
...
@@ -54,7 +54,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
process
);
WINE_DEFAULT_DEBUG_CHANNEL
(
process
);
WINE_DECLARE_DEBUG_CHANNEL
(
file
);
WINE_DECLARE_DEBUG_CHANNEL
(
file
);
WINE_DECLARE_DEBUG_CHANNEL
(
relay
);
typedef
struct
typedef
struct
{
{
...
@@ -794,23 +793,7 @@ static void start_process( void *arg )
...
@@ -794,23 +793,7 @@ static void start_process( void *arg )
{
{
__TRY
__TRY
{
{
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
IMAGE_NT_HEADERS
*
nt
;
LPTHREAD_START_ROUTINE
entry
;
LdrInitializeThunk
(
0
,
0
,
0
,
0
);
LdrInitializeThunk
(
0
,
0
,
0
,
0
);
nt
=
RtlImageNtHeader
(
peb
->
ImageBaseAddress
);
entry
=
(
LPTHREAD_START_ROUTINE
)((
char
*
)
peb
->
ImageBaseAddress
+
nt
->
OptionalHeader
.
AddressOfEntryPoint
);
if
(
TRACE_ON
(
relay
))
DPRINTF
(
"%04lx:Starting process %s (entryproc=%p)
\n
"
,
GetCurrentThreadId
(),
debugstr_w
(
peb
->
ProcessParameters
->
ImagePathName
.
Buffer
),
entry
);
SetLastError
(
0
);
/* clear error code */
if
(
peb
->
BeingDebugged
)
DbgBreakPoint
();
ExitProcess
(
entry
(
peb
)
);
}
}
__EXCEPT
(
UnhandledExceptionFilter
)
__EXCEPT
(
UnhandledExceptionFilter
)
{
{
...
...
dlls/ntdll/loader.c
View file @
50fca716
...
@@ -2094,6 +2094,8 @@ void WINAPI LdrInitializeThunk( ULONG unknown1, ULONG unknown2, ULONG unknown3,
...
@@ -2094,6 +2094,8 @@ void WINAPI LdrInitializeThunk( ULONG unknown1, ULONG unknown2, ULONG unknown3,
LPCWSTR
load_path
;
LPCWSTR
load_path
;
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
IMAGE_NT_HEADERS
*
nt
=
RtlImageNtHeader
(
peb
->
ImageBaseAddress
);
IMAGE_NT_HEADERS
*
nt
=
RtlImageNtHeader
(
peb
->
ImageBaseAddress
);
LPTHREAD_START_ROUTINE
entry
=
(
LPTHREAD_START_ROUTINE
)((
char
*
)
peb
->
ImageBaseAddress
+
nt
->
OptionalHeader
.
AddressOfEntryPoint
);
if
(
main_exe_file
)
NtClose
(
main_exe_file
);
/* at this point the main module is created */
if
(
main_exe_file
)
NtClose
(
main_exe_file
);
/* at this point the main module is created */
...
@@ -2125,9 +2127,9 @@ void WINAPI LdrInitializeThunk( ULONG unknown1, ULONG unknown2, ULONG unknown3,
...
@@ -2125,9 +2127,9 @@ void WINAPI LdrInitializeThunk( ULONG unknown1, ULONG unknown2, ULONG unknown3,
/* Signal the parent process to continue */
/* Signal the parent process to continue */
SERVER_START_REQ
(
init_process_done
)
SERVER_START_REQ
(
init_process_done
)
{
{
req
->
module
=
peb
->
ImageBaseAddress
;
req
->
module
=
peb
->
ImageBaseAddress
;
req
->
entry
=
(
char
*
)
peb
->
ImageBaseAddress
+
nt
->
OptionalHeader
.
AddressOfEntryPoint
;
req
->
entry
=
entry
;
req
->
gui
=
(
nt
->
OptionalHeader
.
Subsystem
!=
IMAGE_SUBSYSTEM_WINDOWS_CUI
);
req
->
gui
=
(
nt
->
OptionalHeader
.
Subsystem
!=
IMAGE_SUBSYSTEM_WINDOWS_CUI
);
status
=
wine_server_call
(
req
);
status
=
wine_server_call
(
req
);
}
}
SERVER_END_REQ
;
SERVER_END_REQ
;
...
@@ -2151,7 +2153,16 @@ void WINAPI LdrInitializeThunk( ULONG unknown1, ULONG unknown2, ULONG unknown3,
...
@@ -2151,7 +2153,16 @@ void WINAPI LdrInitializeThunk( ULONG unknown1, ULONG unknown2, ULONG unknown3,
RtlLeaveCriticalSection
(
&
loader_section
);
RtlLeaveCriticalSection
(
&
loader_section
);
if
(
nt
->
FileHeader
.
Characteristics
&
IMAGE_FILE_LARGE_ADDRESS_AWARE
)
VIRTUAL_UseLargeAddressSpace
();
if
(
nt
->
FileHeader
.
Characteristics
&
IMAGE_FILE_LARGE_ADDRESS_AWARE
)
VIRTUAL_UseLargeAddressSpace
();
return
;
if
(
TRACE_ON
(
relay
))
DPRINTF
(
"%04lx:Starting process %s (entryproc=%p)
\n
"
,
GetCurrentThreadId
(),
debugstr_w
(
peb
->
ProcessParameters
->
ImagePathName
.
Buffer
),
entry
);
RtlSetLastWin32ErrorAndNtStatusFromNtStatus
(
STATUS_SUCCESS
);
/* clear error code */
if
(
peb
->
BeingDebugged
)
DbgBreakPoint
();
status
=
entry
(
peb
);
LdrShutdownProcess
();
NtTerminateProcess
(
GetCurrentProcess
(),
status
);
error:
error:
ERR
(
"Main exe initialization for %s failed, status %lx
\n
"
,
ERR
(
"Main exe initialization for %s failed, status %lx
\n
"
,
...
...
include/winternl.h
View file @
50fca716
...
@@ -1726,7 +1726,7 @@ NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULO
...
@@ -1726,7 +1726,7 @@ NTSTATUS WINAPI LdrFindResourceDirectory_U(HMODULE,const LDR_RESOURCE_INFO*,ULO
NTSTATUS
WINAPI
LdrFindResource_U
(
HMODULE
,
const
LDR_RESOURCE_INFO
*
,
ULONG
,
const
IMAGE_RESOURCE_DATA_ENTRY
**
);
NTSTATUS
WINAPI
LdrFindResource_U
(
HMODULE
,
const
LDR_RESOURCE_INFO
*
,
ULONG
,
const
IMAGE_RESOURCE_DATA_ENTRY
**
);
NTSTATUS
WINAPI
LdrGetDllHandle
(
ULONG
,
ULONG
,
const
UNICODE_STRING
*
,
HMODULE
*
);
NTSTATUS
WINAPI
LdrGetDllHandle
(
ULONG
,
ULONG
,
const
UNICODE_STRING
*
,
HMODULE
*
);
NTSTATUS
WINAPI
LdrGetProcedureAddress
(
HMODULE
,
const
ANSI_STRING
*
,
ULONG
,
void
**
);
NTSTATUS
WINAPI
LdrGetProcedureAddress
(
HMODULE
,
const
ANSI_STRING
*
,
ULONG
,
void
**
);
void
WINAPI
LdrInitializeThunk
(
ULONG
,
ULONG
,
ULONG
,
ULONG
);
void
DECLSPEC_NORETURN
WINAPI
LdrInitializeThunk
(
ULONG
,
ULONG
,
ULONG
,
ULONG
);
NTSTATUS
WINAPI
LdrLoadDll
(
LPCWSTR
,
DWORD
,
const
UNICODE_STRING
*
,
HMODULE
*
);
NTSTATUS
WINAPI
LdrLoadDll
(
LPCWSTR
,
DWORD
,
const
UNICODE_STRING
*
,
HMODULE
*
);
void
WINAPI
LdrShutdownProcess
(
void
);
void
WINAPI
LdrShutdownProcess
(
void
);
void
WINAPI
LdrShutdownThread
(
void
);
void
WINAPI
LdrShutdownThread
(
void
);
...
...
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