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
18f9d2dd
Commit
18f9d2dd
authored
Apr 28, 2022
by
Eric Pouech
Committed by
Alexandre Julliard
May 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
start: Use OEM code page for output.
Signed-off-by:
Eric Pouech
<
eric.pouech@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
de548725
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
start.c
programs/start/start.c
+3
-6
No files found.
programs/start/start.c
View file @
18f9d2dd
...
...
@@ -38,25 +38,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(start);
static
void
output
(
const
WCHAR
*
message
)
{
DWORD
count
;
DWORD
res
;
int
wlen
=
lstrlenW
(
message
);
if
(
!
wlen
)
return
;
res
=
WriteConsoleW
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
message
,
wlen
,
&
count
,
NULL
);
/* If writing to console fails, assume it's file
* i/o so convert to OEM codepage and output
*/
if
(
!
res
)
if
(
!
WriteConsoleW
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
message
,
wlen
,
&
count
,
NULL
)
)
{
DWORD
len
;
char
*
mesA
;
/* Convert to OEM, then output */
len
=
WideCharToMultiByte
(
Get
ConsoleOutput
CP
(),
0
,
message
,
wlen
,
NULL
,
0
,
NULL
,
NULL
);
len
=
WideCharToMultiByte
(
Get
OEM
CP
(),
0
,
message
,
wlen
,
NULL
,
0
,
NULL
,
NULL
);
mesA
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
char
));
if
(
!
mesA
)
return
;
WideCharToMultiByte
(
Get
ConsoleOutput
CP
(),
0
,
message
,
wlen
,
mesA
,
len
,
NULL
,
NULL
);
WideCharToMultiByte
(
Get
OEM
CP
(),
0
,
message
,
wlen
,
mesA
,
len
,
NULL
,
NULL
);
WriteFile
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
mesA
,
len
,
&
count
,
FALSE
);
HeapFree
(
GetProcessHeap
(),
0
,
mesA
);
}
...
...
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