Commit 233074de authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

msvcrt: Don't reset invalid std handle in init.

parent 35bea756
......@@ -3341,8 +3341,8 @@ static void test_StdHandleInheritance(void)
{ARG_STD | ARG_HANDLE_PROTECT | H_DISK, HATTR_TYPE | HATTR_PROTECT | FILE_TYPE_DISK},
/* all others handles type behave as H_DISK */
{ARG_STARTUPINFO | ARG_CP_INHERIT | H_DISK, HATTR_DANGLING, .is_todo = 24, .is_broken = HATTR_TYPE | FILE_TYPE_UNKNOWN},
{ARG_STD | ARG_CP_INHERIT | H_DISK, HATTR_DANGLING, .is_todo = 16},
{ARG_STARTUPINFO | ARG_CP_INHERIT | H_DISK, HATTR_DANGLING, .is_broken = HATTR_TYPE | FILE_TYPE_UNKNOWN},
{ARG_STD | ARG_CP_INHERIT | H_DISK, HATTR_DANGLING},
/* all others handles type behave as H_DISK */
/*10*/ {ARG_STARTUPINFO | H_DEVIL, HATTR_NULL, .is_broken = HATTR_TYPE | FILE_TYPE_UNKNOWN},
......@@ -3369,8 +3369,8 @@ static void test_StdHandleInheritance(void)
{ARG_STD | ARG_HANDLE_INHERIT | H_DISK, HATTR_NULL},
/* all others handles type behave as H_DISK */
/*10*/ {ARG_STARTUPINFO | ARG_CP_INHERIT | H_DISK, HATTR_DANGLING, .is_todo = 24},
{ARG_STD | ARG_CP_INHERIT | H_DISK, HATTR_DANGLING, .is_todo = 16},
/*10*/ {ARG_STARTUPINFO | ARG_CP_INHERIT | H_DISK, HATTR_DANGLING},
{ARG_STD | ARG_CP_INHERIT | H_DISK, HATTR_DANGLING},
/* all others handles type behave as H_DISK */
{ARG_STARTUPINFO | H_DISK, HATTR_NULL, .is_broken = HATTR_TYPE | FILE_TYPE_UNKNOWN},
......
......@@ -560,12 +560,14 @@ static void msvcrt_set_fd(ioinfo *fdinfo, HANDLE hand, int flag)
ioinfo_set_unicode(fdinfo, FALSE);
ioinfo_set_textmode(fdinfo, TEXTMODE_ANSI);
if (hand == MSVCRT_NO_CONSOLE) hand = 0;
switch (fdinfo-MSVCRT___pioinfo[0])
if (hand != MSVCRT_NO_CONSOLE)
{
case 0: SetStdHandle(STD_INPUT_HANDLE, hand); break;
case 1: SetStdHandle(STD_OUTPUT_HANDLE, hand); break;
case 2: SetStdHandle(STD_ERROR_HANDLE, hand); break;
switch (fdinfo-MSVCRT___pioinfo[0])
{
case 0: SetStdHandle(STD_INPUT_HANDLE, hand); break;
case 1: SetStdHandle(STD_OUTPUT_HANDLE, hand); break;
case 2: SetStdHandle(STD_ERROR_HANDLE, hand); break;
}
}
}
......
......@@ -1897,7 +1897,6 @@ static void test_invalid_stdin_child( void )
ok(handle == (HANDLE)-2, "handle = %p\n", handle);
ok(errno == 0xdeadbeef, "errno = %d\n", errno);
handle = GetStdHandle(STD_INPUT_HANDLE);
todo_wine
ok((LONG_PTR)handle > 0, "Expecting passed handle to be untouched\n");
info = &__pioinfo[STDIN_FILENO/MSVCRT_FD_BLOCK_SIZE][STDIN_FILENO%MSVCRT_FD_BLOCK_SIZE];
......
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