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
622aeeba
Commit
622aeeba
authored
Sep 25, 2018
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Return more specific error status for NE binaries.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0dcfc97f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
loader.c
dlls/kernel32/tests/loader.c
+18
-0
mapping.c
server/mapping.c
+5
-2
trace.c
server/trace.c
+1
-0
No files found.
dlls/kernel32/tests/loader.c
View file @
622aeeba
...
...
@@ -972,6 +972,24 @@ static void test_Loader(void)
nt_header
.
Signature
=
IMAGE_OS2_SIGNATURE
;
status
=
map_image_section
(
&
nt_header
,
&
section
,
section_data
,
__LINE__
);
ok
(
status
==
STATUS_INVALID_IMAGE_NE_FORMAT
,
"NtCreateSection error %08x
\n
"
,
status
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
((
IMAGE_OS2_HEADER
*
)
&
nt_header
)
->
ne_exetyp
=
i
;
status
=
map_image_section
(
&
nt_header
,
&
section
,
section_data
,
__LINE__
);
switch
(
i
)
{
case
2
:
ok
(
status
==
STATUS_INVALID_IMAGE_WIN_16
,
"NtCreateSection %u error %08x
\n
"
,
i
,
status
);
break
;
case
5
:
ok
(
status
==
STATUS_INVALID_IMAGE_PROTECT
,
"NtCreateSection %u error %08x
\n
"
,
i
,
status
);
break
;
default:
ok
(
status
==
STATUS_INVALID_IMAGE_NE_FORMAT
,
"NtCreateSection %u error %08x
\n
"
,
i
,
status
);
break
;
}
}
((
IMAGE_OS2_HEADER
*
)
&
nt_header
)
->
ne_exetyp
=
((
IMAGE_OS2_HEADER
*
)
&
nt_header_template
)
->
ne_exetyp
;
nt_header
.
Signature
=
0xdeadbeef
;
status
=
map_image_section
(
&
nt_header
,
&
section
,
section_data
,
__LINE__
);
...
...
server/mapping.c
View file @
622aeeba
...
...
@@ -587,8 +587,11 @@ static unsigned int get_image_params( struct mapping *mapping, file_pos_t file_s
if
(
size
<
sizeof
(
nt
))
memset
(
(
char
*
)
&
nt
+
size
,
0
,
sizeof
(
nt
)
-
size
);
if
(
nt
.
Signature
!=
IMAGE_NT_SIGNATURE
)
{
if
(
*
(
WORD
*
)
&
nt
.
Signature
==
IMAGE_OS2_SIGNATURE
)
return
STATUS_INVALID_IMAGE_NE_FORMAT
;
return
STATUS_INVALID_IMAGE_PROTECT
;
IMAGE_OS2_HEADER
*
os2
=
(
IMAGE_OS2_HEADER
*
)
&
nt
;
if
(
os2
->
ne_magic
!=
IMAGE_OS2_SIGNATURE
)
return
STATUS_INVALID_IMAGE_PROTECT
;
if
(
os2
->
ne_exetyp
==
2
)
return
STATUS_INVALID_IMAGE_WIN_16
;
if
(
os2
->
ne_exetyp
==
5
)
return
STATUS_INVALID_IMAGE_PROTECT
;
return
STATUS_INVALID_IMAGE_NE_FORMAT
;
}
switch
(
nt
.
opt
.
hdr32
.
Magic
)
...
...
server/trace.c
View file @
622aeeba
...
...
@@ -5480,6 +5480,7 @@ static const struct
{
"INVALID_IMAGE_NE_FORMAT"
,
STATUS_INVALID_IMAGE_NE_FORMAT
},
{
"INVALID_IMAGE_NOT_MZ"
,
STATUS_INVALID_IMAGE_NOT_MZ
},
{
"INVALID_IMAGE_PROTECT"
,
STATUS_INVALID_IMAGE_PROTECT
},
{
"INVALID_IMAGE_WIN_16"
,
STATUS_INVALID_IMAGE_WIN_16
},
{
"INVALID_IMAGE_WIN_64"
,
STATUS_INVALID_IMAGE_WIN_64
},
{
"INVALID_LOCK_SEQUENCE"
,
STATUS_INVALID_LOCK_SEQUENCE
},
{
"INVALID_OWNER"
,
STATUS_INVALID_OWNER
},
...
...
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