Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1d8c2d28
Commit
1d8c2d28
authored
Oct 15, 2020
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 15, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Move console code page validation to conhost.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
01c17ca2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
14 deletions
+8
-14
console.c
dlls/kernelbase/console.c
+2
-14
conhost.c
programs/conhost/conhost.c
+6
-0
No files found.
dlls/kernelbase/console.c
View file @
1d8c2d28
...
...
@@ -637,7 +637,7 @@ UINT WINAPI DECLSPEC_HOTPATCH GetConsoleCP(void)
if
(
!
console_ioctl
(
RtlGetCurrentPeb
()
->
ProcessParameters
->
ConsoleHandle
,
IOCTL_CONDRV_GET_INPUT_INFO
,
NULL
,
0
,
&
info
,
sizeof
(
info
),
NULL
))
return
0
;
return
info
.
input_cp
?
info
.
input_cp
:
GetOEMCP
()
;
return
info
.
input_cp
;
}
...
...
@@ -710,7 +710,7 @@ UINT WINAPI DECLSPEC_HOTPATCH GetConsoleOutputCP(void)
if
(
!
console_ioctl
(
RtlGetCurrentPeb
()
->
ProcessParameters
->
ConsoleHandle
,
IOCTL_CONDRV_GET_INPUT_INFO
,
NULL
,
0
,
&
info
,
sizeof
(
info
),
NULL
))
return
0
;
return
info
.
output_cp
?
info
.
output_cp
:
GetOEMCP
()
;
return
info
.
output_cp
;
}
...
...
@@ -1092,12 +1092,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleCP( UINT cp )
{
struct
condrv_input_info_params
params
=
{
SET_CONSOLE_INPUT_INFO_INPUT_CODEPAGE
};
if
(
!
IsValidCodePage
(
cp
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
params
.
info
.
input_cp
=
cp
;
return
console_ioctl
(
RtlGetCurrentPeb
()
->
ProcessParameters
->
ConsoleHandle
,
IOCTL_CONDRV_SET_INPUT_INFO
,
&
params
,
sizeof
(
params
),
NULL
,
0
,
NULL
);
...
...
@@ -1237,12 +1231,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleOutputCP( UINT cp )
{
struct
condrv_input_info_params
params
=
{
SET_CONSOLE_INPUT_INFO_OUTPUT_CODEPAGE
};
if
(
!
IsValidCodePage
(
cp
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
params
.
info
.
output_cp
=
cp
;
return
console_ioctl
(
RtlGetCurrentPeb
()
->
ProcessParameters
->
ConsoleHandle
,
IOCTL_CONDRV_SET_INPUT_INFO
,
&
params
,
sizeof
(
params
),
NULL
,
0
,
NULL
);
...
...
programs/conhost/conhost.c
View file @
1d8c2d28
...
...
@@ -2407,9 +2407,15 @@ static NTSTATUS console_input_ioctl( struct console *console, unsigned int code,
TRACE
(
"set info
\n
"
);
if
(
in_size
!=
sizeof
(
*
params
)
||
*
out_size
)
return
STATUS_INVALID_PARAMETER
;
if
(
params
->
mask
&
SET_CONSOLE_INPUT_INFO_INPUT_CODEPAGE
)
{
if
(
!
IsValidCodePage
(
params
->
info
.
input_cp
))
return
STATUS_INVALID_PARAMETER
;
console
->
input_cp
=
params
->
info
.
input_cp
;
}
if
(
params
->
mask
&
SET_CONSOLE_INPUT_INFO_OUTPUT_CODEPAGE
)
{
if
(
!
IsValidCodePage
(
params
->
info
.
output_cp
))
return
STATUS_INVALID_PARAMETER
;
console
->
output_cp
=
params
->
info
.
output_cp
;
}
return
STATUS_SUCCESS
;
}
...
...
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