Commit 626b2f18 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

server: Preserve handle flags when inheriting a std handle.

parent 1c7e1f1f
......@@ -3319,11 +3319,11 @@ static void test_StdHandleInheritance(void)
/* all others handles type behave as H_DISK */
{ARG_STARTUPINFO | H_DISK, HATTR_NULL, .is_broken = HATTR_TYPE | FILE_TYPE_UNKNOWN},
/* 5*/ {ARG_STD | H_DISK, HATTR_TYPE | FILE_TYPE_DISK, .is_todo = 1},
/* 5*/ {ARG_STD | H_DISK, HATTR_TYPE | FILE_TYPE_DISK},
/* all others handles type behave as H_DISK */
{ARG_STARTUPINFO | ARG_HANDLE_PROTECT | H_DISK, HATTR_NULL, .is_broken = HATTR_TYPE | FILE_TYPE_UNKNOWN},
{ARG_STD | ARG_HANDLE_PROTECT | H_DISK, HATTR_TYPE | HATTR_PROTECT | FILE_TYPE_DISK, .is_todo = 1},
{ARG_STD | ARG_HANDLE_PROTECT | H_DISK, HATTR_TYPE | HATTR_PROTECT | FILE_TYPE_DISK},
},
nothing_gui[] =
{
......
......@@ -1336,11 +1336,11 @@ DECL_HANDLER(new_process)
if (!(req->flags & PROCESS_CREATE_FLAGS_INHERIT_HANDLES) && info->data->console != 1)
{
info->data->hstdin = duplicate_handle( parent, info->data->hstdin, process,
0, OBJ_INHERIT, DUPLICATE_SAME_ACCESS );
0, 0, DUPLICATE_SAME_ACCESS | DUPLICATE_SAME_ATTRIBUTES );
info->data->hstdout = duplicate_handle( parent, info->data->hstdout, process,
0, OBJ_INHERIT, DUPLICATE_SAME_ACCESS );
0, 0, DUPLICATE_SAME_ACCESS | DUPLICATE_SAME_ATTRIBUTES );
info->data->hstderr = duplicate_handle( parent, info->data->hstderr, process,
0, OBJ_INHERIT, DUPLICATE_SAME_ACCESS );
0, 0, DUPLICATE_SAME_ACCESS | DUPLICATE_SAME_ATTRIBUTES );
/* some handles above may have been invalid; this is not an error */
if (get_error() == STATUS_INVALID_HANDLE ||
get_error() == STATUS_OBJECT_TYPE_MISMATCH) clear_error();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment