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
daaee9e5
Commit
daaee9e5
authored
Aug 30, 2010
by
Eric Pouech
Committed by
Alexandre Julliard
Sep 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Properly return the errors for bare console objects.
parent
2f7af56d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
11 deletions
+48
-11
console.c
server/console.c
+48
-11
No files found.
server/console.c
View file @
daaee9e5
...
...
@@ -731,6 +731,13 @@ static int set_console_input_info( const struct set_console_input_info_request *
struct
console_renderer_event
evt
;
if
(
!
(
console
=
console_input_get
(
req
->
handle
,
FILE_WRITE_PROPERTIES
)))
goto
error
;
if
(
console_input_is_bare
(
console
)
&&
(
req
->
mask
&
(
SET_CONSOLE_INPUT_INFO_ACTIVE_SB
|
SET_CONSOLE_INPUT_INFO_WIN
)))
{
set_error
(
STATUS_UNSUCCESSFUL
);
goto
error
;
}
memset
(
&
evt
.
u
,
0
,
sizeof
(
evt
.
u
));
if
(
req
->
mask
&
SET_CONSOLE_INPUT_INFO_ACTIVE_SB
)
...
...
@@ -1339,17 +1346,13 @@ static void read_console_output( struct screen_buffer *screen_buffer, int x, int
}
/* scroll parts of a screen buffer */
static
void
scroll_console_output
(
obj_handle_t
handle
,
int
xsrc
,
int
ysrc
,
int
xdst
,
int
ydst
,
static
void
scroll_console_output
(
struct
screen_buffer
*
screen_buffer
,
int
xsrc
,
int
ysrc
,
int
xdst
,
int
ydst
,
int
w
,
int
h
)
{
struct
screen_buffer
*
screen_buffer
;
int
j
;
char_info_t
*
psrc
,
*
pdst
;
struct
console_renderer_event
evt
;
if
(
!
(
screen_buffer
=
(
struct
screen_buffer
*
)
get_handle_obj
(
current
->
process
,
handle
,
FILE_WRITE_DATA
,
&
screen_buffer_ops
)))
return
;
if
(
xsrc
<
0
||
ysrc
<
0
||
xdst
<
0
||
ydst
<
0
||
xsrc
+
w
>
screen_buffer
->
width
||
xdst
+
w
>
screen_buffer
->
width
||
...
...
@@ -1358,7 +1361,6 @@ static void scroll_console_output( obj_handle_t handle, int xsrc, int ysrc, int
w
==
0
||
h
==
0
)
{
set_error
(
STATUS_INVALID_PARAMETER
);
release_object
(
screen_buffer
);
return
;
}
...
...
@@ -1396,8 +1398,6 @@ static void scroll_console_output( obj_handle_t handle, int xsrc, int ysrc, int
evt
.
u
.
update
.
top
=
min
(
ysrc
,
ydst
);
evt
.
u
.
update
.
bottom
=
max
(
ysrc
,
ydst
)
+
h
-
1
;
console_input_events_append
(
screen_buffer
->
input
,
&
evt
);
release_object
(
screen_buffer
);
}
/* allocate a console for the renderer */
...
...
@@ -1615,7 +1615,7 @@ DECL_HANDLER(create_console_output)
{
if
((
fd
=
thread_get_inflight_fd
(
current
,
req
->
fd
))
==
-
1
)
{
set_error
(
STATUS_INVALID_HANDLE
);
/* FIXME */
set_error
(
STATUS_INVALID_HANDLE
);
return
;
}
}
...
...
@@ -1625,6 +1625,12 @@ DECL_HANDLER(create_console_output)
close
(
fd
);
return
;
}
if
(
console_input_is_bare
(
console
)
^
(
fd
!=
-
1
))
{
close
(
fd
);
set_error
(
STATUS_INVALID_HANDLE
);
return
;
}
screen_buffer
=
create_console_output
(
console
,
fd
);
if
(
screen_buffer
)
...
...
@@ -1683,6 +1689,12 @@ DECL_HANDLER(read_console_output)
if
((
screen_buffer
=
(
struct
screen_buffer
*
)
get_handle_obj
(
current
->
process
,
req
->
handle
,
FILE_READ_DATA
,
&
screen_buffer_ops
)))
{
if
(
console_input_is_bare
(
screen_buffer
->
input
))
{
set_error
(
STATUS_OBJECT_TYPE_MISMATCH
);
release_object
(
screen_buffer
);
return
;
}
read_console_output
(
screen_buffer
,
req
->
x
,
req
->
y
,
req
->
mode
,
req
->
wrap
);
reply
->
width
=
screen_buffer
->
width
;
reply
->
height
=
screen_buffer
->
height
;
...
...
@@ -1698,6 +1710,12 @@ DECL_HANDLER(write_console_output)
if
((
screen_buffer
=
(
struct
screen_buffer
*
)
get_handle_obj
(
current
->
process
,
req
->
handle
,
FILE_WRITE_DATA
,
&
screen_buffer_ops
)))
{
if
(
console_input_is_bare
(
screen_buffer
->
input
))
{
set_error
(
STATUS_OBJECT_TYPE_MISMATCH
);
release_object
(
screen_buffer
);
return
;
}
reply
->
written
=
write_console_output
(
screen_buffer
,
get_req_data_size
(),
get_req_data
(),
req
->
mode
,
req
->
x
,
req
->
y
,
req
->
wrap
);
reply
->
width
=
screen_buffer
->
width
;
...
...
@@ -1714,6 +1732,12 @@ DECL_HANDLER(fill_console_output)
if
((
screen_buffer
=
(
struct
screen_buffer
*
)
get_handle_obj
(
current
->
process
,
req
->
handle
,
FILE_WRITE_DATA
,
&
screen_buffer_ops
)))
{
if
(
console_input_is_bare
(
screen_buffer
->
input
))
{
set_error
(
STATUS_OBJECT_TYPE_MISMATCH
);
release_object
(
screen_buffer
);
return
;
}
reply
->
written
=
fill_console_output
(
screen_buffer
,
req
->
data
,
req
->
mode
,
req
->
x
,
req
->
y
,
req
->
count
,
req
->
wrap
);
release_object
(
screen_buffer
);
...
...
@@ -1723,8 +1747,21 @@ DECL_HANDLER(fill_console_output)
/* move a rect of data in a screen buffer */
DECL_HANDLER
(
move_console_output
)
{
scroll_console_output
(
req
->
handle
,
req
->
x_src
,
req
->
y_src
,
req
->
x_dst
,
req
->
y_dst
,
req
->
w
,
req
->
h
);
struct
screen_buffer
*
screen_buffer
;
if
((
screen_buffer
=
(
struct
screen_buffer
*
)
get_handle_obj
(
current
->
process
,
req
->
handle
,
FILE_WRITE_DATA
,
&
screen_buffer_ops
)))
{
if
(
console_input_is_bare
(
screen_buffer
->
input
))
{
set_error
(
STATUS_OBJECT_TYPE_MISMATCH
);
release_object
(
screen_buffer
);
return
;
}
scroll_console_output
(
screen_buffer
,
req
->
x_src
,
req
->
y_src
,
req
->
x_dst
,
req
->
y_dst
,
req
->
w
,
req
->
h
);
release_object
(
screen_buffer
);
}
}
/* sends a signal to a console (process, group...) */
...
...
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