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
0e26e741
Commit
0e26e741
authored
Oct 29, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Replicate the MS bug with va_list argument counting in FormatMessage.
parent
24a8e33f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
format_msg.c
dlls/kernel32/format_msg.c
+4
-0
format_msg.c
dlls/kernel32/tests/format_msg.c
+2
-2
No files found.
dlls/kernel32/format_msg.c
View file @
0e26e741
...
...
@@ -210,6 +210,8 @@ static LPCSTR format_insertA( int insert, LPCSTR format, DWORD flags,
while
(
isdigit
(
*
format
))
*
p
++
=
*
format
++
;
}
/* replicate MS bug: drop an argument when using va_list with width/precision */
if
(
insert
==
-
1
&&
args
->
list
)
args
->
last
--
;
arg
=
get_arg
(
insert
,
flags
,
args
);
/* check for wide string format */
...
...
@@ -333,6 +335,8 @@ static LPCWSTR format_insertW( int insert, LPCWSTR format, DWORD flags,
while
(
isdigitW
(
*
format
))
*
p
++
=
*
format
++
;
}
/* replicate MS bug: drop an argument when using va_list with width/precision */
if
(
insert
==
-
1
&&
args
->
list
)
args
->
last
--
;
arg
=
get_arg
(
insert
,
flags
,
args
);
/* check for ascii string format */
...
...
dlls/kernel32/tests/format_msg.c
View file @
0e26e741
...
...
@@ -337,7 +337,7 @@ static void test_message_from_string_wide(void)
ok
(
r
==
11
,
"failed: r=%d
\n
"
,
r
);
r
=
doitW
(
FORMAT_MESSAGE_FROM_STRING
,
fmt_1oou3oou
,
0
,
0
,
out
,
sizeof
(
out
)
/
sizeof
(
WCHAR
),
5
,
3
,
1
,
6
,
4
,
2
);
todo_wine
ok
(
!
lstrcmpW
(
s_sp001sp002
,
out
),
"failed out=[%s]
\n
"
,
wine_dbgstr_w
(
out
));
ok
(
!
lstrcmpW
(
s_sp001sp002
,
out
),
"failed out=[%s]
\n
"
,
wine_dbgstr_w
(
out
));
ok
(
r
==
12
,
"failed: r=%d
\n
"
,
r
);
/* args are not counted the same way with an argument array */
{
...
...
@@ -589,7 +589,7 @@ static void test_message_from_string(void)
ok
(
r
==
11
,
"failed: r=%d
\n
"
,
r
);
r
=
doit
(
FORMAT_MESSAGE_FROM_STRING
,
"%1!*.*u!,%3!*.*u!"
,
0
,
0
,
out
,
sizeof
(
out
),
5
,
3
,
1
,
6
,
4
,
2
);
todo_wine
ok
(
!
strcmp
(
" 001, 0002"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
!
strcmp
(
" 001, 0002"
,
out
),
"failed out=[%s]
\n
"
,
out
);
ok
(
r
==
12
,
"failed: r=%d
\n
"
,
r
);
/* args are not counted the same way with an argument array */
{
...
...
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