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
0e234f3c
Commit
0e234f3c
authored
Jul 20, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Partial CompareStringEx implementation.
parent
31fc6814
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
9 deletions
+24
-9
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-0
locale.c
dlls/kernel32/locale.c
+22
-9
winnls.h
include/winnls.h
+1
-0
No files found.
dlls/kernel32/kernel32.spec
View file @
0e234f3c
...
...
@@ -200,6 +200,7 @@
@ stdcall CompareFileTime(ptr ptr)
@ stdcall CompareStringA(long long str long str long)
@ stdcall CompareStringW(long long wstr long wstr long)
@ stdcall CompareStringEx(wstr long wstr long wstr long ptr ptr long)
@ stdcall ConnectNamedPipe(long ptr)
@ stub ConsoleMenuControl
@ stub ConsoleSubst
...
...
dlls/kernel32/locale.c
View file @
0e234f3c
...
...
@@ -2865,18 +2865,31 @@ INT WINAPI FoldStringW(DWORD dwFlags, LPCWSTR src, INT srclen,
*
* See CompareStringA.
*/
INT
WINAPI
CompareStringW
(
LCID
lcid
,
DWORD
style
,
INT
WINAPI
CompareStringW
(
LCID
lcid
,
DWORD
flags
,
LPCWSTR
str1
,
INT
len1
,
LPCWSTR
str2
,
INT
len2
)
{
return
CompareStringEx
(
NULL
,
flags
,
str1
,
len1
,
str2
,
len2
,
NULL
,
NULL
,
0
);
}
/******************************************************************************
* CompareStringEx (KERNEL32.@)
*/
INT
WINAPI
CompareStringEx
(
LPCWSTR
locale
,
DWORD
flags
,
LPCWSTR
str1
,
INT
len1
,
LPCWSTR
str2
,
INT
len2
,
LPNLSVERSIONINFO
version
,
LPVOID
reserved
,
LPARAM
lParam
)
{
INT
ret
;
if
(
version
)
FIXME
(
"unexpected version parameter
\n
"
);
if
(
reserved
)
FIXME
(
"unexpected reserved value
\n
"
);
if
(
lParam
)
FIXME
(
"unexpected lParam
\n
"
);
if
(
!
str1
||
!
str2
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
if
(
style
&
~
(
NORM_IGNORECASE
|
NORM_IGNORENONSPACE
|
NORM_IGNORESYMBOLS
|
if
(
flags
&
~
(
NORM_IGNORECASE
|
NORM_IGNORENONSPACE
|
NORM_IGNORESYMBOLS
|
SORT_STRINGSORT
|
NORM_IGNOREKANATYPE
|
NORM_IGNOREWIDTH
|
LOCALE_USE_CP_ACP
|
0x10000000
)
)
{
SetLastError
(
ERROR_INVALID_FLAGS
);
...
...
@@ -2884,13 +2897,13 @@ INT WINAPI CompareStringW(LCID lcid, DWORD style,
}
/* this style is related to diacritics in Arabic, Japanese, and Hebrew */
if
(
style
&
0x10000000
)
WARN
(
"Ignoring unknown
style
0x10000000
\n
"
);
if
(
flags
&
0x10000000
)
WARN
(
"Ignoring unknown
flags
0x10000000
\n
"
);
if
(
len1
<
0
)
len1
=
strlenW
(
str1
);
if
(
len2
<
0
)
len2
=
strlenW
(
str2
);
ret
=
wine_compare_string
(
style
,
str1
,
len1
,
str2
,
len2
);
ret
=
wine_compare_string
(
flags
,
str1
,
len1
,
str2
,
len2
);
if
(
ret
)
/* need to translate result */
return
(
ret
<
0
)
?
CSTR_LESS_THAN
:
CSTR_GREATER_THAN
;
...
...
@@ -2904,7 +2917,7 @@ INT WINAPI CompareStringW(LCID lcid, DWORD style,
*
* PARAMS
* lcid [I] LCID for the comparison
*
style
[I] Flags for the comparison (NORM_ constants from "winnls.h").
*
flags
[I] Flags for the comparison (NORM_ constants from "winnls.h").
* str1 [I] First string to compare
* len1 [I] Length of str1, or -1 if str1 is NUL terminated
* str2 [I] Second string to compare
...
...
@@ -2915,7 +2928,7 @@ INT WINAPI CompareStringW(LCID lcid, DWORD style,
* str1 is less than, equal to or greater than str2 respectively.
* Failure: FALSE. Use GetLastError() to determine the cause.
*/
INT
WINAPI
CompareStringA
(
LCID
lcid
,
DWORD
style
,
INT
WINAPI
CompareStringA
(
LCID
lcid
,
DWORD
flags
,
LPCSTR
str1
,
INT
len1
,
LPCSTR
str2
,
INT
len2
)
{
WCHAR
*
buf1W
=
NtCurrentTeb
()
->
StaticUnicodeBuffer
;
...
...
@@ -2932,7 +2945,7 @@ INT WINAPI CompareStringA(LCID lcid, DWORD style,
if
(
len1
<
0
)
len1
=
strlen
(
str1
);
if
(
len2
<
0
)
len2
=
strlen
(
str2
);
if
(
!
(
style
&
LOCALE_USE_CP_ACP
))
locale_cp
=
get_lcid_codepage
(
lcid
);
if
(
!
(
flags
&
LOCALE_USE_CP_ACP
))
locale_cp
=
get_lcid_codepage
(
lcid
);
if
(
len1
)
{
...
...
@@ -2981,7 +2994,7 @@ INT WINAPI CompareStringA(LCID lcid, DWORD style,
str2W
=
buf2W
;
}
ret
=
CompareString
W
(
lcid
,
style
,
str1W
,
len1W
,
str2W
,
len2W
);
ret
=
CompareString
Ex
(
NULL
,
flags
,
str1W
,
len1W
,
str2W
,
len2W
,
NULL
,
NULL
,
0
);
if
(
str1W
!=
buf1W
)
HeapFree
(
GetProcessHeap
(),
0
,
str1W
);
if
(
str2W
!=
buf2W
)
HeapFree
(
GetProcessHeap
(),
0
,
str2W
);
...
...
include/winnls.h
View file @
0e234f3c
...
...
@@ -772,6 +772,7 @@ enum SYSGEOCLASS
WINBASEAPI
INT
WINAPI
CompareStringA
(
LCID
,
DWORD
,
LPCSTR
,
INT
,
LPCSTR
,
INT
);
WINBASEAPI
INT
WINAPI
CompareStringW
(
LCID
,
DWORD
,
LPCWSTR
,
INT
,
LPCWSTR
,
INT
);
#define CompareString WINELIB_NAME_AW(CompareString)
WINBASEAPI
INT
WINAPI
CompareStringEx
(
LPCWSTR
,
DWORD
,
LPCWSTR
,
INT
,
LPCWSTR
,
INT
,
LPNLSVERSIONINFO
,
LPVOID
,
LPARAM
);
WINBASEAPI
LCID
WINAPI
ConvertDefaultLocale
(
LCID
);
WINBASEAPI
BOOL
WINAPI
EnumCalendarInfoA
(
CALINFO_ENUMPROCA
,
LCID
,
CALID
,
CALTYPE
);
WINBASEAPI
BOOL
WINAPI
EnumCalendarInfoW
(
CALINFO_ENUMPROCW
,
LCID
,
CALID
,
CALTYPE
);
...
...
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