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
af472364
Commit
af472364
authored
Aug 31, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conhost: Implement IOCTL_CONDRV_SCROLL.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2dbf14ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
101 additions
and
0 deletions
+101
-0
conhost.c
programs/conhost/conhost.c
+101
-0
No files found.
programs/conhost/conhost.c
View file @
af472364
...
...
@@ -673,6 +673,102 @@ static NTSTATUS fill_output( struct screen_buffer *screen_buffer, const struct c
return
STATUS_SUCCESS
;
}
static
NTSTATUS
scroll_output
(
struct
screen_buffer
*
screen_buffer
,
const
struct
condrv_scroll_params
*
params
)
{
int
x
,
y
,
xsrc
,
ysrc
,
w
,
h
;
char_info_t
*
psrc
,
*
pdst
;
SMALL_RECT
src
,
dst
;
SMALL_RECT
clip
;
xsrc
=
params
->
scroll
.
Left
;
ysrc
=
params
->
scroll
.
Top
;
w
=
params
->
scroll
.
Right
-
params
->
scroll
.
Left
+
1
;
h
=
params
->
scroll
.
Bottom
-
params
->
scroll
.
Top
+
1
;
TRACE
(
"(%d %d) -> (%u %u) w %u h %u
\n
"
,
xsrc
,
ysrc
,
params
->
origin
.
X
,
params
->
origin
.
Y
,
w
,
h
);
clip
.
Left
=
max
(
params
->
clip
.
Left
,
0
);
clip
.
Top
=
max
(
params
->
clip
.
Top
,
0
);
clip
.
Right
=
min
(
params
->
clip
.
Right
,
screen_buffer
->
width
-
1
);
clip
.
Bottom
=
min
(
params
->
clip
.
Bottom
,
screen_buffer
->
height
-
1
);
if
(
clip
.
Left
>
clip
.
Right
||
clip
.
Top
>
clip
.
Bottom
||
params
->
scroll
.
Left
<
0
||
params
->
scroll
.
Top
<
0
||
params
->
scroll
.
Right
>=
screen_buffer
->
width
||
params
->
scroll
.
Bottom
>=
screen_buffer
->
height
||
params
->
scroll
.
Right
<
params
->
scroll
.
Left
||
params
->
scroll
.
Top
>
params
->
scroll
.
Bottom
||
params
->
origin
.
X
<
0
||
params
->
origin
.
X
>=
screen_buffer
->
width
||
params
->
origin
.
Y
<
0
||
params
->
origin
.
Y
>=
screen_buffer
->
height
)
return
STATUS_INVALID_PARAMETER
;
src
.
Left
=
max
(
xsrc
,
clip
.
Left
);
src
.
Top
=
max
(
ysrc
,
clip
.
Top
);
src
.
Right
=
min
(
xsrc
+
w
-
1
,
clip
.
Right
);
src
.
Bottom
=
min
(
ysrc
+
h
-
1
,
clip
.
Bottom
);
dst
.
Left
=
params
->
origin
.
X
;
dst
.
Top
=
params
->
origin
.
Y
;
dst
.
Right
=
params
->
origin
.
X
+
w
-
1
;
dst
.
Bottom
=
params
->
origin
.
Y
+
h
-
1
;
if
(
dst
.
Left
<
clip
.
Left
)
{
xsrc
+=
clip
.
Left
-
dst
.
Left
;
w
-=
clip
.
Left
-
dst
.
Left
;
dst
.
Left
=
clip
.
Left
;
}
if
(
dst
.
Top
<
clip
.
Top
)
{
ysrc
+=
clip
.
Top
-
dst
.
Top
;
h
-=
clip
.
Top
-
dst
.
Top
;
dst
.
Top
=
clip
.
Top
;
}
if
(
dst
.
Right
>
clip
.
Right
)
w
-=
dst
.
Right
-
clip
.
Right
;
if
(
dst
.
Bottom
>
clip
.
Bottom
)
h
-=
dst
.
Bottom
-
clip
.
Bottom
;
if
(
w
>
0
&&
h
>
0
)
{
if
(
ysrc
<
dst
.
Top
)
{
psrc
=
&
screen_buffer
->
data
[(
ysrc
+
h
-
1
)
*
screen_buffer
->
width
+
xsrc
];
pdst
=
&
screen_buffer
->
data
[(
dst
.
Top
+
h
-
1
)
*
screen_buffer
->
width
+
dst
.
Left
];
for
(
y
=
h
;
y
>
0
;
y
--
)
{
memcpy
(
pdst
,
psrc
,
w
*
sizeof
(
*
pdst
)
);
pdst
-=
screen_buffer
->
width
;
psrc
-=
screen_buffer
->
width
;
}
}
else
{
psrc
=
&
screen_buffer
->
data
[
ysrc
*
screen_buffer
->
width
+
xsrc
];
pdst
=
&
screen_buffer
->
data
[
dst
.
Top
*
screen_buffer
->
width
+
dst
.
Left
];
for
(
y
=
0
;
y
<
h
;
y
++
)
{
/* we use memmove here because when psrc and pdst are the same,
* copies are done on the same row, so the dst and src blocks
* can overlap */
memmove
(
pdst
,
psrc
,
w
*
sizeof
(
*
pdst
)
);
pdst
+=
screen_buffer
->
width
;
psrc
+=
screen_buffer
->
width
;
}
}
}
for
(
y
=
src
.
Top
;
y
<=
src
.
Bottom
;
y
++
)
{
int
left
=
src
.
Left
;
int
right
=
src
.
Right
;
if
(
dst
.
Top
<=
y
&&
y
<=
dst
.
Bottom
)
{
if
(
dst
.
Left
<=
src
.
Left
)
left
=
max
(
left
,
dst
.
Right
+
1
);
if
(
dst
.
Left
>=
src
.
Left
)
right
=
min
(
right
,
dst
.
Left
-
1
);
}
for
(
x
=
left
;
x
<=
right
;
x
++
)
screen_buffer
->
data
[
y
*
screen_buffer
->
width
+
x
]
=
params
->
fill
;
}
return
STATUS_SUCCESS
;
}
static
NTSTATUS
set_console_title
(
struct
console
*
console
,
const
WCHAR
*
in_title
,
size_t
size
)
{
WCHAR
*
title
=
NULL
;
...
...
@@ -744,6 +840,11 @@ static NTSTATUS screen_buffer_ioctl( struct screen_buffer *screen_buffer, unsign
return
STATUS_INVALID_PARAMETER
;
return
fill_output
(
screen_buffer
,
in_data
);
case
IOCTL_CONDRV_SCROLL
:
if
(
in_size
!=
sizeof
(
struct
condrv_scroll_params
)
||
*
out_size
)
return
STATUS_INVALID_PARAMETER
;
return
scroll_output
(
screen_buffer
,
in_data
);
default:
FIXME
(
"unsupported ioctl %x
\n
"
,
code
);
return
STATUS_NOT_SUPPORTED
;
...
...
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