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
11fcc61b
Commit
11fcc61b
authored
Mar 29, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use kernel32 functions for character types and case conversions.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
88527341
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
22 deletions
+40
-22
lstr.c
dlls/user32/lstr.c
+40
-22
No files found.
dlls/user32/lstr.c
View file @
11fcc61b
...
...
@@ -31,11 +31,11 @@
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winuser.h"
#include "winerror.h"
#include "wine/exception.h"
#include "wine/unicode.h"
/***********************************************************************
...
...
@@ -175,7 +175,7 @@ BOOL WINAPI CharToOemBuffW( LPCWSTR s, LPSTR d, DWORD len )
*/
BOOL
WINAPI
CharToOemW
(
LPCWSTR
s
,
LPSTR
d
)
{
return
CharToOemBuffW
(
s
,
d
,
strlenW
(
s
)
+
1
);
return
CharToOemBuffW
(
s
,
d
,
l
strlenW
(
s
)
+
1
);
}
...
...
@@ -280,20 +280,38 @@ LPSTR WINAPI CharUpperA(LPSTR str)
/***********************************************************************
* CharLowerW (USER32.@)
*/
LPWSTR
WINAPI
CharLowerW
(
LPWSTR
x
)
LPWSTR
WINAPI
CharLowerW
(
LPWSTR
str
)
{
if
(
!
IS_INTRESOURCE
(
x
))
return
strlwrW
(
x
);
else
return
(
LPWSTR
)((
UINT_PTR
)
tolowerW
(
LOWORD
(
x
)));
if
(
!
IS_INTRESOURCE
(
str
))
{
CharLowerBuffW
(
str
,
lstrlenW
(
str
));
return
str
;
}
else
{
WCHAR
ch
=
LOWORD
(
str
);
CharLowerBuffW
(
&
ch
,
1
);
return
(
LPWSTR
)(
UINT_PTR
)
ch
;
}
}
/***********************************************************************
* CharUpperW (USER32.@)
*/
LPWSTR
WINAPI
CharUpperW
(
LPWSTR
x
)
LPWSTR
WINAPI
CharUpperW
(
LPWSTR
str
)
{
if
(
!
IS_INTRESOURCE
(
x
))
return
struprW
(
x
);
else
return
(
LPWSTR
)((
UINT_PTR
)
toupperW
(
LOWORD
(
x
)));
if
(
!
IS_INTRESOURCE
(
str
))
{
CharUpperBuffW
(
str
,
lstrlenW
(
str
));
return
str
;
}
else
{
WCHAR
ch
=
LOWORD
(
str
);
CharUpperBuffW
(
&
ch
,
1
);
return
(
LPWSTR
)(
UINT_PTR
)
ch
;
}
}
...
...
@@ -327,10 +345,8 @@ DWORD WINAPI CharLowerBuffA( LPSTR str, DWORD len )
*/
DWORD
WINAPI
CharLowerBuffW
(
LPWSTR
str
,
DWORD
len
)
{
DWORD
ret
=
len
;
if
(
!
str
)
return
0
;
/* YES */
for
(;
len
;
len
--
,
str
++
)
*
str
=
tolowerW
(
*
str
);
return
ret
;
return
LCMapStringW
(
LOCALE_USER_DEFAULT
,
LCMAP_LOWERCASE
,
str
,
len
,
str
,
len
);
}
...
...
@@ -364,10 +380,8 @@ DWORD WINAPI CharUpperBuffA( LPSTR str, DWORD len )
*/
DWORD
WINAPI
CharUpperBuffW
(
LPWSTR
str
,
DWORD
len
)
{
DWORD
ret
=
len
;
if
(
!
str
)
return
0
;
/* YES */
for
(;
len
;
len
--
,
str
++
)
*
str
=
toupperW
(
*
str
);
return
ret
;
return
LCMapStringW
(
LOCALE_USER_DEFAULT
,
LCMAP_UPPERCASE
,
str
,
len
,
str
,
len
);
}
...
...
@@ -386,9 +400,10 @@ BOOL WINAPI IsCharLowerA(CHAR x)
/***********************************************************************
* IsCharLowerW (USER32.@)
*/
BOOL
WINAPI
IsCharLowerW
(
WCHAR
x
)
BOOL
WINAPI
IsCharLowerW
(
WCHAR
ch
)
{
return
(
get_char_typeW
(
x
)
&
C1_LOWER
)
!=
0
;
WORD
type
;
return
GetStringTypeW
(
CT_CTYPE1
,
&
ch
,
1
,
&
type
)
&&
(
type
&
C1_LOWER
);
}
...
...
@@ -407,9 +422,10 @@ BOOL WINAPI IsCharUpperA(CHAR x)
/***********************************************************************
* IsCharUpperW (USER32.@)
*/
BOOL
WINAPI
IsCharUpperW
(
WCHAR
x
)
BOOL
WINAPI
IsCharUpperW
(
WCHAR
ch
)
{
return
(
get_char_typeW
(
x
)
&
C1_UPPER
)
!=
0
;
WORD
type
;
return
GetStringTypeW
(
CT_CTYPE1
,
&
ch
,
1
,
&
type
)
&&
(
type
&
C1_UPPER
);
}
...
...
@@ -428,9 +444,10 @@ BOOL WINAPI IsCharAlphaNumericA(CHAR x)
/***********************************************************************
* IsCharAlphaNumericW (USER32.@)
*/
BOOL
WINAPI
IsCharAlphaNumericW
(
WCHAR
x
)
BOOL
WINAPI
IsCharAlphaNumericW
(
WCHAR
ch
)
{
return
(
get_char_typeW
(
x
)
&
(
C1_ALPHA
|
C1_DIGIT
))
!=
0
;
WORD
type
;
return
GetStringTypeW
(
CT_CTYPE1
,
&
ch
,
1
,
&
type
)
&&
(
type
&
(
C1_ALPHA
|
C1_DIGIT
));
}
...
...
@@ -449,7 +466,8 @@ BOOL WINAPI IsCharAlphaA(CHAR x)
/***********************************************************************
* IsCharAlphaW (USER32.@)
*/
BOOL
WINAPI
IsCharAlphaW
(
WCHAR
x
)
BOOL
WINAPI
IsCharAlphaW
(
WCHAR
ch
)
{
return
(
get_char_typeW
(
x
)
&
C1_ALPHA
)
!=
0
;
WORD
type
;
return
GetStringTypeW
(
CT_CTYPE1
,
&
ch
,
1
,
&
type
)
&&
(
type
&
C1_ALPHA
);
}
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