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
09ab7e8a
Commit
09ab7e8a
authored
Jul 23, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Use IOCTL_CONDRV_WRITE_OUTPUT in WriteConsoleOutputW.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5b795b65
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
26 deletions
+28
-26
console.c
dlls/kernelbase/console.c
+28
-26
No files found.
dlls/kernelbase/console.c
View file @
09ab7e8a
...
@@ -1486,41 +1486,43 @@ BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputA( HANDLE handle, const CHAR_INF
...
@@ -1486,41 +1486,43 @@ BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputA( HANDLE handle, const CHAR_INF
BOOL
WINAPI
DECLSPEC_HOTPATCH
WriteConsoleOutputW
(
HANDLE
handle
,
const
CHAR_INFO
*
buffer
,
BOOL
WINAPI
DECLSPEC_HOTPATCH
WriteConsoleOutputW
(
HANDLE
handle
,
const
CHAR_INFO
*
buffer
,
COORD
size
,
COORD
coord
,
SMALL_RECT
*
region
)
COORD
size
,
COORD
coord
,
SMALL_RECT
*
region
)
{
{
int
width
,
height
,
y
;
struct
condrv_write_output_params
*
params
;
BOOL
ret
=
TRUE
;
unsigned
int
width
,
height
,
y
;
size_t
params_size
;
BOOL
ret
;
TRACE
(
"(%p,%p,(%d,%d),(%d,%d),(%d,%dx%d,%d)
\n
"
,
TRACE
(
"(%p,%p,(%d,%d),(%d,%d),(%d,%dx%d,%d)
\n
"
,
handle
,
buffer
,
size
.
X
,
size
.
Y
,
coord
.
X
,
coord
.
Y
,
handle
,
buffer
,
size
.
X
,
size
.
Y
,
coord
.
X
,
coord
.
Y
,
region
->
Left
,
region
->
Top
,
region
->
Right
,
region
->
Bottom
);
region
->
Left
,
region
->
Top
,
region
->
Right
,
region
->
Bottom
);
width
=
min
(
region
->
Right
-
region
->
Left
+
1
,
size
.
X
-
coord
.
X
);
if
(
region
->
Left
>
region
->
Right
||
region
->
Top
>
region
->
Bottom
||
size
.
X
<=
coord
.
X
||
size
.
Y
<=
coord
.
Y
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
width
=
min
(
region
->
Right
-
region
->
Left
+
1
,
size
.
X
-
coord
.
X
);
height
=
min
(
region
->
Bottom
-
region
->
Top
+
1
,
size
.
Y
-
coord
.
Y
);
height
=
min
(
region
->
Bottom
-
region
->
Top
+
1
,
size
.
Y
-
coord
.
Y
);
region
->
Right
=
region
->
Left
+
width
-
1
;
region
->
Bottom
=
region
->
Top
+
height
-
1
;
if
(
width
>
0
&&
height
>
0
)
params_size
=
sizeof
(
*
params
)
+
width
*
height
*
sizeof
(
*
buffer
);
if
(
!
(
params
=
HeapAlloc
(
GetProcessHeap
(),
0
,
params_size
)))
{
{
for
(
y
=
0
;
y
<
height
;
y
++
)
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
{
return
FALSE
;
SERVER_START_REQ
(
write_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_add_data
(
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
;
}
}
}
region
->
Bottom
=
region
->
Top
+
height
-
1
;
region
->
Right
=
region
->
Left
+
width
-
1
;
params
->
mode
=
CHAR_INFO_MODE_TEXTATTR
;
params
->
x
=
region
->
Left
;
params
->
y
=
region
->
Top
;
params
->
width
=
width
;
for
(
y
=
0
;
y
<
height
;
y
++
)
memcpy
(
&
((
CHAR_INFO
*
)(
params
+
1
))[
y
*
width
],
&
buffer
[(
y
+
coord
.
Y
)
*
size
.
X
+
coord
.
X
],
width
*
sizeof
(
CHAR_INFO
)
);
ret
=
console_ioctl
(
handle
,
IOCTL_CONDRV_WRITE_OUTPUT
,
params
,
params_size
,
region
,
sizeof
(
*
region
),
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
params
);
return
ret
;
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