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
f9df57d9
Commit
f9df57d9
authored
Oct 24, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call the application entry point from kernel32, some apps depend on
that.
parent
b6ee614a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
process.c
dlls/kernel/process.c
+16
-0
loader.c
dlls/ntdll/loader.c
+3
-12
No files found.
dlls/kernel/process.c
View file @
f9df57d9
...
...
@@ -723,7 +723,23 @@ static void start_process( void *arg )
{
__TRY
{
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
IMAGE_NT_HEADERS
*
nt
;
LPTHREAD_START_ROUTINE
entry
;
LdrInitializeThunk
(
main_exe_file
,
CreateFileW
,
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
)
{
...
...
dlls/ntdll/loader.c
View file @
f9df57d9
...
...
@@ -697,7 +697,7 @@ static BOOL MODULE_InitDLL( WINE_MODREF *wm, UINT reason, LPVOID lpReserved )
if
(
TRACE_ON
(
relay
))
{
size_t
len
=
m
ax
(
wm
->
ldr
.
BaseDllName
.
Length
,
sizeof
(
mod_name
)
-
sizeof
(
WCHAR
)
);
size_t
len
=
m
in
(
wm
->
ldr
.
BaseDllName
.
Length
,
sizeof
(
mod_name
)
-
sizeof
(
WCHAR
)
);
memcpy
(
mod_name
,
wm
->
ldr
.
BaseDllName
.
Buffer
,
len
);
mod_name
[
len
/
sizeof
(
WCHAR
)]
=
0
;
DPRINTF
(
"%04lx:Call PE DLL (proc=%p,module=%p %s,reason=%s,res=%p)
\n
"
,
...
...
@@ -1779,7 +1779,6 @@ void WINAPI LdrInitializeThunk( HANDLE main_file, void *CreateFileW_ptr, ULONG u
NTSTATUS
status
;
WINE_MODREF
*
wm
;
LPCWSTR
load_path
;
LPTHREAD_START_ROUTINE
entry
;
PEB
*
peb
=
NtCurrentTeb
()
->
Peb
;
UNICODE_STRING
*
main_exe_name
=
&
peb
->
ProcessParameters
->
ImagePathName
;
IMAGE_NT_HEADERS
*
nt
=
RtlImageNtHeader
(
peb
->
ImageBaseAddress
);
...
...
@@ -1798,7 +1797,6 @@ void WINAPI LdrInitializeThunk( HANDLE main_file, void *CreateFileW_ptr, ULONG u
goto
error
;
}
wm
->
ldr
.
LoadCount
=
-
1
;
/* can't unload main exe */
entry
=
wm
->
ldr
.
EntryPoint
;
/* Install signal handlers; this cannot be done before, since we cannot
* send exceptions to the debugger before the create process event that
...
...
@@ -1813,7 +1811,7 @@ void WINAPI LdrInitializeThunk( HANDLE main_file, void *CreateFileW_ptr, ULONG u
{
req
->
module
=
peb
->
ImageBaseAddress
;
req
->
module_size
=
wm
->
ldr
.
SizeOfImage
;
req
->
entry
=
entry
;
req
->
entry
=
wm
->
ldr
.
EntryPoint
;
/* API requires a double indirection */
req
->
name
=
&
main_exe_name
->
Buffer
;
req
->
exe_file
=
main_file
;
...
...
@@ -1835,14 +1833,7 @@ void WINAPI LdrInitializeThunk( HANDLE main_file, void *CreateFileW_ptr, ULONG u
if
((
status
=
process_attach
(
wm
,
(
LPVOID
)
1
))
!=
STATUS_SUCCESS
)
goto
error
;
RtlLeaveCriticalSection
(
&
loader_section
);
if
(
TRACE_ON
(
relay
))
DPRINTF
(
"%04lx:Starting process %s (entryproc=%p)
\n
"
,
GetCurrentThreadId
(),
debugstr_w
(
peb
->
ProcessParameters
->
ImagePathName
.
Buffer
),
entry
);
NtCurrentTeb
()
->
last_error
=
0
;
/* clear error code */
if
(
peb
->
BeingDebugged
)
DbgBreakPoint
();
NtTerminateProcess
(
GetCurrentProcess
(),
entry
(
peb
)
);
return
;
error:
ERR
(
"Main exe initialization failed, status %lx
\n
"
,
status
);
...
...
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