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
84b3218e
Commit
84b3218e
authored
Aug 08, 2016
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Fix loading of IMAGE_OPTIONAL_HEADER.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5e7c8928
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
loader.c
dlls/kernel32/tests/loader.c
+7
-3
mapping.c
server/mapping.c
+1
-1
No files found.
dlls/kernel32/tests/loader.c
View file @
84b3218e
...
...
@@ -264,9 +264,13 @@ static void query_image_section( int id, const char *dll_name, const IMAGE_NT_HE
ok
(
image
.
CommittedStackSize
==
nt_header
->
OptionalHeader
.
SizeOfStackCommit
||
broken
(
truncated
),
"%u: CommittedStackSize wrong %lx / %lx
\n
"
,
id
,
image
.
CommittedStackSize
,
(
SIZE_T
)
nt_header
->
OptionalHeader
.
SizeOfStackCommit
);
ok
(
image
.
SubSystemType
==
nt_header
->
OptionalHeader
.
Subsystem
||
broken
(
truncated
),
"%u: SubSystemType wrong %08x / %08x
\n
"
,
id
,
image
.
SubSystemType
,
nt_header
->
OptionalHeader
.
Subsystem
);
if
(
truncated
)
ok
(
!
image
.
SubSystemType
||
broken
(
truncated
),
"%u: SubSystemType wrong %08x / 00000000
\n
"
,
id
,
image
.
SubSystemType
);
else
ok
(
image
.
SubSystemType
==
nt_header
->
OptionalHeader
.
Subsystem
,
"%u: SubSystemType wrong %08x / %08x
\n
"
,
id
,
image
.
SubSystemType
,
nt_header
->
OptionalHeader
.
Subsystem
);
ok
(
image
.
SubsystemVersionLow
==
nt_header
->
OptionalHeader
.
MinorSubsystemVersion
,
"%u: SubsystemVersionLow wrong %04x / %04x
\n
"
,
id
,
image
.
SubsystemVersionLow
,
nt_header
->
OptionalHeader
.
MinorSubsystemVersion
);
...
...
server/mapping.c
View file @
84b3218e
...
...
@@ -399,7 +399,7 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
size
=
pread
(
unix_fd
,
&
nt
,
sizeof
(
nt
),
pos
);
if
(
size
<
sizeof
(
nt
.
Signature
)
+
sizeof
(
nt
.
FileHeader
))
return
STATUS_INVALID_IMAGE_FORMAT
;
/* zero out Optional header in the case it's not present or partial */
size
=
min
(
size
,
nt
.
FileHeader
.
SizeOfOptionalHeader
);
size
=
min
(
size
,
sizeof
(
nt
.
Signature
)
+
sizeof
(
nt
.
FileHeader
)
+
nt
.
FileHeader
.
SizeOfOptionalHeader
);
if
(
size
<
sizeof
(
nt
))
memset
(
(
char
*
)
&
nt
+
size
,
0
,
sizeof
(
nt
)
-
size
);
if
(
nt
.
Signature
!=
IMAGE_NT_SIGNATURE
)
{
...
...
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