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
6039b785
Commit
6039b785
authored
Jul 17, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Avoid unneeded GetConsoleOutputCP calls.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f16a631c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
console.c
dlls/kernelbase/console.c
+6
-5
No files found.
dlls/kernelbase/console.c
View file @
6039b785
...
@@ -133,9 +133,8 @@ static void input_records_AtoW( INPUT_RECORD *buffer, int count )
...
@@ -133,9 +133,8 @@ static void input_records_AtoW( INPUT_RECORD *buffer, int count )
}
}
/* map char infos to ASCII */
/* map char infos to ASCII */
static
void
char_info_WtoA
(
CHAR_INFO
*
buffer
,
int
count
)
static
void
char_info_WtoA
(
UINT
cp
,
CHAR_INFO
*
buffer
,
int
count
)
{
{
UINT
cp
=
GetConsoleOutputCP
();
char
ch
;
char
ch
;
while
(
count
--
>
0
)
while
(
count
--
>
0
)
...
@@ -889,8 +888,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputA( HANDLE handle, CHAR_INFO *buff
...
@@ -889,8 +888,9 @@ BOOL WINAPI DECLSPEC_HOTPATCH ReadConsoleOutputA( HANDLE handle, CHAR_INFO *buff
ret
=
ReadConsoleOutputW
(
handle
,
buffer
,
size
,
coord
,
region
);
ret
=
ReadConsoleOutputW
(
handle
,
buffer
,
size
,
coord
,
region
);
if
(
ret
&&
region
->
Right
>=
region
->
Left
)
if
(
ret
&&
region
->
Right
>=
region
->
Left
)
{
{
UINT
cp
=
GetConsoleOutputCP
();
for
(
y
=
0
;
y
<=
region
->
Bottom
-
region
->
Top
;
y
++
)
for
(
y
=
0
;
y
<=
region
->
Bottom
-
region
->
Top
;
y
++
)
char_info_WtoA
(
&
buffer
[(
coord
.
Y
+
y
)
*
size
.
X
+
coord
.
X
],
region
->
Right
-
region
->
Left
+
1
);
char_info_WtoA
(
cp
,
&
buffer
[(
coord
.
Y
+
y
)
*
size
.
X
+
coord
.
X
],
region
->
Right
-
region
->
Left
+
1
);
}
}
return
ret
;
return
ret
;
}
}
...
@@ -1583,19 +1583,20 @@ BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputCharacterA( HANDLE handle, LPCST
...
@@ -1583,19 +1583,20 @@ BOOL WINAPI DECLSPEC_HOTPATCH WriteConsoleOutputCharacterA( HANDLE handle, LPCST
if
(
length
>
0
)
if
(
length
>
0
)
{
{
UINT
cp
=
GetConsoleOutputCP
();
if
(
!
str
)
if
(
!
str
)
{
{
SetLastError
(
ERROR_INVALID_ACCESS
);
SetLastError
(
ERROR_INVALID_ACCESS
);
return
FALSE
;
return
FALSE
;
}
}
lenW
=
MultiByteToWideChar
(
GetConsoleOutputCP
()
,
0
,
str
,
length
,
NULL
,
0
);
lenW
=
MultiByteToWideChar
(
cp
,
0
,
str
,
length
,
NULL
,
0
);
if
(
!
(
strW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lenW
*
sizeof
(
WCHAR
)
)))
if
(
!
(
strW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lenW
*
sizeof
(
WCHAR
)
)))
{
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
FALSE
;
return
FALSE
;
}
}
MultiByteToWideChar
(
GetConsoleOutputCP
()
,
0
,
str
,
length
,
strW
,
lenW
);
MultiByteToWideChar
(
cp
,
0
,
str
,
length
,
strW
,
lenW
);
}
}
ret
=
WriteConsoleOutputCharacterW
(
handle
,
strW
,
lenW
,
coord
,
written
);
ret
=
WriteConsoleOutputCharacterW
(
handle
,
strW
,
lenW
,
coord
,
written
);
HeapFree
(
GetProcessHeap
(),
0
,
strW
);
HeapFree
(
GetProcessHeap
(),
0
,
strW
);
...
...
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