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
cbca9f84
Commit
cbca9f84
authored
Nov 27, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Use FileFsDeviceInformation for console handles in GetFileType.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2a132a18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
console.c
dlls/kernel32/tests/console.c
+6
-1
file.c
dlls/kernelbase/file.c
+1
-2
No files found.
dlls/kernel32/tests/console.c
View file @
cbca9f84
...
...
@@ -3777,7 +3777,7 @@ static void test_GetConsoleScreenBufferInfoEx(HANDLE std_output)
static
void
test_FreeConsole
(
void
)
{
HANDLE
handle
,
unbound_output
=
NULL
,
unbound_input
=
NULL
;
DWORD
size
,
mode
;
DWORD
size
,
mode
,
type
;
WCHAR
title
[
16
];
char
buf
[
32
];
HWND
hwnd
;
...
...
@@ -3889,6 +3889,11 @@ static void test_FreeConsole(void)
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"GetConsoleMode returned %x %u
\n
"
,
ret
,
GetLastError
());
type
=
GetFileType
(
unbound_input
);
ok
(
type
==
FILE_TYPE_CHAR
,
"GetFileType returned %u
\n
"
,
type
);
type
=
GetFileType
(
unbound_output
);
ok
(
type
==
FILE_TYPE_CHAR
,
"GetFileType returned %u
\n
"
,
type
);
CloseHandle
(
unbound_input
);
CloseHandle
(
unbound_output
);
}
...
...
dlls/kernelbase/file.c
View file @
cbca9f84
...
...
@@ -3099,8 +3099,6 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetFileType( HANDLE file )
file
==
(
HANDLE
)
STD_ERROR_HANDLE
)
file
=
GetStdHandle
(
(
DWORD_PTR
)
file
);
if
(
is_console_handle
(
file
))
return
FILE_TYPE_CHAR
;
if
(
!
set_ntstatus
(
NtQueryVolumeInformationFile
(
file
,
&
io
,
&
info
,
sizeof
(
info
),
FileFsDeviceInformation
)))
return
FILE_TYPE_UNKNOWN
;
...
...
@@ -3108,6 +3106,7 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetFileType( HANDLE file )
switch
(
info
.
DeviceType
)
{
case
FILE_DEVICE_NULL
:
case
FILE_DEVICE_CONSOLE
:
case
FILE_DEVICE_SERIAL_PORT
:
case
FILE_DEVICE_PARALLEL_PORT
:
case
FILE_DEVICE_TAPE
:
...
...
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