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
e65b8d92
Commit
e65b8d92
authored
Feb 08, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel: Use a standard LoadLibrary call to load the main exe.
parent
1d23e7fe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
61 deletions
+4
-61
process.c
dlls/kernel/process.c
+4
-61
No files found.
dlls/kernel/process.c
View file @
e65b8d92
...
...
@@ -297,65 +297,6 @@ static BOOL find_exe_file( const WCHAR *name, WCHAR *buffer, int buflen, HANDLE
}
/**********************************************************************
* load_pe_exe
*
* Load a PE format EXE file.
*/
static
HMODULE
load_pe_exe
(
const
WCHAR
*
name
,
HANDLE
file
)
{
IO_STATUS_BLOCK
io
;
FILE_FS_DEVICE_INFORMATION
device_info
;
IMAGE_NT_HEADERS
*
nt
;
HANDLE
mapping
;
void
*
module
;
OBJECT_ATTRIBUTES
attr
;
LARGE_INTEGER
size
;
SIZE_T
len
=
0
;
attr
.
Length
=
sizeof
(
attr
);
attr
.
RootDirectory
=
0
;
attr
.
ObjectName
=
NULL
;
attr
.
Attributes
=
0
;
attr
.
SecurityDescriptor
=
NULL
;
attr
.
SecurityQualityOfService
=
NULL
;
size
.
QuadPart
=
0
;
if
(
NtCreateSection
(
&
mapping
,
STANDARD_RIGHTS_REQUIRED
|
SECTION_QUERY
|
SECTION_MAP_READ
,
&
attr
,
&
size
,
0
,
SEC_IMAGE
,
file
)
!=
STATUS_SUCCESS
)
return
NULL
;
module
=
NULL
;
if
(
NtMapViewOfSection
(
mapping
,
GetCurrentProcess
(),
&
module
,
0
,
0
,
&
size
,
&
len
,
ViewShare
,
0
,
PAGE_READONLY
)
!=
STATUS_SUCCESS
)
return
NULL
;
NtClose
(
mapping
);
/* virus check */
nt
=
RtlImageNtHeader
(
module
);
if
(
nt
->
OptionalHeader
.
AddressOfEntryPoint
)
{
if
(
!
RtlImageRvaToSection
(
nt
,
module
,
nt
->
OptionalHeader
.
AddressOfEntryPoint
))
MESSAGE
(
"VIRUS WARNING: PE module %s has an invalid entrypoint (0x%08lx) "
"outside all sections (possibly infected by Tchernobyl/SpaceFiller virus)!
\n
"
,
debugstr_w
(
name
),
nt
->
OptionalHeader
.
AddressOfEntryPoint
);
}
if
(
NtQueryVolumeInformationFile
(
file
,
&
io
,
&
device_info
,
sizeof
(
device_info
),
FileFsDeviceInformation
)
==
STATUS_SUCCESS
)
{
/* don't keep the file handle open on removable media */
if
(
device_info
.
Characteristics
&
FILE_REMOVABLE_MEDIA
)
{
CloseHandle
(
main_exe_file
);
main_exe_file
=
0
;
}
}
return
module
;
}
/***********************************************************************
* build_initial_environment
*
...
...
@@ -1098,8 +1039,10 @@ void __wine_kernel_init(void)
{
case
BINARY_PE_EXE
:
TRACE
(
"starting Win32 binary %s
\n
"
,
debugstr_w
(
main_exe_name
)
);
if
((
peb
->
ImageBaseAddress
=
load_pe_exe
(
main_exe_name
,
main_exe_file
)))
goto
found
;
peb
->
ImageBaseAddress
=
LoadLibraryExW
(
main_exe_name
,
0
,
DONT_RESOLVE_DLL_REFERENCES
);
CloseHandle
(
main_exe_file
);
main_exe_file
=
0
;
if
(
peb
->
ImageBaseAddress
)
goto
found
;
MESSAGE
(
"wine: could not load %s as Win32 binary
\n
"
,
debugstr_w
(
main_exe_name
)
);
ExitProcess
(
1
);
case
BINARY_PE_DLL
:
...
...
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