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
2e7c0de6
Commit
2e7c0de6
authored
Jun 30, 2003
by
Catalin Patulea
Committed by
Alexandre Julliard
Jun 30, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Unicode string output.
parent
12acfb22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
6 deletions
+38
-6
winedbg.c
programs/winedbg/winedbg.c
+38
-6
No files found.
programs/winedbg/winedbg.c
View file @
2e7c0de6
...
...
@@ -32,6 +32,7 @@
#include "winuser.h"
#include "excpt.h"
#include "wine/library.h"
#include "winnls.h"
DBG_PROCESS
*
DEBUG_CurrProcess
=
NULL
;
DBG_THREAD
*
DEBUG_CurrThread
=
NULL
;
...
...
@@ -58,12 +59,43 @@ void DEBUG_OutputA(int chn, const char* buffer, int len)
void
DEBUG_OutputW
(
int
chn
,
const
WCHAR
*
buffer
,
int
len
)
{
/* FIXME: this won't work is std output isn't attached to a console */
if
(
DBG_IVAR
(
ConChannelMask
)
&
chn
)
WriteConsoleW
(
GetStdHandle
(
STD_OUTPUT_HANDLE
),
buffer
,
len
,
NULL
,
NULL
);
/* simplistic Unicode to ANSI conversion */
if
(
DBG_IVAR
(
StdChannelMask
)
&
chn
)
while
(
len
--
)
fputc
((
char
)
*
buffer
++
,
stderr
);
char
*
ansi
=
NULL
;
int
newlen
;
/* do a serious Unicode to ANSI conversion
FIXME: should CP_ACP be GetConsoleCP()? */
newlen
=
WideCharToMultiByte
(
CP_ACP
,
0
,
buffer
,
len
,
NULL
,
0
,
NULL
,
NULL
);
if
(
newlen
)
{
ansi
=
(
char
*
)
DBG_alloc
(
newlen
);
if
(
ansi
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
buffer
,
len
,
ansi
,
newlen
,
NULL
,
NULL
);
}
}
/* fall back to a simple Unicode to ANSI conversion in case WC2MB failed */
if
(
!
ansi
)
{
ansi
=
DBG_alloc
(
len
);
if
(
ansi
)
{
int
i
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
ansi
[
i
]
=
(
char
)
buffer
[
i
];
}
newlen
=
len
;
}
/* else we are having REALLY bad luck today */
}
if
(
ansi
)
{
DEBUG_OutputA
(
chn
,
ansi
,
newlen
);
DBG_free
(
ansi
);
}
}
int
DEBUG_Printf
(
int
chn
,
const
char
*
format
,
...)
...
...
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