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
0f1ecf28
Commit
0f1ecf28
authored
May 19, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
May 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Add support for %ws and %wc format specifiers to FormatMessageA/W.
parent
78615879
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
format_msg.c
dlls/kernel32/format_msg.c
+19
-4
No files found.
dlls/kernel32/format_msg.c
View file @
0f1ecf28
...
...
@@ -257,11 +257,20 @@ DWORD WINAPI FormatMessageA(
argliststart
=
(
*
(
DWORD
**
)
args
)
+
insertnr
-
1
;
/* FIXME: precision and width components are not handled correctly */
if
(
(
strcmp
(
fmtstr
,
"%ls"
)
==
0
)
||
(
strcmp
(
fmtstr
,
"%S"
)
==
0
)
)
{
sz
=
WideCharToMultiByte
(
CP_ACP
,
0
,
*
(
WCHAR
**
)
argliststart
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
strcmp
(
fmtstr
,
"%ls"
)
==
0
||
strcmp
(
fmtstr
,
"%S"
)
==
0
||
strcmp
(
fmtstr
,
"%ws"
)
==
0
)
{
sz
=
WideCharToMultiByte
(
CP_ACP
,
0
,
*
(
WCHAR
**
)
argliststart
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
b
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
);
WideCharToMultiByte
(
CP_ACP
,
0
,
*
(
WCHAR
**
)
argliststart
,
-
1
,
b
,
sz
,
NULL
,
NULL
);
}
else
{
WideCharToMultiByte
(
CP_ACP
,
0
,
*
(
WCHAR
**
)
argliststart
,
-
1
,
b
,
sz
,
NULL
,
NULL
);
}
else
if
(
strcmp
(
fmtstr
,
"%wc"
)
==
0
)
{
sz
=
WideCharToMultiByte
(
CP_ACP
,
0
,
(
WCHAR
*
)
argliststart
,
1
,
NULL
,
0
,
NULL
,
NULL
);
b
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sz
);
WideCharToMultiByte
(
CP_ACP
,
0
,
(
WCHAR
*
)
argliststart
,
1
,
b
,
sz
,
NULL
,
NULL
);
}
else
{
b
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sz
=
1000
);
/* CMF - This makes a BIG assumption about va_list */
TRACE
(
"A BIG assumption
\n
"
);
...
...
@@ -367,6 +376,7 @@ DWORD WINAPI FormatMessageW(
DWORD
width
=
dwFlags
&
FORMAT_MESSAGE_MAX_WIDTH_MASK
;
BOOL
eos
=
FALSE
;
WCHAR
ch
;
static
const
WCHAR
fmt_wc
[]
=
{
'%'
,
'w'
,
'c'
,
0
};
TRACE
(
"(0x%x,%p,%d,0x%x,%p,%d,%p)
\n
"
,
dwFlags
,
lpSource
,
dwMessageId
,
dwLanguageId
,
lpBuffer
,
nSize
,
args
);
...
...
@@ -483,6 +493,11 @@ DWORD WINAPI FormatMessageW(
/* CMF - This makes a BIG assumption about va_list */
vsprintfW
(
sprintfbuf
,
fmtstr
,
(
va_list
)
xarr
);
}
else
if
(
strcmpW
(
fmtstr
,
fmt_wc
)
==
0
)
{
sprintfbuf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
2
);
sprintfbuf
[
0
]
=
*
(
WCHAR
*
)
argliststart
;
sprintfbuf
[
1
]
=
0
;
}
else
{
sprintfbuf
=
HeapAlloc
(
GetProcessHeap
(),
0
,
100
);
...
...
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