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
aa827393
Commit
aa827393
authored
Dec 03, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Forward string calls to kernelbase.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
331947c9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
346 deletions
+24
-346
Makefile.in
dlls/user32/Makefile.in
+1
-1
lstr.c
dlls/user32/lstr.c
+0
-321
resource.c
dlls/user32/resource.c
+1
-2
user32.spec
dlls/user32/user32.spec
+22
-22
No files found.
dlls/user32/Makefile.in
View file @
aa827393
EXTRADEFS
=
-D_USER32_
-D_WINABLE_
MODULE
=
user32.dll
IMPORTLIB
=
user32
IMPORTS
=
gdi32 version advapi32
IMPORTS
=
gdi32 version advapi32
kernelbase
EXTRAINCL
=
$(PNG_CFLAGS)
DELAYIMPORTS
=
hid imm32 setupapi usp10
...
...
dlls/user32/lstr.c
View file @
aa827393
...
...
@@ -39,28 +39,6 @@
/***********************************************************************
* CharNextA (USER32.@)
*/
LPSTR
WINAPI
CharNextA
(
LPCSTR
ptr
)
{
if
(
!*
ptr
)
return
(
LPSTR
)
ptr
;
if
(
IsDBCSLeadByte
(
ptr
[
0
]
)
&&
ptr
[
1
])
return
(
LPSTR
)(
ptr
+
2
);
return
(
LPSTR
)(
ptr
+
1
);
}
/***********************************************************************
* CharNextExA (USER32.@)
*/
LPSTR
WINAPI
CharNextExA
(
WORD
codepage
,
LPCSTR
ptr
,
DWORD
flags
)
{
if
(
!*
ptr
)
return
(
LPSTR
)
ptr
;
if
(
IsDBCSLeadByteEx
(
codepage
,
ptr
[
0
]
)
&&
ptr
[
1
])
return
(
LPSTR
)(
ptr
+
2
);
return
(
LPSTR
)(
ptr
+
1
);
}
/***********************************************************************
* CharNextExW (USER32.@)
*/
LPWSTR
WINAPI
CharNextExW
(
WORD
codepage
,
LPCWSTR
ptr
,
DWORD
flags
)
...
...
@@ -71,47 +49,6 @@ LPWSTR WINAPI CharNextExW( WORD codepage, LPCWSTR ptr, DWORD flags )
/***********************************************************************
* CharNextW (USER32.@)
*/
LPWSTR
WINAPI
CharNextW
(
LPCWSTR
x
)
{
if
(
*
x
)
x
++
;
return
(
LPWSTR
)
x
;
}
/***********************************************************************
* CharPrevA (USER32.@)
*/
LPSTR
WINAPI
CharPrevA
(
LPCSTR
start
,
LPCSTR
ptr
)
{
while
(
*
start
&&
(
start
<
ptr
))
{
LPCSTR
next
=
CharNextA
(
start
);
if
(
next
>=
ptr
)
break
;
start
=
next
;
}
return
(
LPSTR
)
start
;
}
/***********************************************************************
* CharPrevExA (USER32.@)
*/
LPSTR
WINAPI
CharPrevExA
(
WORD
codepage
,
LPCSTR
start
,
LPCSTR
ptr
,
DWORD
flags
)
{
while
(
*
start
&&
(
start
<
ptr
))
{
LPCSTR
next
=
CharNextExA
(
codepage
,
start
,
flags
);
if
(
next
>=
ptr
)
break
;
start
=
next
;
}
return
(
LPSTR
)
start
;
}
/***********************************************************************
* CharPrevExW (USER32.@)
*/
LPSTR
WINAPI
CharPrevExW
(
WORD
codepage
,
LPCWSTR
start
,
LPCWSTR
ptr
,
DWORD
flags
)
...
...
@@ -122,16 +59,6 @@ LPSTR WINAPI CharPrevExW( WORD codepage, LPCWSTR start, LPCWSTR ptr, DWORD flags
/***********************************************************************
* CharPrevW (USER32.@)
*/
LPWSTR
WINAPI
CharPrevW
(
LPCWSTR
start
,
LPCWSTR
x
)
{
if
(
x
>
start
)
return
(
LPWSTR
)(
x
-
1
);
else
return
(
LPWSTR
)
x
;
}
/***********************************************************************
* CharToOemA (USER32.@)
*/
BOOL
WINAPI
CharToOemA
(
LPCSTR
s
,
LPSTR
d
)
...
...
@@ -231,251 +158,3 @@ BOOL WINAPI OemToCharW( LPCSTR s, LPWSTR d )
if
(
!
s
||
!
d
)
return
FALSE
;
return
OemToCharBuffW
(
s
,
d
,
strlen
(
s
)
+
1
);
}
/***********************************************************************
* CharLowerA (USER32.@)
*/
LPSTR
WINAPI
CharLowerA
(
LPSTR
str
)
{
if
(
IS_INTRESOURCE
(
str
))
{
char
ch
=
LOWORD
(
str
);
CharLowerBuffA
(
&
ch
,
1
);
return
(
LPSTR
)(
UINT_PTR
)(
BYTE
)
ch
;
}
__TRY
{
CharLowerBuffA
(
str
,
strlen
(
str
)
);
}
__EXCEPT_PAGE_FAULT
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
NULL
;
}
__ENDTRY
return
str
;
}
/***********************************************************************
* CharUpperA (USER32.@)
*/
LPSTR
WINAPI
CharUpperA
(
LPSTR
str
)
{
if
(
IS_INTRESOURCE
(
str
))
{
char
ch
=
LOWORD
(
str
);
CharUpperBuffA
(
&
ch
,
1
);
return
(
LPSTR
)(
UINT_PTR
)(
BYTE
)
ch
;
}
__TRY
{
CharUpperBuffA
(
str
,
strlen
(
str
)
);
}
__EXCEPT_PAGE_FAULT
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
NULL
;
}
__ENDTRY
return
str
;
}
/***********************************************************************
* CharLowerW (USER32.@)
*/
LPWSTR
WINAPI
CharLowerW
(
LPWSTR
str
)
{
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
str
)
{
if
(
!
IS_INTRESOURCE
(
str
))
{
CharUpperBuffW
(
str
,
lstrlenW
(
str
));
return
str
;
}
else
{
WCHAR
ch
=
LOWORD
(
str
);
CharUpperBuffW
(
&
ch
,
1
);
return
(
LPWSTR
)(
UINT_PTR
)
ch
;
}
}
/***********************************************************************
* CharLowerBuffA (USER32.@)
*/
DWORD
WINAPI
CharLowerBuffA
(
LPSTR
str
,
DWORD
len
)
{
DWORD
lenW
;
WCHAR
buffer
[
32
];
WCHAR
*
strW
=
buffer
;
if
(
!
str
)
return
0
;
/* YES */
lenW
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
len
,
NULL
,
0
);
if
(
lenW
>
ARRAY_SIZE
(
buffer
))
{
strW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lenW
*
sizeof
(
WCHAR
));
if
(
!
strW
)
return
0
;
}
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
len
,
strW
,
lenW
);
CharLowerBuffW
(
strW
,
lenW
);
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
strW
,
lenW
,
str
,
len
,
NULL
,
NULL
);
if
(
strW
!=
buffer
)
HeapFree
(
GetProcessHeap
(),
0
,
strW
);
return
len
;
}
/***********************************************************************
* CharLowerBuffW (USER32.@)
*/
DWORD
WINAPI
CharLowerBuffW
(
LPWSTR
str
,
DWORD
len
)
{
if
(
!
str
)
return
0
;
/* YES */
return
LCMapStringW
(
LOCALE_USER_DEFAULT
,
LCMAP_LOWERCASE
,
str
,
len
,
str
,
len
);
}
/***********************************************************************
* CharUpperBuffA (USER32.@)
*/
DWORD
WINAPI
CharUpperBuffA
(
LPSTR
str
,
DWORD
len
)
{
DWORD
lenW
;
WCHAR
buffer
[
32
];
WCHAR
*
strW
=
buffer
;
if
(
!
str
)
return
0
;
/* YES */
lenW
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
len
,
NULL
,
0
);
if
(
lenW
>
ARRAY_SIZE
(
buffer
))
{
strW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
lenW
*
sizeof
(
WCHAR
));
if
(
!
strW
)
return
0
;
}
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
len
,
strW
,
lenW
);
CharUpperBuffW
(
strW
,
lenW
);
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
strW
,
lenW
,
str
,
len
,
NULL
,
NULL
);
if
(
strW
!=
buffer
)
HeapFree
(
GetProcessHeap
(),
0
,
strW
);
return
len
;
}
/***********************************************************************
* CharUpperBuffW (USER32.@)
*/
DWORD
WINAPI
CharUpperBuffW
(
LPWSTR
str
,
DWORD
len
)
{
if
(
!
str
)
return
0
;
/* YES */
return
LCMapStringW
(
LOCALE_USER_DEFAULT
,
LCMAP_UPPERCASE
,
str
,
len
,
str
,
len
);
}
/***********************************************************************
* IsCharLower (USER.436)
* IsCharLowerA (USER32.@)
*/
BOOL
WINAPI
IsCharLowerA
(
CHAR
x
)
{
WCHAR
wch
;
MultiByteToWideChar
(
CP_ACP
,
0
,
&
x
,
1
,
&
wch
,
1
);
return
IsCharLowerW
(
wch
);
}
/***********************************************************************
* IsCharLowerW (USER32.@)
*/
BOOL
WINAPI
IsCharLowerW
(
WCHAR
ch
)
{
WORD
type
;
return
GetStringTypeW
(
CT_CTYPE1
,
&
ch
,
1
,
&
type
)
&&
(
type
&
C1_LOWER
);
}
/***********************************************************************
* IsCharUpper (USER.435)
* IsCharUpperA (USER32.@)
*/
BOOL
WINAPI
IsCharUpperA
(
CHAR
x
)
{
WCHAR
wch
;
MultiByteToWideChar
(
CP_ACP
,
0
,
&
x
,
1
,
&
wch
,
1
);
return
IsCharUpperW
(
wch
);
}
/***********************************************************************
* IsCharUpperW (USER32.@)
*/
BOOL
WINAPI
IsCharUpperW
(
WCHAR
ch
)
{
WORD
type
;
return
GetStringTypeW
(
CT_CTYPE1
,
&
ch
,
1
,
&
type
)
&&
(
type
&
C1_UPPER
);
}
/***********************************************************************
* IsCharAlphaNumeric (USER.434)
* IsCharAlphaNumericA (USER32.@)
*/
BOOL
WINAPI
IsCharAlphaNumericA
(
CHAR
x
)
{
WCHAR
wch
;
MultiByteToWideChar
(
CP_ACP
,
0
,
&
x
,
1
,
&
wch
,
1
);
return
IsCharAlphaNumericW
(
wch
);
}
/***********************************************************************
* IsCharAlphaNumericW (USER32.@)
*/
BOOL
WINAPI
IsCharAlphaNumericW
(
WCHAR
ch
)
{
WORD
type
;
return
GetStringTypeW
(
CT_CTYPE1
,
&
ch
,
1
,
&
type
)
&&
(
type
&
(
C1_ALPHA
|
C1_DIGIT
));
}
/***********************************************************************
* IsCharAlpha (USER.433)
* IsCharAlphaA (USER32.@)
*/
BOOL
WINAPI
IsCharAlphaA
(
CHAR
x
)
{
WCHAR
wch
;
MultiByteToWideChar
(
CP_ACP
,
0
,
&
x
,
1
,
&
wch
,
1
);
return
IsCharAlphaW
(
wch
);
}
/***********************************************************************
* IsCharAlphaW (USER32.@)
*/
BOOL
WINAPI
IsCharAlphaW
(
WCHAR
ch
)
{
WORD
type
;
return
GetStringTypeW
(
CT_CTYPE1
,
&
ch
,
1
,
&
type
)
&&
(
type
&
C1_ALPHA
);
}
dlls/user32/resource.c
View file @
aa827393
...
...
@@ -312,8 +312,7 @@ INT WINAPI DECLSPEC_HOTPATCH LoadStringA( HINSTANCE instance, UINT resource_id,
while
(
id
--
)
p
+=
*
p
+
1
;
if
(
buflen
!=
1
)
RtlUnicodeToMultiByteN
(
buffer
,
buflen
-
1
,
&
retval
,
p
+
1
,
*
p
*
sizeof
(
WCHAR
)
);
RtlUnicodeToMultiByteN
(
buffer
,
buflen
-
1
,
&
retval
,
p
+
1
,
*
p
*
sizeof
(
WCHAR
)
);
}
buffer
[
retval
]
=
0
;
TRACE
(
"returning %s
\n
"
,
debugstr_a
(
buffer
));
...
...
dlls/user32/user32.spec
View file @
aa827393
...
...
@@ -42,26 +42,26 @@
@ stdcall ChangeMenuW(long long ptr long long)
@ stdcall ChangeWindowMessageFilter(long long)
@ stdcall ChangeWindowMessageFilterEx(long long long ptr)
@ stdcall CharLowerA(str)
@ stdcall CharLowerBuffA(str long)
@ stdcall CharLowerBuffW(wstr long)
@ stdcall CharLowerW(wstr)
@ stdcall CharNextA(str)
@ stdcall CharNextExA(long str long)
@ stdcall
-import
CharLowerA(str)
@ stdcall
-import
CharLowerBuffA(str long)
@ stdcall
-import
CharLowerBuffW(wstr long)
@ stdcall
-import
CharLowerW(wstr)
@ stdcall
-import
CharNextA(str)
@ stdcall
-import
CharNextExA(long str long)
@ stdcall CharNextExW(long wstr long)
@ stdcall CharNextW(wstr)
@ stdcall CharPrevA(str str)
@ stdcall CharPrevExA(long str str long)
@ stdcall
-import
CharNextW(wstr)
@ stdcall
-import
CharPrevA(str str)
@ stdcall
-import
CharPrevExA(long str str long)
@ stdcall CharPrevExW(long wstr wstr long)
@ stdcall CharPrevW(wstr wstr)
@ stdcall
-import
CharPrevW(wstr wstr)
@ stdcall CharToOemA(str ptr)
@ stdcall CharToOemBuffA(str ptr long)
@ stdcall CharToOemBuffW(wstr ptr long)
@ stdcall CharToOemW(wstr ptr)
@ stdcall CharUpperA(str)
@ stdcall CharUpperBuffA(str long)
@ stdcall CharUpperBuffW(wstr long)
@ stdcall CharUpperW(wstr)
@ stdcall
-import
CharUpperA(str)
@ stdcall
-import
CharUpperBuffA(str long)
@ stdcall
-import
CharUpperBuffW(wstr long)
@ stdcall
-import
CharUpperW(wstr)
@ stdcall CheckDlgButton(long long long)
@ stdcall CheckMenuItem(long long long)
@ stdcall CheckMenuRadioItem(long long long long long)
...
...
@@ -449,14 +449,14 @@
@ stdcall InvalidateRect(long ptr long)
@ stdcall InvalidateRgn(long long long)
@ stdcall InvertRect(long ptr)
@ stdcall IsCharAlphaA(long)
@ stdcall IsCharAlphaNumericA(long)
@ stdcall IsCharAlphaNumericW(long)
@ stdcall IsCharAlphaW(long)
@ stdcall IsCharLowerA(long)
@ stdcall IsCharLowerW(long)
@ stdcall IsCharUpperA(long)
@ stdcall IsCharUpperW(long)
@ stdcall
-import
IsCharAlphaA(long)
@ stdcall
-import
IsCharAlphaNumericA(long)
@ stdcall
-import
IsCharAlphaNumericW(long)
@ stdcall
-import
IsCharAlphaW(long)
@ stdcall
-import
IsCharLowerA(long)
@ stdcall
-import
IsCharLowerW(long)
@ stdcall
-import
IsCharUpperA(long)
@ stdcall
-import
IsCharUpperW(long)
@ stdcall IsChild(long long)
@ stdcall IsClipboardFormatAvailable(long)
@ stdcall IsDialogMessage(long ptr) IsDialogMessageA
...
...
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