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
8ca9b44f
Commit
8ca9b44f
authored
Nov 20, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Support FileFsDeviceInformation queries on console handles.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a055f412
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
2 deletions
+45
-2
console.c
dlls/kernel32/tests/console.c
+20
-0
console.c
server/console.c
+25
-2
No files found.
dlls/kernel32/tests/console.c
View file @
8ca9b44f
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#define WIN32_NO_STATUS
#define WIN32_NO_STATUS
#include <windows.h>
#include <windows.h>
#include <winternl.h>
#include <winternl.h>
#include <winioctl.h>
#include <stdio.h>
#include <stdio.h>
#include "wine/test.h"
#include "wine/test.h"
...
@@ -3945,8 +3946,10 @@ static void test_console_title(void)
...
@@ -3945,8 +3946,10 @@ static void test_console_title(void)
static
void
test_file_info
(
HANDLE
input
,
HANDLE
output
)
static
void
test_file_info
(
HANDLE
input
,
HANDLE
output
)
{
{
FILE_STANDARD_INFORMATION
std_info
;
FILE_STANDARD_INFORMATION
std_info
;
FILE_FS_DEVICE_INFORMATION
fs_info
;
LARGE_INTEGER
size
;
LARGE_INTEGER
size
;
IO_STATUS_BLOCK
io
;
IO_STATUS_BLOCK
io
;
DWORD
type
;
NTSTATUS
status
;
NTSTATUS
status
;
BOOL
ret
;
BOOL
ret
;
...
@@ -3965,6 +3968,23 @@ static void test_file_info(HANDLE input, HANDLE output)
...
@@ -3965,6 +3968,23 @@ static void test_file_info(HANDLE input, HANDLE output)
ret
=
GetFileSizeEx
(
output
,
&
size
);
ret
=
GetFileSizeEx
(
output
,
&
size
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_FUNCTION
,
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_FUNCTION
,
"GetFileSizeEx returned %x(%u)
\n
"
,
ret
,
GetLastError
());
"GetFileSizeEx returned %x(%u)
\n
"
,
ret
,
GetLastError
());
status
=
NtQueryVolumeInformationFile
(
input
,
&
io
,
&
fs_info
,
sizeof
(
fs_info
),
FileFsDeviceInformation
);
ok
(
!
status
,
"NtQueryVolumeInformationFile failed: %#x
\n
"
,
status
);
ok
(
fs_info
.
DeviceType
==
FILE_DEVICE_CONSOLE
,
"DeviceType = %u
\n
"
,
fs_info
.
DeviceType
);
ok
(
fs_info
.
Characteristics
==
FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL
,
"Characteristics = %x
\n
"
,
fs_info
.
Characteristics
);
status
=
NtQueryVolumeInformationFile
(
output
,
&
io
,
&
fs_info
,
sizeof
(
fs_info
),
FileFsDeviceInformation
);
ok
(
!
status
,
"NtQueryVolumeInformationFile failed: %#x
\n
"
,
status
);
ok
(
fs_info
.
DeviceType
==
FILE_DEVICE_CONSOLE
,
"DeviceType = %u
\n
"
,
fs_info
.
DeviceType
);
ok
(
fs_info
.
Characteristics
==
FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL
,
"Characteristics = %x
\n
"
,
fs_info
.
Characteristics
);
type
=
GetFileType
(
input
);
ok
(
type
==
FILE_TYPE_CHAR
,
"GetFileType returned %u
\n
"
,
type
);
type
=
GetFileType
(
output
);
ok
(
type
==
FILE_TYPE_CHAR
,
"GetFileType returned %u
\n
"
,
type
);
}
}
static
void
test_AttachConsole_child
(
DWORD
console_pid
)
static
void
test_AttachConsole_child
(
DWORD
console_pid
)
...
...
server/console.c
View file @
8ca9b44f
...
@@ -99,6 +99,7 @@ static const struct object_ops console_input_ops =
...
@@ -99,6 +99,7 @@ static const struct object_ops console_input_ops =
static
enum
server_fd_type
console_get_fd_type
(
struct
fd
*
fd
);
static
enum
server_fd_type
console_get_fd_type
(
struct
fd
*
fd
);
static
void
console_get_file_info
(
struct
fd
*
fd
,
obj_handle_t
handle
,
unsigned
int
info_class
);
static
void
console_get_file_info
(
struct
fd
*
fd
,
obj_handle_t
handle
,
unsigned
int
info_class
);
static
void
console_get_volume_info
(
struct
fd
*
fd
,
unsigned
int
info_class
);
static
int
console_input_read
(
struct
fd
*
fd
,
struct
async
*
async
,
file_pos_t
pos
);
static
int
console_input_read
(
struct
fd
*
fd
,
struct
async
*
async
,
file_pos_t
pos
);
static
int
console_input_flush
(
struct
fd
*
fd
,
struct
async
*
async
);
static
int
console_input_flush
(
struct
fd
*
fd
,
struct
async
*
async
);
static
int
console_input_ioctl
(
struct
fd
*
fd
,
ioctl_code_t
code
,
struct
async
*
async
);
static
int
console_input_ioctl
(
struct
fd
*
fd
,
ioctl_code_t
code
,
struct
async
*
async
);
...
@@ -112,7 +113,7 @@ static const struct fd_ops console_input_fd_ops =
...
@@ -112,7 +113,7 @@ static const struct fd_ops console_input_fd_ops =
no_fd_write
,
/* write */
no_fd_write
,
/* write */
console_input_flush
,
/* flush */
console_input_flush
,
/* flush */
console_get_file_info
,
/* get_file_info */
console_get_file_info
,
/* get_file_info */
no_fd_get_volume_info
,
/* get_volume_info */
console_get_volume_info
,
/* get_volume_info */
console_input_ioctl
,
/* ioctl */
console_input_ioctl
,
/* ioctl */
default_fd_queue_async
,
/* queue_async */
default_fd_queue_async
,
/* queue_async */
default_fd_reselect_async
/* reselect_async */
default_fd_reselect_async
/* reselect_async */
...
@@ -250,7 +251,7 @@ static const struct fd_ops screen_buffer_fd_ops =
...
@@ -250,7 +251,7 @@ static const struct fd_ops screen_buffer_fd_ops =
screen_buffer_write
,
/* write */
screen_buffer_write
,
/* write */
no_fd_flush
,
/* flush */
no_fd_flush
,
/* flush */
console_get_file_info
,
/* get_file_info */
console_get_file_info
,
/* get_file_info */
no_fd_get_volume_info
,
/* get_volume_info */
console_get_volume_info
,
/* get_volume_info */
screen_buffer_ioctl
,
/* ioctl */
screen_buffer_ioctl
,
/* ioctl */
default_fd_queue_async
,
/* queue_async */
default_fd_queue_async
,
/* queue_async */
default_fd_reselect_async
/* reselect_async */
default_fd_reselect_async
/* reselect_async */
...
@@ -426,6 +427,28 @@ static void console_get_file_info( struct fd *fd, obj_handle_t handle, unsigned
...
@@ -426,6 +427,28 @@ static void console_get_file_info( struct fd *fd, obj_handle_t handle, unsigned
set_error
(
STATUS_INVALID_DEVICE_REQUEST
);
set_error
(
STATUS_INVALID_DEVICE_REQUEST
);
}
}
static
void
console_get_volume_info
(
struct
fd
*
fd
,
unsigned
int
info_class
)
{
switch
(
info_class
)
{
case
FileFsDeviceInformation
:
{
static
const
FILE_FS_DEVICE_INFORMATION
device_info
=
{
FILE_DEVICE_CONSOLE
,
FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL
};
if
(
get_reply_max_size
()
>=
sizeof
(
device_info
))
set_reply_data
(
&
device_info
,
sizeof
(
device_info
)
);
else
set_error
(
STATUS_BUFFER_TOO_SMALL
);
break
;
}
default:
set_error
(
STATUS_NOT_IMPLEMENTED
);
}
}
static
struct
object
*
create_console_input
(
void
)
static
struct
object
*
create_console_input
(
void
)
{
{
struct
console_input
*
console_input
;
struct
console_input
*
console_input
;
...
...
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