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
f8fa6fd6
Commit
f8fa6fd6
authored
Jul 28, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Use IOCTL_CONDRV_READ_OUTPUT in ReadConsoleOutputW.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5f6bb638
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
24 deletions
+35
-24
console.c
dlls/kernelbase/console.c
+35
-24
No files found.
dlls/kernelbase/console.c
View file @
f8fa6fd6
...
...
@@ -894,37 +894,48 @@ BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputA( HANDLE handle, CHAR_INFO *buff
BOOL
WINAPI
DECLSPEC_HOTPATCH
ReadConsoleOutputW
(
HANDLE
handle
,
CHAR_INFO
*
buffer
,
COORD
size
,
COORD
coord
,
SMALL_RECT
*
region
)
{
int
width
,
height
,
y
;
BOOL
ret
=
TRUE
;
struct
condrv_output_params
params
;
unsigned
int
width
,
height
,
y
;
SMALL_RECT
*
result
;
DWORD
count
;
BOOL
ret
;
if
(
region
->
Left
>
region
->
Right
||
region
->
Top
>
region
->
Bottom
)
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
FALSE
;
}
if
(
size
.
X
<=
coord
.
X
||
size
.
Y
<=
coord
.
Y
)
{
region
->
Right
=
region
->
Left
-
1
;
region
->
Bottom
=
region
->
Top
-
1
;
SetLastError
(
ERROR_INVALID_FUNCTION
);
return
FALSE
;
}
width
=
min
(
region
->
Right
-
region
->
Left
+
1
,
size
.
X
-
coord
.
X
);
height
=
min
(
region
->
Bottom
-
region
->
Top
+
1
,
size
.
Y
-
coord
.
Y
);
if
(
width
>
0
&&
height
>
0
)
count
=
sizeof
(
*
result
)
+
width
*
height
*
sizeof
(
*
buffer
);
if
(
!
(
result
=
HeapAlloc
(
GetProcessHeap
(),
0
,
count
)))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
FALSE
;
}
params
.
mode
=
CHAR_INFO_MODE_TEXTATTR
;
params
.
x
=
region
->
Left
;
params
.
y
=
region
->
Top
;
params
.
width
=
width
;
if
((
ret
=
console_ioctl
(
handle
,
IOCTL_CONDRV_READ_OUTPUT
,
&
params
,
sizeof
(
params
),
result
,
count
,
&
count
))
&&
count
)
{
CHAR_INFO
*
char_info
=
(
CHAR_INFO
*
)(
result
+
1
);
*
region
=
*
result
;
width
=
region
->
Right
-
region
->
Left
+
1
;
height
=
region
->
Bottom
-
region
->
Top
+
1
;
for
(
y
=
0
;
y
<
height
;
y
++
)
{
SERVER_START_REQ
(
read_console_output
)
{
req
->
handle
=
console_handle_unmap
(
handle
);
req
->
x
=
region
->
Left
;
req
->
y
=
region
->
Top
+
y
;
req
->
mode
=
CHAR_INFO_MODE_TEXTATTR
;
req
->
wrap
=
FALSE
;
wine_server_set_reply
(
req
,
&
buffer
[(
y
+
coord
.
Y
)
*
size
.
X
+
coord
.
X
],
width
*
sizeof
(
CHAR_INFO
)
);
if
((
ret
=
!
wine_server_call_err
(
req
)))
{
width
=
min
(
width
,
reply
->
width
-
region
->
Left
);
height
=
min
(
height
,
reply
->
height
-
region
->
Top
);
}
}
SERVER_END_REQ
;
if
(
!
ret
)
break
;
}
memcpy
(
&
buffer
[(
y
+
coord
.
Y
)
*
size
.
X
+
coord
.
X
],
&
char_info
[
y
*
width
],
width
*
sizeof
(
*
buffer
)
);
}
region
->
Bottom
=
region
->
Top
+
height
-
1
;
region
->
Right
=
region
->
Left
+
width
-
1
;
HeapFree
(
GetProcessHeap
(),
0
,
result
);
return
ret
;
}
...
...
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