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
9669ff8d
Commit
9669ff8d
authored
Feb 08, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Get rid of the main_file argument in LdrInitializeThunk.
parent
e65b8d92
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
15 deletions
+7
-15
process.c
dlls/kernel/process.c
+5
-9
loader.c
dlls/ntdll/loader.c
+1
-5
winternl.h
include/winternl.h
+1
-1
No files found.
dlls/kernel/process.c
View file @
9669ff8d
...
...
@@ -951,7 +951,7 @@ static void start_process( void *arg )
IMAGE_NT_HEADERS
*
nt
;
LPTHREAD_START_ROUTINE
entry
;
LdrInitializeThunk
(
main_exe_file
,
0
,
0
,
0
);
LdrInitializeThunk
(
0
,
0
,
0
,
0
);
nt
=
RtlImageNtHeader
(
peb
->
ImageBaseAddress
);
entry
=
(
LPTHREAD_START_ROUTINE
)((
char
*
)
peb
->
ImageBaseAddress
+
...
...
@@ -1039,10 +1039,8 @@ void __wine_kernel_init(void)
{
case
BINARY_PE_EXE
:
TRACE
(
"starting Win32 binary %s
\n
"
,
debugstr_w
(
main_exe_name
)
);
peb
->
ImageBaseAddress
=
LoadLibraryExW
(
main_exe_name
,
0
,
DONT_RESOLVE_DLL_REFERENCES
);
CloseHandle
(
main_exe_file
);
main_exe_file
=
0
;
if
(
peb
->
ImageBaseAddress
)
goto
found
;
if
((
peb
->
ImageBaseAddress
=
LoadLibraryExW
(
main_exe_name
,
0
,
DONT_RESOLVE_DLL_REFERENCES
)))
goto
found
;
MESSAGE
(
"wine: could not load %s as Win32 binary
\n
"
,
debugstr_w
(
main_exe_name
)
);
ExitProcess
(
1
);
case
BINARY_PE_DLL
:
...
...
@@ -1061,8 +1059,6 @@ void __wine_kernel_init(void)
case
BINARY_WIN16
:
case
BINARY_DOS
:
TRACE
(
"starting Win16/DOS binary %s
\n
"
,
debugstr_w
(
main_exe_name
)
);
CloseHandle
(
main_exe_file
);
main_exe_file
=
0
;
__wine_main_argv
--
;
__wine_main_argc
++
;
__wine_main_argv
[
0
]
=
"winevdm.exe"
;
...
...
@@ -1079,8 +1075,6 @@ void __wine_kernel_init(void)
char
*
unix_name
;
TRACE
(
"starting Winelib app %s
\n
"
,
debugstr_w
(
main_exe_name
)
);
CloseHandle
(
main_exe_file
);
main_exe_file
=
0
;
if
((
unix_name
=
wine_get_unix_file_name
(
main_exe_name
))
&&
wine_dlopen
(
unix_name
,
RTLD_NOW
,
error
,
sizeof
(
error
)
))
{
...
...
@@ -1100,6 +1094,8 @@ void __wine_kernel_init(void)
}
found:
CloseHandle
(
main_exe_file
);
/* build command line */
set_library_wargv
(
__wine_main_argv
);
if
(
!
build_command_line
(
__wine_main_wargv
))
goto
error
;
...
...
dlls/ntdll/loader.c
View file @
9669ff8d
...
...
@@ -2015,9 +2015,8 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule)
/******************************************************************
* LdrInitializeThunk (NTDLL.@)
*
* FIXME: the arguments are not correct, main_file is a Wine invention.
*/
void
WINAPI
LdrInitializeThunk
(
HANDLE
main_file
,
ULONG
unknown2
,
ULONG
unknown3
,
ULONG
unknown4
)
void
WINAPI
LdrInitializeThunk
(
ULONG
unknown1
,
ULONG
unknown2
,
ULONG
unknown3
,
ULONG
unknown4
)
{
NTSTATUS
status
;
WINE_MODREF
*
wm
;
...
...
@@ -2058,15 +2057,12 @@ void WINAPI LdrInitializeThunk( HANDLE main_file, ULONG unknown2, ULONG unknown3
req
->
entry
=
(
char
*
)
peb
->
ImageBaseAddress
+
nt
->
OptionalHeader
.
AddressOfEntryPoint
;
/* API requires a double indirection */
req
->
name
=
&
wm
->
ldr
.
FullDllName
.
Buffer
;
req
->
exe_file
=
main_file
;
req
->
gui
=
(
nt
->
OptionalHeader
.
Subsystem
!=
IMAGE_SUBSYSTEM_WINDOWS_CUI
);
wine_server_add_data
(
req
,
wm
->
ldr
.
FullDllName
.
Buffer
,
wm
->
ldr
.
FullDllName
.
Length
);
wine_server_call
(
req
);
}
SERVER_END_REQ
;
if
(
main_file
)
NtClose
(
main_file
);
/* we no longer need it */
RtlEnterCriticalSection
(
&
loader_section
);
load_path
=
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
DllPath
.
Buffer
;
...
...
include/winternl.h
View file @
9669ff8d
...
...
@@ -1700,7 +1700,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
LdrGetDllHandle
(
ULONG
,
ULONG
,
const
UNICODE_STRING
*
,
HMODULE
*
);
NTSTATUS
WINAPI
LdrGetProcedureAddress
(
HMODULE
,
const
ANSI_STRING
*
,
ULONG
,
void
**
);
void
WINAPI
LdrInitializeThunk
(
HANDLE
,
ULONG
,
ULONG
,
ULONG
);
void
WINAPI
LdrInitializeThunk
(
ULONG
,
ULONG
,
ULONG
,
ULONG
);
NTSTATUS
WINAPI
LdrLoadDll
(
LPCWSTR
,
DWORD
,
const
UNICODE_STRING
*
,
HMODULE
*
);
void
WINAPI
LdrShutdownProcess
(
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