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
69a332fd
Commit
69a332fd
authored
Dec 27, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for the ImageContainsCode flag.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c1487e49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
1 deletion
+68
-1
loader.c
dlls/kernel32/tests/loader.c
+68
-1
No files found.
dlls/kernel32/tests/loader.c
View file @
69a332fd
...
...
@@ -325,10 +325,21 @@ static void query_image_section( int id, const char *dll_name, const IMAGE_NT_HE
"%u: ImageFileSize wrong %08x / %08x
\n
"
,
id
,
image
.
ImageFileSize
,
file_size
);
ok
(
image
.
CheckSum
==
nt_header
->
OptionalHeader
.
CheckSum
,
"%u: CheckSum wrong %08x / %08x
\n
"
,
id
,
image
.
CheckSum
,
nt_header
->
OptionalHeader
.
CheckSum
);
if
(
nt_header
->
OptionalHeader
.
SizeOfCode
||
nt_header
->
OptionalHeader
.
AddressOfEntryPoint
)
todo_wine
ok
(
image
.
ImageContainsCode
==
TRUE
,
"%u: ImageContainsCode wrong %u
\n
"
,
id
,
image
.
ImageContainsCode
);
else
if
((
nt_header
->
OptionalHeader
.
SectionAlignment
%
page_size
)
||
(
nt_header
->
FileHeader
.
NumberOfSections
==
1
&&
(
section
.
Characteristics
&
IMAGE_SCN_MEM_EXECUTE
)))
todo_wine
ok
(
image
.
ImageContainsCode
==
TRUE
||
broken
(
!
image
.
ImageContainsCode
),
/* <= win8 */
"%u: ImageContainsCode wrong %u
\n
"
,
id
,
image
.
ImageContainsCode
);
else
ok
(
!
image
.
ImageContainsCode
,
"%u: ImageContainsCode wrong %u
\n
"
,
id
,
image
.
ImageContainsCode
);
/* FIXME: needs more work: */
/* image.GpValue */
/* image.ImageFlags */
/* image.ImageContainsCode */
map_size
.
QuadPart
=
(
nt_header
->
OptionalHeader
.
SizeOfImage
+
page_size
-
1
)
&
~
(
page_size
-
1
);
status
=
pNtQuerySection
(
mapping
,
SectionBasicInformation
,
&
info
,
sizeof
(
info
),
NULL
);
...
...
@@ -873,6 +884,38 @@ static void test_Loader(void)
todo_wine
ok
(
status
==
(
is_wow64
?
STATUS_SUCCESS
:
STATUS_INVALID_IMAGE_WIN_64
),
"NtCreateSection error %08x
\n
"
,
status
);
nt64
.
OptionalHeader
.
SizeOfCode
=
0
;
nt64
.
OptionalHeader
.
AddressOfEntryPoint
=
0x1000
;
section
.
Characteristics
=
IMAGE_SCN_MEM_READ
|
IMAGE_SCN_CNT_CODE
;
status
=
map_image_section
(
(
IMAGE_NT_HEADERS
*
)
&
nt64
,
__LINE__
);
todo_wine
ok
(
status
==
(
is_wow64
?
STATUS_SUCCESS
:
STATUS_INVALID_IMAGE_WIN_64
),
"NtCreateSection error %08x
\n
"
,
status
);
nt64
.
OptionalHeader
.
SizeOfCode
=
0
;
nt64
.
OptionalHeader
.
AddressOfEntryPoint
=
0
;
section
.
Characteristics
=
IMAGE_SCN_MEM_READ
|
IMAGE_SCN_CNT_CODE
|
IMAGE_SCN_MEM_EXECUTE
;
status
=
map_image_section
(
(
IMAGE_NT_HEADERS
*
)
&
nt64
,
__LINE__
);
todo_wine
ok
(
status
==
(
is_wow64
?
STATUS_SUCCESS
:
STATUS_INVALID_IMAGE_WIN_64
),
"NtCreateSection error %08x
\n
"
,
status
);
nt64
.
OptionalHeader
.
SizeOfCode
=
0x1000
;
nt64
.
OptionalHeader
.
AddressOfEntryPoint
=
0
;
section
.
Characteristics
=
IMAGE_SCN_MEM_READ
|
IMAGE_SCN_CNT_CODE
;
status
=
map_image_section
(
(
IMAGE_NT_HEADERS
*
)
&
nt64
,
__LINE__
);
todo_wine
ok
(
status
==
(
is_wow64
?
STATUS_SUCCESS
:
STATUS_INVALID_IMAGE_WIN_64
),
"NtCreateSection error %08x
\n
"
,
status
);
nt64
.
OptionalHeader
.
SizeOfCode
=
0
;
nt64
.
OptionalHeader
.
AddressOfEntryPoint
=
0
;
section
.
Characteristics
=
IMAGE_SCN_MEM_READ
|
IMAGE_SCN_CNT_CODE
;
status
=
map_image_section
(
(
IMAGE_NT_HEADERS
*
)
&
nt64
,
__LINE__
);
todo_wine
ok
(
status
==
(
is_wow64
?
STATUS_SUCCESS
:
STATUS_INVALID_IMAGE_WIN_64
),
"NtCreateSection error %08x
\n
"
,
status
);
}
else
{
...
...
@@ -917,6 +960,30 @@ static void test_Loader(void)
status
=
map_image_section
(
(
IMAGE_NT_HEADERS
*
)
&
nt32
,
__LINE__
);
todo_wine
ok
(
status
==
STATUS_SUCCESS
,
"NtCreateSection error %08x
\n
"
,
status
);
nt32
.
OptionalHeader
.
SizeOfCode
=
0
;
nt32
.
OptionalHeader
.
AddressOfEntryPoint
=
0x1000
;
section
.
Characteristics
=
IMAGE_SCN_MEM_READ
|
IMAGE_SCN_CNT_CODE
;
status
=
map_image_section
(
(
IMAGE_NT_HEADERS
*
)
&
nt32
,
__LINE__
);
ok
(
status
==
STATUS_SUCCESS
,
"NtCreateSection error %08x
\n
"
,
status
);
nt32
.
OptionalHeader
.
SizeOfCode
=
0
;
nt32
.
OptionalHeader
.
AddressOfEntryPoint
=
0
;
section
.
Characteristics
=
IMAGE_SCN_MEM_READ
|
IMAGE_SCN_CNT_CODE
|
IMAGE_SCN_MEM_EXECUTE
;
status
=
map_image_section
(
(
IMAGE_NT_HEADERS
*
)
&
nt32
,
__LINE__
);
ok
(
status
==
STATUS_SUCCESS
,
"NtCreateSection error %08x
\n
"
,
status
);
nt32
.
OptionalHeader
.
SizeOfCode
=
0x1000
;
nt32
.
OptionalHeader
.
AddressOfEntryPoint
=
0
;
section
.
Characteristics
=
IMAGE_SCN_MEM_READ
|
IMAGE_SCN_CNT_CODE
;
status
=
map_image_section
(
(
IMAGE_NT_HEADERS
*
)
&
nt32
,
__LINE__
);
ok
(
status
==
STATUS_SUCCESS
,
"NtCreateSection error %08x
\n
"
,
status
);
nt32
.
OptionalHeader
.
SizeOfCode
=
0
;
nt32
.
OptionalHeader
.
AddressOfEntryPoint
=
0
;
section
.
Characteristics
=
IMAGE_SCN_MEM_READ
|
IMAGE_SCN_CNT_CODE
;
status
=
map_image_section
(
(
IMAGE_NT_HEADERS
*
)
&
nt32
,
__LINE__
);
ok
(
status
==
STATUS_SUCCESS
,
"NtCreateSection error %08x
\n
"
,
status
);
}
nt_header
.
FileHeader
.
Machine
=
orig_machine
;
/* restore it for the next tests */
...
...
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