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
06c3e7e4
Commit
06c3e7e4
authored
Aug 13, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Close PEB ConsoleHandle in AttachConsole.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
57a22235
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
console.c
dlls/kernel32/tests/console.c
+0
-1
console.c
dlls/kernelbase/console.c
+10
-1
No files found.
dlls/kernel32/tests/console.c
View file @
06c3e7e4
...
...
@@ -3737,7 +3737,6 @@ static void test_AttachConsole_child(DWORD console_pid)
ok
(
res
,
"AttachConsole failed: %u
\n
"
,
GetLastError
());
ok
(
pipe_out
!=
GetStdHandle
(
STD_ERROR_HANDLE
),
"std handle not set to console
\n
"
);
todo_wine
ok
(
RtlGetCurrentPeb
()
->
ProcessParameters
->
ConsoleHandle
!=
NULL
,
"ConsoleHandle is NULL
\n
"
);
console
=
CreateFileA
(
"CONOUT$"
,
GENERIC_READ
|
GENERIC_WRITE
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
...
...
dlls/kernelbase/console.c
View file @
06c3e7e4
...
...
@@ -250,7 +250,16 @@ BOOL WINAPI DECLSPEC_HOTPATCH AttachConsole( DWORD pid )
}
SERVER_END_REQ
;
if
(
ret
&&
!
(
ret
=
init_console_std_handles
()))
FreeConsole
();
if
(
ret
)
{
if
((
ret
=
init_console_std_handles
()))
{
HANDLE
console
=
CreateFileW
(
L"CONIN$"
,
GENERIC_READ
|
GENERIC_WRITE
|
SYNCHRONIZE
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
0
);
if
(
console
!=
INVALID_HANDLE_VALUE
)
RtlGetCurrentPeb
()
->
ProcessParameters
->
ConsoleHandle
=
console
;
else
ret
=
FALSE
;
}
if
(
!
ret
)
FreeConsole
();
}
RtlLeaveCriticalSection
(
&
console_section
);
return
ret
;
...
...
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