Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ef57a8df
Commit
ef57a8df
authored
Sep 21, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Move force override logic to init_console_std_handles callers.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c47f64bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
console.c
dlls/kernelbase/console.c
+11
-7
No files found.
dlls/kernelbase/console.c
View file @
ef57a8df
...
...
@@ -224,20 +224,18 @@ static BOOL create_console_connection( HANDLE root )
return
set_ntstatus
(
status
);
}
static
BOOL
init_console_std_handles
(
void
)
static
BOOL
init_console_std_handles
(
BOOL
override_all
)
{
HANDLE
std_out
=
NULL
,
std_err
=
NULL
,
handle
;
OBJECT_ATTRIBUTES
attr
=
{
sizeof
(
attr
)};
IO_STATUS_BLOCK
iosb
;
UNICODE_STRING
name
;
STARTUPINFOW
si
;
NTSTATUS
status
;
GetStartupInfoW
(
&
si
);
attr
.
ObjectName
=
&
name
;
attr
.
Attributes
=
OBJ_INHERIT
;
if
(
!
(
si
.
dwFlags
&
STARTF_USESTDHANDLES
)
||
!
GetStdHandle
(
STD_INPUT_HANDLE
))
if
(
override_all
||
!
GetStdHandle
(
STD_INPUT_HANDLE
))
{
/* FIXME: Use unbound console handle */
RtlInitUnicodeString
(
&
name
,
L"
\\
Device
\\
ConDrv
\\
CurrentIn"
);
...
...
@@ -250,7 +248,7 @@ static BOOL init_console_std_handles(void)
SetStdHandle
(
STD_INPUT_HANDLE
,
console_handle_map
(
handle
));
}
if
(
si
.
dwFlags
&
STARTF_USESTDHANDLES
)
if
(
!
override_all
)
{
std_out
=
GetStdHandle
(
STD_OUTPUT_HANDLE
);
std_err
=
GetStdHandle
(
STD_ERROR_HANDLE
);
...
...
@@ -306,7 +304,13 @@ BOOL WINAPI DECLSPEC_HOTPATCH AttachConsole( DWORD pid )
if
(
ret
)
{
RtlGetCurrentPeb
()
->
ProcessParameters
->
ConsoleHandle
=
create_console_reference
(
console_connection
);
ret
=
RtlGetCurrentPeb
()
->
ProcessParameters
->
ConsoleHandle
&&
init_console_std_handles
();
if
(
RtlGetCurrentPeb
()
->
ProcessParameters
->
ConsoleHandle
)
{
STARTUPINFOW
si
;
GetStartupInfoW
(
&
si
);
init_console_std_handles
(
!
(
si
.
dwFlags
&
STARTF_USESTDHANDLES
)
);
}
else
ret
=
FALSE
;
}
if
(
!
ret
)
FreeConsole
();
...
...
@@ -379,7 +383,7 @@ BOOL WINAPI AllocConsole(void)
CloseHandle
(
pi
.
hProcess
);
}
CloseHandle
(
event
);
if
(
!
ret
||
!
init_console_std_handles
())
goto
error
;
if
(
!
ret
||
!
init_console_std_handles
(
!
(
app_si
.
dwFlags
&
STARTF_USESTDHANDLES
)
))
goto
error
;
console
=
CreateFileW
(
L"CONIN$"
,
GENERIC_READ
|
GENERIC_WRITE
|
SYNCHRONIZE
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
if
(
console
==
INVALID_HANDLE_VALUE
)
goto
error
;
RtlGetCurrentPeb
()
->
ProcessParameters
->
ConsoleHandle
=
console
;
...
...
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