Commit cbca9f84 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

kernelbase: Use FileFsDeviceInformation for console handles in GetFileType.

parent 2a132a18
......@@ -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);
}
......
......@@ -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:
......
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