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
b7ea6311
Commit
b7ea6311
authored
Sep 05, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix _vswprintf* arguments.
parent
5b49e228
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
127 additions
and
4 deletions
+127
-4
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+4
-4
printf.c
dlls/msvcrt/tests/printf.c
+123
-0
No files found.
dlls/msvcrt/msvcrt.spec
View file @
b7ea6311
...
@@ -1047,10 +1047,10 @@
...
@@ -1047,10 +1047,10 @@
@ cdecl _vsprintf_p(ptr long str ptr) MSVCRT_vsprintf_p
@ cdecl _vsprintf_p(ptr long str ptr) MSVCRT_vsprintf_p
@ cdecl _vsprintf_p_l(ptr long str ptr ptr) MSVCRT_vsprintf_p_l
@ cdecl _vsprintf_p_l(ptr long str ptr ptr) MSVCRT_vsprintf_p_l
# stub _vsprintf_s_l(ptr long str ptr ptr)
# stub _vsprintf_s_l(ptr long str ptr ptr)
@ cdecl _vswprintf(ptr
long
wstr ptr) MSVCRT_vswprintf
@ cdecl _vswprintf(ptr wstr ptr) MSVCRT_vswprintf
@ cdecl _vswprintf_c(ptr long wstr ptr) MSVCRT_vswprintf
@ cdecl _vswprintf_c(ptr long wstr ptr) MSVCRT_vs
n
wprintf
@ cdecl _vswprintf_c_l(ptr long wstr ptr ptr) MSVCRT_vswprintf_l
@ cdecl _vswprintf_c_l(ptr long wstr ptr ptr) MSVCRT_vs
n
wprintf_l
@ cdecl _vswprintf_l(ptr
long
wstr ptr ptr) MSVCRT_vswprintf_l
@ cdecl _vswprintf_l(ptr wstr ptr ptr) MSVCRT_vswprintf_l
@ cdecl _vswprintf_p_l(ptr long wstr ptr ptr) MSVCRT_vswprintf_p_l
@ cdecl _vswprintf_p_l(ptr long wstr ptr ptr) MSVCRT_vswprintf_p_l
@ cdecl _vswprintf_s_l(ptr long wstr ptr ptr) MSVCRT_vswprintf_s_l
@ cdecl _vswprintf_s_l(ptr long wstr ptr ptr) MSVCRT_vswprintf_s_l
# stub _vwprintf_l(wstr ptr ptr)
# stub _vwprintf_l(wstr ptr ptr)
...
...
dlls/msvcrt/tests/printf.c
View file @
b7ea6311
...
@@ -45,6 +45,16 @@ static int (__cdecl *p__fcvt_s)(char *buffer, size_t length, double number,
...
@@ -45,6 +45,16 @@ static int (__cdecl *p__fcvt_s)(char *buffer, size_t length, double number,
int
ndigits
,
int
*
decpt
,
int
*
sign
);
int
ndigits
,
int
*
decpt
,
int
*
sign
);
static
unsigned
int
(
__cdecl
*
p__get_output_format
)(
void
);
static
unsigned
int
(
__cdecl
*
p__get_output_format
)(
void
);
static
int
(
__cdecl
*
p__vsprintf_p
)(
char
*
,
size_t
,
const
char
*
,
__ms_va_list
);
static
int
(
__cdecl
*
p__vsprintf_p
)(
char
*
,
size_t
,
const
char
*
,
__ms_va_list
);
static
int
(
__cdecl
*
p_vswprintf
)(
wchar_t
*
str
,
const
wchar_t
*
format
,
__ms_va_list
valist
);
static
int
(
__cdecl
*
p__vswprintf
)(
wchar_t
*
str
,
const
wchar_t
*
format
,
__ms_va_list
valist
);
static
int
(
__cdecl
*
p__vswprintf_l
)(
wchar_t
*
str
,
const
wchar_t
*
format
,
void
*
locale
,
__ms_va_list
valist
);
static
int
(
__cdecl
*
p__vswprintf_c
)(
wchar_t
*
str
,
size_t
size
,
const
wchar_t
*
format
,
__ms_va_list
valist
);
static
int
(
__cdecl
*
p__vswprintf_c_l
)(
wchar_t
*
str
,
size_t
size
,
const
wchar_t
*
format
,
void
*
locale
,
__ms_va_list
valist
);
static
int
(
__cdecl
*
p__vswprintf_p_l
)(
wchar_t
*
str
,
size_t
size
,
const
wchar_t
*
format
,
void
*
locale
,
__ms_va_list
valist
);
static
void
init
(
void
)
static
void
init
(
void
)
{
{
...
@@ -57,6 +67,12 @@ static void init( void )
...
@@ -57,6 +67,12 @@ static void init( void )
p__fcvt_s
=
(
void
*
)
GetProcAddress
(
hmod
,
"_fcvt_s"
);
p__fcvt_s
=
(
void
*
)
GetProcAddress
(
hmod
,
"_fcvt_s"
);
p__get_output_format
=
(
void
*
)
GetProcAddress
(
hmod
,
"_get_output_format"
);
p__get_output_format
=
(
void
*
)
GetProcAddress
(
hmod
,
"_get_output_format"
);
p__vsprintf_p
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vsprintf_p"
);
p__vsprintf_p
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vsprintf_p"
);
p_vswprintf
=
(
void
*
)
GetProcAddress
(
hmod
,
"vswprintf"
);
p__vswprintf
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vswprintf"
);
p__vswprintf_l
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vswprintf_l"
);
p__vswprintf_c
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vswprintf_c"
);
p__vswprintf_c_l
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vswprintf_c_l"
);
p__vswprintf_p_l
=
(
void
*
)
GetProcAddress
(
hmod
,
"_vswprintf_p_l"
);
}
}
static
void
test_sprintf
(
void
)
static
void
test_sprintf
(
void
)
...
@@ -943,6 +959,112 @@ static void test_vsnwprintf(void)
...
@@ -943,6 +959,112 @@ static void test_vsnwprintf(void)
ok
(
!
strcmp
(
buf
,
"onetwothree"
),
"got %s expected 'onetwothree'
\n
"
,
buf
);
ok
(
!
strcmp
(
buf
,
"onetwothree"
),
"got %s expected 'onetwothree'
\n
"
,
buf
);
}
}
static
int
__cdecl
vswprintf_wrapper
(
wchar_t
*
str
,
const
wchar_t
*
format
,
...)
{
int
ret
;
__ms_va_list
valist
;
__ms_va_start
(
valist
,
format
);
ret
=
p_vswprintf
(
str
,
format
,
valist
);
__ms_va_end
(
valist
);
return
ret
;
}
static
int
__cdecl
_vswprintf_wrapper
(
wchar_t
*
str
,
const
wchar_t
*
format
,
...)
{
int
ret
;
__ms_va_list
valist
;
__ms_va_start
(
valist
,
format
);
ret
=
p__vswprintf
(
str
,
format
,
valist
);
__ms_va_end
(
valist
);
return
ret
;
}
static
int
__cdecl
_vswprintf_l_wrapper
(
wchar_t
*
str
,
const
wchar_t
*
format
,
void
*
locale
,
...)
{
int
ret
;
__ms_va_list
valist
;
__ms_va_start
(
valist
,
locale
);
ret
=
p__vswprintf_l
(
str
,
format
,
locale
,
valist
);
__ms_va_end
(
valist
);
return
ret
;
}
static
int
__cdecl
_vswprintf_c_wrapper
(
wchar_t
*
str
,
size_t
size
,
const
wchar_t
*
format
,
...)
{
int
ret
;
__ms_va_list
valist
;
__ms_va_start
(
valist
,
format
);
ret
=
p__vswprintf_c
(
str
,
size
,
format
,
valist
);
__ms_va_end
(
valist
);
return
ret
;
}
static
int
__cdecl
_vswprintf_c_l_wrapper
(
wchar_t
*
str
,
size_t
size
,
const
wchar_t
*
format
,
void
*
locale
,
...)
{
int
ret
;
__ms_va_list
valist
;
__ms_va_start
(
valist
,
locale
);
ret
=
p__vswprintf_c_l
(
str
,
size
,
format
,
locale
,
valist
);
__ms_va_end
(
valist
);
return
ret
;
}
static
int
__cdecl
_vswprintf_p_l_wrapper
(
wchar_t
*
str
,
size_t
size
,
const
wchar_t
*
format
,
void
*
locale
,
...)
{
int
ret
;
__ms_va_list
valist
;
__ms_va_start
(
valist
,
locale
);
ret
=
p__vswprintf_p_l
(
str
,
size
,
format
,
locale
,
valist
);
__ms_va_end
(
valist
);
return
ret
;
}
static
void
test_vswprintf
(
void
)
{
const
wchar_t
format
[]
=
{
'%'
,
's'
,
' '
,
'%'
,
'd'
,
0
};
const
wchar_t
number
[]
=
{
'n'
,
'u'
,
'm'
,
'b'
,
'e'
,
'r'
,
0
};
const
wchar_t
out
[]
=
{
'n'
,
'u'
,
'm'
,
'b'
,
'e'
,
'r'
,
' '
,
'1'
,
'2'
,
'3'
,
0
};
wchar_t
buf
[
20
];
int
ret
;
if
(
!
p_vswprintf
||
!
p__vswprintf
||
!
p__vswprintf_l
||!
p__vswprintf_c
||
!
p__vswprintf_c_l
||
!
p__vswprintf_p_l
)
{
win_skip
(
"_vswprintf or vswprintf not available
\n
"
);
return
;
}
ret
=
vswprintf_wrapper
(
buf
,
format
,
number
,
123
);
ok
(
ret
==
10
,
"got %d, expected 10
\n
"
,
ret
);
ok
(
!
memcmp
(
buf
,
out
,
sizeof
(
out
)),
"buf = %s
\n
"
,
wine_dbgstr_w
(
buf
));
memset
(
buf
,
0
,
sizeof
(
buf
));
ret
=
_vswprintf_wrapper
(
buf
,
format
,
number
,
123
);
ok
(
ret
==
10
,
"got %d, expected 10
\n
"
,
ret
);
ok
(
!
memcmp
(
buf
,
out
,
sizeof
(
out
)),
"buf = %s
\n
"
,
wine_dbgstr_w
(
buf
));
memset
(
buf
,
0
,
sizeof
(
buf
));
ret
=
_vswprintf_l_wrapper
(
buf
,
format
,
NULL
,
number
,
123
);
ok
(
ret
==
10
,
"got %d, expected 10
\n
"
,
ret
);
ok
(
!
memcmp
(
buf
,
out
,
sizeof
(
out
)),
"buf = %s
\n
"
,
wine_dbgstr_w
(
buf
));
memset
(
buf
,
0
,
sizeof
(
buf
));
ret
=
_vswprintf_c_wrapper
(
buf
,
20
,
format
,
number
,
123
);
ok
(
ret
==
10
,
"got %d, expected 10
\n
"
,
ret
);
ok
(
!
memcmp
(
buf
,
out
,
sizeof
(
out
)),
"buf = %s
\n
"
,
wine_dbgstr_w
(
buf
));
memset
(
buf
,
0
,
sizeof
(
buf
));
ret
=
_vswprintf_c_l_wrapper
(
buf
,
20
,
format
,
NULL
,
number
,
123
);
ok
(
ret
==
10
,
"got %d, expected 10
\n
"
,
ret
);
ok
(
!
memcmp
(
buf
,
out
,
sizeof
(
out
)),
"buf = %s
\n
"
,
wine_dbgstr_w
(
buf
));
memset
(
buf
,
0
,
sizeof
(
buf
));
ret
=
_vswprintf_p_l_wrapper
(
buf
,
20
,
format
,
NULL
,
number
,
123
);
ok
(
ret
==
10
,
"got %d, expected 10
\n
"
,
ret
);
ok
(
!
memcmp
(
buf
,
out
,
sizeof
(
out
)),
"buf = %s
\n
"
,
wine_dbgstr_w
(
buf
));
}
static
int
__cdecl
_vscprintf_wrapper
(
const
char
*
format
,
...)
static
int
__cdecl
_vscprintf_wrapper
(
const
char
*
format
,
...)
{
{
int
ret
;
int
ret
;
...
@@ -1120,6 +1242,7 @@ START_TEST(printf)
...
@@ -1120,6 +1242,7 @@ START_TEST(printf)
test_vsnwprintf
();
test_vsnwprintf
();
test_vscprintf
();
test_vscprintf
();
test_vscwprintf
();
test_vscwprintf
();
test_vswprintf
();
test_vsnwprintf_s
();
test_vsnwprintf_s
();
test_vsprintf_p
();
test_vsprintf_p
();
test__get_output_format
();
test__get_output_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