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
dd95979b
Commit
dd95979b
authored
Jun 04, 2022
by
Daniel Lehman
Committed by
Alexandre Julliard
Jun 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Test if RtlFormatMessage modifies va_list on error.
Signed-off-by:
Daniel Lehman
<
dlehman25@gmail.com
>
parent
bc4afb8b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
rtlstr.c
dlls/ntdll/tests/rtlstr.c
+21
-0
No files found.
dlls/ntdll/tests/rtlstr.c
View file @
dd95979b
...
...
@@ -2660,6 +2660,25 @@ static void WINAPIV testfmt( const WCHAR *src, const WCHAR *expect, ULONG width,
ok
(
size
==
(
lstrlenW
(
expect
)
+
1
)
*
sizeof
(
WCHAR
),
"%s: wrong size %lu
\n
"
,
debugstr_w
(
src
),
size
);
}
static
void
testfmt_arg_eaten
(
const
WCHAR
*
src
,
...
)
{
va_list
args
;
NTSTATUS
status
;
WCHAR
*
arg
,
buffer
[
1
];
ULONG
size
=
0xdeadbeef
;
buffer
[
0
]
=
0xcccc
;
va_start
(
args
,
src
);
status
=
pRtlFormatMessage
(
src
,
0
,
FALSE
,
FALSE
,
FALSE
,
&
args
,
buffer
,
ARRAY_SIZE
(
buffer
),
&
size
);
ok
(
status
==
STATUS_BUFFER_OVERFLOW
,
"%s: failed %lx
\n
"
,
debugstr_w
(
src
),
status
);
todo_wine
ok
(
buffer
[
0
]
==
0xcccc
,
"%s: got %x
\n
"
,
debugstr_w
(
src
),
buffer
[
0
]
);
ok
(
size
==
0xdeadbeef
,
"%s: wrong size %lu
\n
"
,
debugstr_w
(
src
),
size
);
arg
=
va_arg
(
args
,
WCHAR
*
);
ok
(
!
wcscmp
(
L"unused"
,
arg
),
"%s: wrong arg %s
\n
"
,
debugstr_w
(
src
),
debugstr_w
(
arg
)
);
va_end
(
args
);
}
static
void
test_RtlFormatMessage
(
void
)
{
WCHAR
buffer
[
128
];
...
...
@@ -2907,6 +2926,8 @@ static void test_RtlFormatMessage(void)
ok
(
!
lstrcmpW
(
buffer
,
L"abcxxxxxxx"
),
"got %s
\n
"
,
wine_dbgstr_w
(
buffer
)
);
ok
(
size
==
0xdeadbeef
,
"wrong size %lu
\n
"
,
size
);
/* va_arg is eaten even in case of buffer overflow */
testfmt_arg_eaten
(
L"%1!s! %2!s!"
,
L"eaten"
,
L"unused"
);
}
START_TEST
(
rtlstr
)
...
...
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