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
76018fbb
Commit
76018fbb
authored
Nov 17, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Dec 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for GetStartupInfo(A|W).
Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
5545aef7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
0 deletions
+91
-0
process.c
dlls/kernel32/tests/process.c
+91
-0
No files found.
dlls/kernel32/tests/process.c
View file @
76018fbb
...
...
@@ -5197,6 +5197,96 @@ static void test_services_exe(void)
ok
(
services_session_id
==
0
,
"got services.exe SessionId %lu
\n
"
,
services_session_id
);
}
static
void
test_startupinfo
(
void
)
{
STARTUPINFOA
startup_beforeA
,
startup_afterA
;
STARTUPINFOW
startup_beforeW
,
startup_afterW
;
RTL_USER_PROCESS_PARAMETERS
*
params
;
params
=
RtlGetCurrentPeb
()
->
ProcessParameters
;
startup_beforeA
.
hStdInput
=
(
HANDLE
)
0x56780000
;
GetStartupInfoA
(
&
startup_beforeA
);
startup_beforeW
.
hStdInput
=
(
HANDLE
)
0x12340000
;
GetStartupInfoW
(
&
startup_beforeW
);
/* change a couple of fields in PEB */
params
->
dwX
=
~
params
->
dwX
;
params
->
hStdInput
=
(
HANDLE
)
~
(
DWORD_PTR
)
params
->
hStdInput
;
startup_afterA
.
hStdInput
=
(
HANDLE
)
0x87650000
;
GetStartupInfoA
(
&
startup_afterA
);
/* wharf... ansi version is cached... */
ok
(
startup_beforeA
.
dwX
==
startup_afterA
.
dwX
,
"Unexpected field value
\n
"
);
ok
(
startup_beforeA
.
dwFlags
==
startup_afterA
.
dwFlags
,
"Unexpected field value
\n
"
);
ok
(
startup_beforeA
.
hStdInput
==
startup_afterA
.
hStdInput
,
"Unexpected field value
\n
"
);
if
(
startup_beforeW
.
dwFlags
&
STARTF_USESTDHANDLES
)
{
ok
(
startup_beforeA
.
hStdInput
!=
NULL
&&
startup_beforeA
.
hStdInput
!=
INVALID_HANDLE_VALUE
,
"Unexpected field value
\n
"
);
ok
(
startup_afterA
.
hStdInput
!=
NULL
&&
startup_afterA
.
hStdInput
!=
INVALID_HANDLE_VALUE
,
"Unexpected field value
\n
"
);
}
else
{
ok
(
startup_beforeA
.
hStdInput
==
INVALID_HANDLE_VALUE
,
"Unexpected field value %p
\n
"
,
startup_beforeA
.
hStdInput
);
ok
(
startup_afterA
.
hStdInput
==
INVALID_HANDLE_VALUE
,
"Unexpected field value %p
\n
"
,
startup_afterA
.
hStdInput
);
}
/* ... while unicode is not */
startup_afterW
.
hStdInput
=
(
HANDLE
)
0x43210000
;
GetStartupInfoW
(
&
startup_afterW
);
todo_wine
ok
(
~
startup_beforeW
.
dwX
==
startup_afterW
.
dwX
,
"Unexpected field value
\n
"
);
if
(
startup_beforeW
.
dwFlags
&
STARTF_USESTDHANDLES
)
{
todo_wine
ok
(
params
->
hStdInput
==
startup_afterW
.
hStdInput
,
"Unexpected field value
\n
"
);
todo_wine
ok
((
HANDLE
)
~
(
DWORD_PTR
)
startup_beforeW
.
hStdInput
==
startup_afterW
.
hStdInput
,
"Unexpected field value
\n
"
);
}
else
{
todo_wine
ok
(
startup_beforeW
.
hStdInput
==
(
HANDLE
)
0x12340000
,
"Unexpected field value
\n
"
);
todo_wine
ok
(
startup_afterW
.
hStdInput
==
(
HANDLE
)
0x43210000
,
"Unexpected field value
\n
"
);
}
/* check impact of STARTF_USESTDHANDLES bit */
params
->
dwFlags
^=
STARTF_USESTDHANDLES
;
startup_afterW
.
hStdInput
=
(
HANDLE
)
0x43210000
;
GetStartupInfoW
(
&
startup_afterW
);
todo_wine
ok
((
startup_beforeW
.
dwFlags
^
STARTF_USESTDHANDLES
)
==
startup_afterW
.
dwFlags
,
"Unexpected field value
\n
"
);
if
(
startup_afterW
.
dwFlags
&
STARTF_USESTDHANDLES
)
{
todo_wine
ok
(
params
->
hStdInput
==
startup_afterW
.
hStdInput
,
"Unexpected field value
\n
"
);
ok
(
startup_afterW
.
hStdInput
!=
(
HANDLE
)
0x43210000
,
"Unexpected field value
\n
"
);
}
else
{
todo_wine
ok
(
startup_afterW
.
hStdInput
==
(
HANDLE
)
0x43210000
,
"Unexpected field value
\n
"
);
}
/* FIXME add more tests to check whether the dwFlags controls the returned
* values (as done for STARTF_USESTDHANDLES) in unicode case.
*/
/* reset the modified fields in PEB */
params
->
dwX
=
~
params
->
dwX
;
params
->
hStdInput
=
(
HANDLE
)
~
(
DWORD_PTR
)
params
->
hStdInput
;
params
->
dwFlags
^=
STARTF_USESTDHANDLES
;
}
START_TEST
(
process
)
{
HANDLE
job
,
hproc
,
h
,
h2
;
...
...
@@ -5325,6 +5415,7 @@ START_TEST(process)
test_handle_list_attribute
(
FALSE
,
NULL
,
NULL
);
test_dead_process
();
test_services_exe
();
test_startupinfo
();
/* things that can be tested:
* lookup: check the way program to be executed is searched
...
...
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