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
22afbb8f
Commit
22afbb8f
authored
Nov 17, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Support writing directly on console handle.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4cc4ea44
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
12 deletions
+46
-12
console.c
server/console.c
+46
-12
No files found.
server/console.c
View file @
22afbb8f
...
...
@@ -236,6 +236,7 @@ static const struct object_ops screen_buffer_ops =
screen_buffer_destroy
/* destroy */
};
static
int
screen_buffer_write
(
struct
fd
*
fd
,
struct
async
*
async
,
file_pos_t
pos
);
static
int
screen_buffer_ioctl
(
struct
fd
*
fd
,
ioctl_code_t
code
,
struct
async
*
async
);
static
const
struct
fd_ops
screen_buffer_fd_ops
=
...
...
@@ -244,7 +245,7 @@ static const struct fd_ops screen_buffer_fd_ops =
default_poll_event
,
/* poll_event */
console_get_fd_type
,
/* get_fd_type */
no_fd_read
,
/* read */
no_fd_write
,
/* write */
screen_buffer_write
,
/* write */
no_fd_flush
,
/* flush */
no_fd_get_file_info
,
/* get_file_info */
no_fd_get_volume_info
,
/* get_volume_info */
...
...
@@ -916,6 +917,31 @@ static int console_input_flush( struct fd *fd, struct async *async )
return
queue_host_ioctl
(
console
->
server
,
IOCTL_CONDRV_FLUSH
,
0
,
NULL
,
NULL
);
}
static
int
screen_buffer_write
(
struct
fd
*
fd
,
struct
async
*
async
,
file_pos_t
pos
)
{
struct
screen_buffer
*
screen_buffer
=
get_fd_user
(
fd
);
struct
iosb
*
iosb
;
if
(
!
screen_buffer
->
input
||
!
screen_buffer
->
input
->
server
)
{
set_error
(
STATUS_INVALID_HANDLE
);
return
0
;
}
if
(
!
queue_host_ioctl
(
screen_buffer
->
input
->
server
,
IOCTL_CONDRV_WRITE_FILE
,
screen_buffer
->
id
,
async
,
&
screen_buffer
->
ioctl_q
))
return
0
;
/* we can't use default async handling, because write result is not
* compatible with ioctl result */
iosb
=
async_get_iosb
(
async
);
iosb
->
status
=
STATUS_SUCCESS
;
iosb
->
result
=
iosb
->
in_size
;
async_terminate
(
async
,
iosb
->
result
?
STATUS_ALERTED
:
STATUS_SUCCESS
);
release_object
(
iosb
);
return
1
;
}
static
int
screen_buffer_ioctl
(
struct
fd
*
fd
,
ioctl_code_t
code
,
struct
async
*
async
)
{
struct
screen_buffer
*
screen_buffer
=
get_fd_user
(
fd
);
...
...
@@ -1336,21 +1362,29 @@ DECL_HANDLER(get_next_console_request)
if
(
ioctl
->
async
)
{
iosb
=
async_get_iosb
(
ioctl
->
async
);
iosb
->
status
=
status
;
iosb
->
out_size
=
min
(
iosb
->
out_size
,
get_req_data_size
()
);
if
(
iosb
->
out_size
)
if
(
iosb
->
status
==
STATUS_PENDING
)
{
if
((
iosb
->
out_data
=
memdup
(
get_req_data
(),
iosb
->
out_size
)))
iosb
->
status
=
status
;
iosb
->
out_size
=
min
(
iosb
->
out_size
,
get_req_data_size
()
);
if
(
iosb
->
out_size
)
{
iosb
->
result
=
iosb
->
out_size
;
status
=
STATUS_ALERTED
;
}
else
if
(
!
status
)
{
iosb
->
status
=
STATUS_NO_MEMORY
;
iosb
->
out_size
=
0
;
if
((
iosb
->
out_data
=
memdup
(
get_req_data
(),
iosb
->
out_size
)))
{
iosb
->
result
=
iosb
->
out_size
;
status
=
STATUS_ALERTED
;
}
else
if
(
!
status
)
{
iosb
->
status
=
STATUS_NO_MEMORY
;
iosb
->
out_size
=
0
;
}
}
}
else
{
release_object
(
ioctl
->
async
);
ioctl
->
async
=
NULL
;
}
}
console_host_ioctl_terminate
(
ioctl
,
status
);
if
(
iosb
)
release_object
(
iosb
);
...
...
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