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
000f7faa
Commit
000f7faa
authored
Nov 30, 2023
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add more tests about CreateProcess.
Signed-off-by:
Eric Pouech
<
epouech@codeweavers.com
>
parent
84079a62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
1 deletion
+43
-1
process.c
dlls/kernel32/tests/process.c
+43
-1
No files found.
dlls/kernel32/tests/process.c
View file @
000f7faa
...
...
@@ -3134,6 +3134,8 @@ static void copy_change_subsystem(const char* in, const char* out, DWORD subsyst
#define H_CONSOLE 0
#define H_DISK 1
#define H_CHAR 2
#define H_PIPE 3
#define ARG_STD 0x80000000
#define ARG_STARTUPINFO 0x00000000
...
...
@@ -3171,7 +3173,7 @@ static BOOL build_startupinfo( STARTUPINFOA *startup, unsigned args, HANDLE hstd
{
SECURITY_ATTRIBUTES
inherit_sa
=
{
sizeof
(
inherit_sa
),
NULL
,
TRUE
};
SECURITY_ATTRIBUTES
*
psa
;
BOOL
needs_close
=
FALSE
;
BOOL
ret
,
needs_close
=
FALSE
;
psa
=
(
args
&
ARG_HANDLE_INHERIT
)
?
&
inherit_sa
:
NULL
;
...
...
@@ -3194,6 +3196,18 @@ static BOOL build_startupinfo( STARTUPINFOA *startup, unsigned args, HANDLE hstd
ok
(
hstd
[
1
]
!=
INVALID_HANDLE_VALUE
,
"Couldn't create input to file %s
\n
"
,
std_handle_file
);
needs_close
=
TRUE
;
break
;
case
H_CHAR
:
hstd
[
0
]
=
CreateFileA
(
"NUL"
,
GENERIC_READ
,
0
,
psa
,
OPEN_EXISTING
,
0
,
0
);
ok
(
hstd
[
0
]
!=
INVALID_HANDLE_VALUE
,
"Couldn't create input to NUL
\n
"
);
hstd
[
1
]
=
CreateFileA
(
"NUL"
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
psa
,
OPEN_EXISTING
,
0
,
0
);
ok
(
hstd
[
1
]
!=
INVALID_HANDLE_VALUE
,
"Couldn't create input to NUL
\n
"
);
needs_close
=
TRUE
;
break
;
case
H_PIPE
:
ret
=
CreatePipe
(
&
hstd
[
0
],
&
hstd
[
1
],
psa
,
0
);
ok
(
ret
,
"Couldn't create anon pipe
\n
"
);
needs_close
=
TRUE
;
break
;
default:
ok
(
0
,
"Unsupported handle type %x
\n
"
,
args
&
ARG_HANDLE_MASK
);
return
FALSE
;
...
...
@@ -3233,6 +3247,32 @@ static void test_StdHandleInheritance(void)
int
i
,
j
;
static
const
struct
std_handle_test
nothing_cui
[]
=
{
/* all others handles type behave as H_DISK */
/* 0*/
{
ARG_STARTUPINFO
|
ARG_CP_INHERIT
|
ARG_HANDLE_INHERIT
|
H_DISK
,
HATTR_TYPE
|
HATTR_INHERIT
|
FILE_TYPE_DISK
},
{
ARG_STD
|
ARG_CP_INHERIT
|
ARG_HANDLE_INHERIT
|
H_DISK
,
HATTR_TYPE
|
HATTR_INHERIT
|
FILE_TYPE_DISK
,
.
is_todo
=
6
},
/* all others handles type behave as H_DISK */
{
ARG_STARTUPINFO
|
ARG_HANDLE_INHERIT
|
H_DISK
,
HATTR_NULL
,
.
is_todo
=
7
,
.
is_broken
=
HATTR_TYPE
|
FILE_TYPE_UNKNOWN
},
{
ARG_STD
|
ARG_HANDLE_INHERIT
|
H_DISK
,
HATTR_TYPE
|
HATTR_INHERIT
|
FILE_TYPE_DISK
,
.
is_todo
=
6
},
},
nothing_gui
[]
=
{
/* testing all types because of discrepancies */
/* 0*/
{
ARG_STARTUPINFO
|
ARG_CP_INHERIT
|
ARG_HANDLE_INHERIT
|
H_DISK
,
HATTR_TYPE
|
HATTR_INHERIT
|
FILE_TYPE_DISK
},
{
ARG_STD
|
ARG_CP_INHERIT
|
ARG_HANDLE_INHERIT
|
H_DISK
,
HATTR_TYPE
|
HATTR_INHERIT
|
FILE_TYPE_DISK
,
.
is_todo
=
6
},
{
ARG_STARTUPINFO
|
ARG_CP_INHERIT
|
ARG_HANDLE_INHERIT
|
H_PIPE
,
HATTR_TYPE
|
HATTR_INHERIT
|
FILE_TYPE_PIPE
},
{
ARG_STD
|
ARG_CP_INHERIT
|
ARG_HANDLE_INHERIT
|
H_PIPE
,
HATTR_TYPE
|
HATTR_INHERIT
|
FILE_TYPE_PIPE
,
.
is_todo
=
6
},
{
ARG_STARTUPINFO
|
ARG_CP_INHERIT
|
ARG_HANDLE_INHERIT
|
H_CHAR
,
HATTR_TYPE
|
HATTR_INHERIT
|
FILE_TYPE_CHAR
},
/* 5*/
{
ARG_STD
|
ARG_CP_INHERIT
|
ARG_HANDLE_INHERIT
|
H_CHAR
,
HATTR_TYPE
|
HATTR_INHERIT
|
FILE_TYPE_CHAR
,
.
is_todo
=
6
},
{
ARG_STARTUPINFO
|
ARG_CP_INHERIT
|
ARG_HANDLE_INHERIT
|
H_CONSOLE
,
HATTR_NULL
,
.
is_todo
=
7
,
.
is_broken
=
HATTR_TYPE
|
FILE_TYPE_UNKNOWN
},
{
ARG_STD
|
ARG_CP_INHERIT
|
ARG_HANDLE_INHERIT
|
H_CONSOLE
,
HATTR_NULL
,
.
is_todo
=
7
,
.
is_broken
=
HATTR_TYPE
|
FILE_TYPE_UNKNOWN
},
/* all others handles type behave as H_DISK */
{
ARG_STARTUPINFO
|
ARG_HANDLE_INHERIT
|
H_DISK
,
HATTR_NULL
,
.
is_todo
=
7
,
.
is_broken
=
HATTR_TYPE
|
FILE_TYPE_UNKNOWN
},
{
ARG_STD
|
ARG_HANDLE_INHERIT
|
H_DISK
,
HATTR_NULL
,
.
is_todo
=
7
},
},
detached_cui
[]
=
{
{
ARG_STD
|
ARG_CP_INHERIT
|
ARG_HANDLE_INHERIT
|
H_CONSOLE
,
HATTR_NULL
,
.
is_todo
=
4
},
...
...
@@ -3260,6 +3300,8 @@ static void test_StdHandleInheritance(void)
tests
[]
=
{
#define X(d, cg, s) {(d), (cg), s, ARRAY_SIZE(s), #s}
X
(
0
,
TRUE
,
nothing_cui
),
X
(
0
,
FALSE
,
nothing_gui
),
X
(
DETACHED_PROCESS
,
TRUE
,
detached_cui
),
X
(
DETACHED_PROCESS
,
FALSE
,
detached_gui
),
#undef X
...
...
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