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
e613d81d
Commit
e613d81d
authored
Jul 21, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Use NtCreateFile in CreateConsoleScreenBuffer.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2e5b8ffc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
console.c
dlls/kernel32/tests/console.c
+6
-0
console.c
dlls/kernelbase/console.c
+12
-13
No files found.
dlls/kernel32/tests/console.c
View file @
e613d81d
...
...
@@ -3290,6 +3290,12 @@ static void test_FreeConsole(void)
(
GetLastError
()
==
ERROR_INVALID_HANDLE
||
broken
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
/* winxp */
)),
"CreateFileA failed: %u
\n
"
,
GetLastError
());
handle
=
CreateConsoleScreenBuffer
(
GENERIC_READ
|
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
CONSOLE_TEXTMODE_BUFFER
,
NULL
);
ok
(
handle
==
INVALID_HANDLE_VALUE
&&
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"CreateConsoleScreenBuffer returned: %p (%u)
\n
"
,
handle
,
GetLastError
());
if
(
!
skip_nt
)
{
SetStdHandle
(
STD_INPUT_HANDLE
,
(
HANDLE
)
0xdeadbeef
);
...
...
dlls/kernelbase/console.c
View file @
e613d81d
...
...
@@ -326,7 +326,11 @@ HANDLE WINAPI DECLSPEC_HOTPATCH CreateConsoleScreenBuffer( DWORD access, DWORD s
SECURITY_ATTRIBUTES
*
sa
,
DWORD
flags
,
void
*
data
)
{
HANDLE
ret
=
INVALID_HANDLE_VALUE
;
OBJECT_ATTRIBUTES
attr
=
{
sizeof
(
attr
)};
IO_STATUS_BLOCK
iosb
;
UNICODE_STRING
name
;
HANDLE
handle
;
NTSTATUS
status
;
TRACE
(
"(%x,%x,%p,%x,%p)
\n
"
,
access
,
share
,
sa
,
flags
,
data
);
...
...
@@ -336,18 +340,13 @@ HANDLE WINAPI DECLSPEC_HOTPATCH CreateConsoleScreenBuffer( DWORD access, DWORD s
return
INVALID_HANDLE_VALUE
;
}
SERVER_START_REQ
(
create_console_output
)
{
req
->
handle_in
=
0
;
req
->
access
=
access
;
req
->
attributes
=
(
sa
&&
sa
->
bInheritHandle
)
?
OBJ_INHERIT
:
0
;
req
->
share
=
share
;
req
->
fd
=
-
1
;
if
(
!
wine_server_call_err
(
req
))
ret
=
console_handle_map
(
wine_server_ptr_handle
(
reply
->
handle_out
));
}
SERVER_END_REQ
;
return
ret
;
RtlInitUnicodeString
(
&
name
,
L"
\\
Device
\\
ConDrv
\\
ScreenBuffer"
);
attr
.
ObjectName
=
&
name
;
attr
.
SecurityDescriptor
=
sa
?
sa
->
lpSecurityDescriptor
:
NULL
;
if
(
sa
&&
sa
->
bInheritHandle
)
attr
.
Attributes
|=
OBJ_INHERIT
;
status
=
NtCreateFile
(
&
handle
,
access
,
&
attr
,
&
iosb
,
NULL
,
FILE_ATTRIBUTE_NORMAL
,
0
,
FILE_OPEN
,
FILE_NON_DIRECTORY_FILE
,
NULL
,
0
);
return
set_ntstatus
(
status
)
?
handle
:
INVALID_HANDLE_VALUE
;
}
...
...
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