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
0ad641af
Commit
0ad641af
authored
Jan 25, 2017
by
Vincent Povirk
Committed by
Alexandre Julliard
Jan 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: DETACHED_PROCESS doesn't affect STARTUPINFO console handles.
Signed-off-by:
Vincent Povirk
<
vincent@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b1b4de5d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletion
+42
-1
process.c
dlls/kernel32/process.c
+1
-1
process.c
dlls/kernel32/tests/process.c
+41
-0
No files found.
dlls/kernel32/process.c
View file @
0ad641af
...
...
@@ -1711,7 +1711,7 @@ static startup_info_t *create_startup_info( LPCWSTR filename, LPCWSTR cmdline,
info
->
hstdin
=
wine_server_obj_handle
(
hstdin
);
info
->
hstdout
=
wine_server_obj_handle
(
hstdout
);
info
->
hstderr
=
wine_server_obj_handle
(
hstderr
);
if
((
flags
&
(
CREATE_NEW_CONSOLE
|
DETACHED_PROCESS
)
)
!=
0
)
if
((
flags
&
CREATE_NEW_CONSOLE
)
!=
0
)
{
/* this is temporary (for console handles). We have no way to control that the handle is invalid in child process otherwise */
if
(
is_console_handle
(
hstdin
))
info
->
hstdin
=
wine_server_obj_handle
(
INVALID_HANDLE_VALUE
);
...
...
dlls/kernel32/tests/process.c
View file @
0ad641af
...
...
@@ -2895,6 +2895,46 @@ static void test_StartupNoConsole(void)
#endif
}
static
void
test_DetachConsoleHandles
(
void
)
{
#ifndef _WIN64
char
buffer
[
MAX_PATH
];
STARTUPINFOA
startup
;
PROCESS_INFORMATION
info
;
UINT
result
;
memset
(
&
startup
,
0
,
sizeof
(
startup
));
startup
.
cb
=
sizeof
(
startup
);
startup
.
dwFlags
=
STARTF_USESHOWWINDOW
|
STARTF_USESTDHANDLES
;
startup
.
wShowWindow
=
SW_SHOWNORMAL
;
startup
.
hStdInput
=
GetStdHandle
(
STD_INPUT_HANDLE
);
startup
.
hStdOutput
=
GetStdHandle
(
STD_OUTPUT_HANDLE
);
startup
.
hStdError
=
GetStdHandle
(
STD_ERROR_HANDLE
);
get_file_name
(
resfile
);
sprintf
(
buffer
,
"
\"
%s
\"
tests/process.c dump
\"
%s
\"
"
,
selfname
,
resfile
);
ok
(
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
TRUE
,
DETACHED_PROCESS
,
NULL
,
NULL
,
&
startup
,
&
info
),
"CreateProcess
\n
"
);
ok
(
WaitForSingleObject
(
info
.
hProcess
,
30000
)
==
WAIT_OBJECT_0
,
"Child process termination
\n
"
);
WritePrivateProfileStringA
(
NULL
,
NULL
,
NULL
,
resfile
);
result
=
GetPrivateProfileIntA
(
"StartupInfoA"
,
"hStdInput"
,
0
,
resfile
);
ok
(
result
!=
0
&&
result
!=
(
UINT
)
INVALID_HANDLE_VALUE
,
"bad handle %x
\n
"
,
result
);
result
=
GetPrivateProfileIntA
(
"StartupInfoA"
,
"hStdOutput"
,
0
,
resfile
);
ok
(
result
!=
0
&&
result
!=
(
UINT
)
INVALID_HANDLE_VALUE
,
"bad handle %x
\n
"
,
result
);
result
=
GetPrivateProfileIntA
(
"StartupInfoA"
,
"hStdError"
,
0
,
resfile
);
ok
(
result
!=
0
&&
result
!=
(
UINT
)
INVALID_HANDLE_VALUE
,
"bad handle %x
\n
"
,
result
);
result
=
GetPrivateProfileIntA
(
"TEB"
,
"hStdInput"
,
0
,
resfile
);
ok
(
result
!=
0
&&
result
!=
(
UINT
)
INVALID_HANDLE_VALUE
,
"bad handle %x
\n
"
,
result
);
result
=
GetPrivateProfileIntA
(
"TEB"
,
"hStdOutput"
,
0
,
resfile
);
ok
(
result
!=
0
&&
result
!=
(
UINT
)
INVALID_HANDLE_VALUE
,
"bad handle %x
\n
"
,
result
);
result
=
GetPrivateProfileIntA
(
"TEB"
,
"hStdError"
,
0
,
resfile
);
ok
(
result
!=
0
&&
result
!=
(
UINT
)
INVALID_HANDLE_VALUE
,
"bad handle %x
\n
"
,
result
);
release_memory
();
DeleteFileA
(
resfile
);
#endif
}
static
void
test_DetachStdHandles
(
void
)
{
#ifndef _WIN64
...
...
@@ -3380,6 +3420,7 @@ START_TEST(process)
test_RegistryQuota
();
test_DuplicateHandle
();
test_StartupNoConsole
();
test_DetachConsoleHandles
();
test_DetachStdHandles
();
test_GetNumaProcessorNode
();
test_session_info
();
...
...
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