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
ffa7ac73
Commit
ffa7ac73
authored
Oct 31, 2012
by
Daniel Lehman
Committed by
Alexandre Julliard
Nov 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Return value from MSVCRT____mb_cur_max_func instead of pointer.
parent
2cefbaab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
3 deletions
+55
-3
mbcs.c
dlls/msvcrt/mbcs.c
+10
-2
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
locale.c
dlls/msvcrt/tests/locale.c
+44
-0
No files found.
dlls/msvcrt/mbcs.c
View file @
ffa7ac73
...
...
@@ -174,13 +174,21 @@ unsigned char* CDECL __p__mbctype(void)
}
/*********************************************************************
* __
_mb_cur_max_func
(MSVCRT.@)
* __
p___mb_cur_max
(MSVCRT.@)
*/
int
*
CDECL
MSVCRT____mb_cur_max_func
(
void
)
int
*
CDECL
__p___mb_cur_max
(
void
)
{
return
&
get_locinfo
()
->
mb_cur_max
;
}
/*********************************************************************
* ___mb_cur_max_func(MSVCRT.@)
*/
int
CDECL
MSVCRT____mb_cur_max_func
(
void
)
{
return
get_locinfo
()
->
mb_cur_max
;
}
/* ___mb_cur_max_l_func - not exported in native msvcrt */
int
*
CDECL
___mb_cur_max_l_func
(
MSVCRT__locale_t
locale
)
{
...
...
dlls/msvcrt/msvcrt.spec
View file @
ffa7ac73
...
...
@@ -221,7 +221,7 @@
@ cdecl __p___argc()
@ cdecl __p___argv()
@ cdecl __p___initenv()
@ cdecl __p___mb_cur_max()
MSVCRT____mb_cur_max_func
@ cdecl __p___mb_cur_max()
@ cdecl __p___wargv()
@ cdecl __p___winitenv()
@ cdecl __p__acmdln()
...
...
dlls/msvcrt/tests/locale.c
View file @
ffa7ac73
...
...
@@ -25,6 +25,8 @@
static
BOOL
(
__cdecl
*
p__crtGetStringTypeW
)(
DWORD
,
DWORD
,
const
wchar_t
*
,
int
,
WORD
*
);
static
int
(
__cdecl
*
pmemcpy_s
)(
void
*
,
size_t
,
void
*
,
size_t
);
static
int
(
__cdecl
*
p___mb_cur_max_func
)(
void
);
static
int
*
(
__cdecl
*
p__p___mb_cur_max
)(
void
);
void
*
__cdecl
_Gettnames
(
void
);
static
void
init
(
void
)
...
...
@@ -33,6 +35,8 @@ static void init(void)
p__crtGetStringTypeW
=
(
void
*
)
GetProcAddress
(
hmod
,
"__crtGetStringTypeW"
);
pmemcpy_s
=
(
void
*
)
GetProcAddress
(
hmod
,
"memcpy_s"
);
p___mb_cur_max_func
=
(
void
*
)
GetProcAddress
(
hmod
,
"___mb_cur_max_func"
);
p__p___mb_cur_max
=
(
void
*
)
GetProcAddress
(
hmod
,
"__p___mb_cur_max"
);
}
static
void
test_setlocale
(
void
)
...
...
@@ -738,6 +742,45 @@ static void test__Gettnames(void)
setlocale
(
LC_ALL
,
"C"
);
}
static
void
test___mb_cur_max_func
(
void
)
{
int
mb_cur_max
;
/* for newer Windows */
if
(
!
p___mb_cur_max_func
)
win_skip
(
"Skipping ___mb_cur_max_func tests
\n
"
);
else
{
mb_cur_max
=
p___mb_cur_max_func
();
ok
(
mb_cur_max
==
1
,
"mb_cur_max = %d, expected 1
\n
"
,
mb_cur_max
);
/* some old Windows don't set chinese */
if
(
!
setlocale
(
LC_ALL
,
"chinese"
))
win_skip
(
"Skipping test with chinese locale
\n
"
);
else
{
mb_cur_max
=
p___mb_cur_max_func
();
ok
(
mb_cur_max
==
2
,
"mb_cur_max = %d, expected 2
\n
"
,
mb_cur_max
);
setlocale
(
LC_ALL
,
"C"
);
}
}
/* for older Windows */
if
(
!
p__p___mb_cur_max
)
win_skip
(
"Skipping __p___mb_cur_max tests
\n
"
);
else
{
mb_cur_max
=
*
p__p___mb_cur_max
();
ok
(
mb_cur_max
==
1
,
"mb_cur_max = %d, expected 1
\n
"
,
mb_cur_max
);
/* some old Windows don't set chinese */
if
(
!
setlocale
(
LC_ALL
,
"chinese"
))
win_skip
(
"Skipping test with chinese locale
\n
"
);
else
{
mb_cur_max
=
*
p__p___mb_cur_max
();
ok
(
mb_cur_max
==
2
,
"mb_cur_max = %d, expected 2
\n
"
,
mb_cur_max
);
setlocale
(
LC_ALL
,
"C"
);
}
}
}
START_TEST
(
locale
)
{
init
();
...
...
@@ -745,4 +788,5 @@ START_TEST(locale)
test_crtGetStringTypeW
();
test_setlocale
();
test__Gettnames
();
test___mb_cur_max_func
();
}
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