Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
0e234f3c
Commit
0e234f3c
authored
12 years ago
by
Nikolay Sivov
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
kernel32: Partial CompareStringEx implementation.
parent
31fc6814
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/kernel32/kernel32.spec
+1
-0
1 addition, 0 deletions
dlls/kernel32/kernel32.spec
dlls/kernel32/locale.c
+22
-9
22 additions, 9 deletions
dlls/kernel32/locale.c
include/winnls.h
+1
-0
1 addition, 0 deletions
include/winnls.h
with
24 additions
and
9 deletions
dlls/kernel32/kernel32.spec
+
1
−
0
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
...
...
This diff is collapsed.
Click to expand it.
dlls/kernel32/locale.c
+
22
−
9
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
);
...
...
This diff is collapsed.
Click to expand it.
include/winnls.h
+
1
−
0
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment