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
fdf6d7de
Commit
fdf6d7de
authored
Mar 11, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add some tests for the behavior of queries on a dead process.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4393438a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
2 deletions
+69
-2
process.c
dlls/kernel32/tests/process.c
+69
-2
No files found.
dlls/kernel32/tests/process.c
View file @
fdf6d7de
...
...
@@ -4171,6 +4171,72 @@ static void test_handle_list_attribute(BOOL child, HANDLE handle1, HANDLE handle
CloseHandle
(
pipe
[
1
]);
}
static
void
test_dead_process
(
void
)
{
DWORD_PTR
data
[
256
];
PROCESS_BASIC_INFORMATION
basic
;
SYSTEM_PROCESS_INFORMATION
*
spi
;
SECTION_IMAGE_INFORMATION
image
;
PROCESS_INFORMATION
pi
;
PROCESS_PRIORITY_CLASS
*
prio
=
(
PROCESS_PRIORITY_CLASS
*
)
data
;
BYTE
*
buffer
=
NULL
;
BOOL
found
;
ULONG
size
=
0
;
DWORD
offset
=
0
;
NTSTATUS
status
;
create_process
(
"exit"
,
&
pi
);
wait_child_process
(
pi
.
hProcess
);
Sleep
(
100
);
memset
(
data
,
0
,
sizeof
(
data
)
);
status
=
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessImageFileName
,
data
,
sizeof
(
data
),
NULL
);
ok
(
!
status
,
"ProcessImageFileName failed %x
\n
"
,
status
);
todo_wine
ok
(
((
UNICODE_STRING
*
)
data
)
->
Length
,
"ProcessImageFileName not set
\n
"
);
todo_wine
ok
(
((
UNICODE_STRING
*
)
data
)
->
Buffer
[
0
]
==
'\\'
,
"ProcessImageFileName not set
\n
"
);
memset
(
prio
,
0xcc
,
sizeof
(
*
prio
)
);
status
=
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessPriorityClass
,
prio
,
sizeof
(
*
prio
),
NULL
);
ok
(
!
status
,
"ProcessPriorityClass failed %x
\n
"
,
status
);
ok
(
prio
->
PriorityClass
!=
0xcc
,
"ProcessPriorityClass not set
\n
"
);
memset
(
&
basic
,
0xcc
,
sizeof
(
basic
)
);
status
=
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessBasicInformation
,
&
basic
,
sizeof
(
basic
),
NULL
);
ok
(
!
status
,
"ProcessBasicInformation failed %x
\n
"
,
status
);
ok
(
basic
.
ExitStatus
==
0
,
"ProcessBasicInformation info modified
\n
"
);
memset
(
&
image
,
0xcc
,
sizeof
(
image
)
);
status
=
NtQueryInformationProcess
(
pi
.
hProcess
,
ProcessImageInformation
,
&
image
,
sizeof
(
image
),
NULL
);
todo_wine
ok
(
status
==
STATUS_PROCESS_IS_TERMINATING
,
"ProcessImageInformation wrong error %x
\n
"
,
status
);
todo_wine
ok
(
image
.
Machine
==
0xcccc
,
"ProcessImageInformation info modified
\n
"
);
while
((
status
=
NtQuerySystemInformation
(
SystemProcessInformation
,
buffer
,
size
,
&
size
))
==
STATUS_INFO_LENGTH_MISMATCH
)
{
free
(
buffer
);
buffer
=
malloc
(
size
);
}
ok
(
status
==
STATUS_SUCCESS
,
"got %#x
\n
"
,
status
);
found
=
FALSE
;
do
{
spi
=
(
SYSTEM_PROCESS_INFORMATION
*
)(
buffer
+
offset
);
if
(
spi
->
UniqueProcessId
==
ULongToHandle
(
pi
.
dwProcessId
))
{
found
=
TRUE
;
break
;
}
offset
+=
spi
->
NextEntryOffset
;
}
while
(
spi
->
NextEntryOffset
);
todo_wine
ok
(
!
found
,
"process still enumerated
\n
"
);
CloseHandle
(
pi
.
hProcess
);
CloseHandle
(
pi
.
hThread
);
}
START_TEST
(
process
)
{
HANDLE
job
,
hproc
,
h
,
h2
;
...
...
@@ -4291,6 +4357,9 @@ START_TEST(process)
test_ProcThreadAttributeList
();
test_SuspendProcessState
();
test_SuspendProcessNewThread
();
test_parent_process_attribute
(
0
,
NULL
);
test_handle_list_attribute
(
FALSE
,
NULL
,
NULL
);
test_dead_process
();
/* things that can be tested:
* lookup: check the way program to be executed is searched
...
...
@@ -4314,6 +4383,4 @@ START_TEST(process)
test_jobInheritance
(
job
);
test_BreakawayOk
(
job
);
CloseHandle
(
job
);
test_parent_process_attribute
(
0
,
NULL
);
test_handle_list_attribute
(
FALSE
,
NULL
,
NULL
);
}
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