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
1e52895e
Commit
1e52895e
authored
Jun 07, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Implement IsNLSDefinedString().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
94f7f52d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
3 deletions
+97
-3
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-1
locale.c
dlls/kernel32/tests/locale.c
+52
-0
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+1
-1
locale.c
dlls/kernelbase/locale.c
+41
-0
winnls.h
include/winnls.h
+1
-0
nls.c
tools/winedump/nls.c
+1
-1
No files found.
dlls/kernel32/kernel32.spec
View file @
1e52895e
...
@@ -989,7 +989,7 @@
...
@@ -989,7 +989,7 @@
@ stdcall -import IsDBCSLeadByteEx(long long)
@ stdcall -import IsDBCSLeadByteEx(long long)
@ stdcall -import IsDebuggerPresent()
@ stdcall -import IsDebuggerPresent()
@ stub -i386 IsLSCallback
@ stub -i386 IsLSCallback
# @ stub IsNLSDefinedString
@ stdcall -import IsNLSDefinedString(long long ptr wstr long)
@ stdcall -import IsNormalizedString(long wstr long)
@ stdcall -import IsNormalizedString(long wstr long)
@ stdcall -import IsProcessInJob(long long ptr)
@ stdcall -import IsProcessInJob(long long ptr)
@ stdcall -import IsProcessorFeaturePresent(long)
@ stdcall -import IsProcessorFeaturePresent(long)
...
...
dlls/kernel32/tests/locale.c
View file @
1e52895e
...
@@ -95,6 +95,7 @@ static INT (WINAPI *pFindStringOrdinal)(DWORD, LPCWSTR lpStringSource, INT, LPCW
...
@@ -95,6 +95,7 @@ static INT (WINAPI *pFindStringOrdinal)(DWORD, LPCWSTR lpStringSource, INT, LPCW
static
BOOL
(
WINAPI
*
pGetNLSVersion
)(
NLS_FUNCTION
,
LCID
,
NLSVERSIONINFO
*
);
static
BOOL
(
WINAPI
*
pGetNLSVersion
)(
NLS_FUNCTION
,
LCID
,
NLSVERSIONINFO
*
);
static
BOOL
(
WINAPI
*
pGetNLSVersionEx
)(
NLS_FUNCTION
,
LPCWSTR
,
NLSVERSIONINFOEX
*
);
static
BOOL
(
WINAPI
*
pGetNLSVersionEx
)(
NLS_FUNCTION
,
LPCWSTR
,
NLSVERSIONINFOEX
*
);
static
DWORD
(
WINAPI
*
pIsValidNLSVersion
)(
NLS_FUNCTION
,
LPCWSTR
,
NLSVERSIONINFOEX
*
);
static
DWORD
(
WINAPI
*
pIsValidNLSVersion
)(
NLS_FUNCTION
,
LPCWSTR
,
NLSVERSIONINFOEX
*
);
static
BOOL
(
WINAPI
*
pIsNLSDefinedString
)(
NLS_FUNCTION
,
DWORD
,
NLSVERSIONINFO
*
,
const
WCHAR
*
,
int
);
static
NTSTATUS
(
WINAPI
*
pRtlNormalizeString
)(
ULONG
,
LPCWSTR
,
INT
,
LPWSTR
,
INT
*
);
static
NTSTATUS
(
WINAPI
*
pRtlNormalizeString
)(
ULONG
,
LPCWSTR
,
INT
,
LPWSTR
,
INT
*
);
static
NTSTATUS
(
WINAPI
*
pRtlIsNormalizedString
)(
ULONG
,
LPCWSTR
,
INT
,
BOOLEAN
*
);
static
NTSTATUS
(
WINAPI
*
pRtlIsNormalizedString
)(
ULONG
,
LPCWSTR
,
INT
,
BOOLEAN
*
);
static
NTSTATUS
(
WINAPI
*
pNtGetNlsSectionPtr
)(
ULONG
,
ULONG
,
void
*
,
void
**
,
SIZE_T
*
);
static
NTSTATUS
(
WINAPI
*
pNtGetNlsSectionPtr
)(
ULONG
,
ULONG
,
void
*
,
void
**
,
SIZE_T
*
);
...
@@ -146,6 +147,7 @@ static void InitFunctionPointers(void)
...
@@ -146,6 +147,7 @@ static void InitFunctionPointers(void)
X
(
GetNLSVersion
);
X
(
GetNLSVersion
);
X
(
GetNLSVersionEx
);
X
(
GetNLSVersionEx
);
X
(
IsValidNLSVersion
);
X
(
IsValidNLSVersion
);
X
(
IsNLSDefinedString
);
mod
=
GetModuleHandleA
(
"kernelbase"
);
mod
=
GetModuleHandleA
(
"kernelbase"
);
X
(
NlsValidateLocale
);
X
(
NlsValidateLocale
);
...
@@ -7750,6 +7752,56 @@ static void test_NLSVersion(void)
...
@@ -7750,6 +7752,56 @@ static void test_NLSVersion(void)
ok
(
GetLastError
()
==
0xdeadbeef
,
"wrong error %lu
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"wrong error %lu
\n
"
,
GetLastError
()
);
}
}
else
win_skip
(
"IsValidNLSVersion not available
\n
"
);
else
win_skip
(
"IsValidNLSVersion not available
\n
"
);
if
(
pIsNLSDefinedString
)
{
SetLastError
(
0xdeadbeef
);
info
.
dwNLSVersionInfoSize
=
sizeof
(
info
);
ret
=
pIsNLSDefinedString
(
COMPARE_STRING
,
0
,
(
NLSVERSIONINFO
*
)
&
info
,
L"A"
,
1
);
if
(
ret
)
ok
(
GetLastError
()
==
0xdeadbeef
,
"wrong error %lu
\n
"
,
GetLastError
()
);
else
ok
(
broken
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
),
/* win7 */
"wrong error %lu
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
info
.
dwNLSVersionInfoSize
=
sizeof
(
info
)
+
1
;
ret
=
pIsNLSDefinedString
(
COMPARE_STRING
,
0
,
(
NLSVERSIONINFO
*
)
&
info
,
L"A"
,
1
);
ok
(
!
ret
,
"IsNLSDefinedString succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"wrong error %lu
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
info
.
dwNLSVersionInfoSize
=
offsetof
(
NLSVERSIONINFO
,
dwEffectiveId
);
ret
=
pIsNLSDefinedString
(
COMPARE_STRING
,
0
,
(
NLSVERSIONINFO
*
)
&
info
,
L"A"
,
1
);
ok
(
ret
,
"IsNLSDefinedString failed err %lu
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"wrong error %lu
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pIsNLSDefinedString
(
2
,
0
,
(
NLSVERSIONINFO
*
)
&
info
,
L"A"
,
1
);
ok
(
!
ret
,
"IsNLSDefinedString succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_FLAGS
,
"wrong error %lu
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pIsNLSDefinedString
(
COMPARE_STRING
,
0
,
(
NLSVERSIONINFO
*
)
&
info
,
L"ABC"
,
-
10
);
ok
(
ret
,
"IsNLSDefinedString failed err %lu
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"wrong error %lu
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pIsNLSDefinedString
(
COMPARE_STRING
,
0
,
(
NLSVERSIONINFO
*
)
&
info
,
L"ABC"
,
-
1
);
ok
(
ret
,
"IsNLSDefinedString failed err %lu
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"wrong error %lu
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pIsNLSDefinedString
(
COMPARE_STRING
,
0
,
(
NLSVERSIONINFO
*
)
&
info
,
L"
\xd800
"
,
1
);
ok
(
!
ret
,
"IsNLSDefinedString failed err %lu
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"wrong error %lu
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
pIsNLSDefinedString
(
COMPARE_STRING
,
0
,
(
NLSVERSIONINFO
*
)
&
info
,
L"
\xd800
"
,
-
20
);
ok
(
!
ret
,
"IsNLSDefinedString failed err %lu
\n
"
,
GetLastError
()
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"wrong error %lu
\n
"
,
GetLastError
()
);
}
else
win_skip
(
"IsNLSDefinedString not available
\n
"
);
}
}
static
void
test_locale_nls
(
void
)
static
void
test_locale_nls
(
void
)
...
...
dlls/kernelbase/kernelbase.spec
View file @
1e52895e
...
@@ -892,7 +892,7 @@
...
@@ -892,7 +892,7 @@
# @ stub IsEnclaveTypeSupported
# @ stub IsEnclaveTypeSupported
# @ stub IsGlobalizationUserSettingsKeyRedirected
# @ stub IsGlobalizationUserSettingsKeyRedirected
@ stdcall IsInternetESCEnabled()
@ stdcall IsInternetESCEnabled()
@ st
ub IsNLSDefinedString
@ st
dcall IsNLSDefinedString(long long ptr wstr long)
@ stdcall IsNormalizedString(long wstr long)
@ stdcall IsNormalizedString(long wstr long)
# @ stub IsProcessCritical
# @ stub IsProcessCritical
@ stdcall IsProcessInJob(long long ptr)
@ stdcall IsProcessInJob(long long ptr)
...
...
dlls/kernelbase/locale.c
View file @
1e52895e
...
@@ -6431,6 +6431,47 @@ BOOL WINAPI DECLSPEC_HOTPATCH IsValidLocaleName( const WCHAR *locale )
...
@@ -6431,6 +6431,47 @@ BOOL WINAPI DECLSPEC_HOTPATCH IsValidLocaleName( const WCHAR *locale )
/******************************************************************************
/******************************************************************************
* IsNLSDefinedString (kernelbase.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
IsNLSDefinedString
(
NLS_FUNCTION
func
,
DWORD
flags
,
NLSVERSIONINFO
*
info
,
const
WCHAR
*
str
,
int
len
)
{
int
i
;
if
(
func
!=
COMPARE_STRING
)
{
SetLastError
(
ERROR_INVALID_FLAGS
);
return
FALSE
;
}
if
(
info
)
{
if
(
info
->
dwNLSVersionInfoSize
!=
sizeof
(
*
info
)
&&
(
info
->
dwNLSVersionInfoSize
!=
offsetof
(
NLSVERSIONINFO
,
dwEffectiveId
)))
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
FALSE
;
}
}
if
(
len
<
0
)
len
=
lstrlenW
(
str
)
+
1
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
is_private_use_area_char
(
str
[
i
]
))
return
FALSE
;
if
(
IS_LOW_SURROGATE
(
str
[
i
]
))
return
FALSE
;
if
(
IS_HIGH_SURROGATE
(
str
[
i
]
))
{
if
(
++
i
==
len
)
return
FALSE
;
if
(
!
IS_LOW_SURROGATE
(
str
[
i
]
))
return
FALSE
;
continue
;
}
if
(
!
(
get_char_type
(
CT_CTYPE1
,
str
[
i
]
)
&
C1_DEFINED
))
return
FALSE
;
}
return
TRUE
;
}
/******************************************************************************
* IsValidNLSVersion (kernelbase.@)
* IsValidNLSVersion (kernelbase.@)
*/
*/
DWORD
WINAPI
DECLSPEC_HOTPATCH
IsValidNLSVersion
(
NLS_FUNCTION
func
,
const
WCHAR
*
locale
,
DWORD
WINAPI
DECLSPEC_HOTPATCH
IsValidNLSVersion
(
NLS_FUNCTION
func
,
const
WCHAR
*
locale
,
...
...
include/winnls.h
View file @
1e52895e
...
@@ -964,6 +964,7 @@ WINNORMALIZEAPI INT WINAPI IdnToNameprepUnicode(DWORD,LPCWSTR,INT,LPWSTR,INT)
...
@@ -964,6 +964,7 @@ WINNORMALIZEAPI INT WINAPI IdnToNameprepUnicode(DWORD,LPCWSTR,INT,LPWSTR,INT)
WINNORMALIZEAPI
INT
WINAPI
IdnToUnicode
(
DWORD
,
LPCWSTR
,
INT
,
LPWSTR
,
INT
);
WINNORMALIZEAPI
INT
WINAPI
IdnToUnicode
(
DWORD
,
LPCWSTR
,
INT
,
LPWSTR
,
INT
);
WINBASEAPI
BOOL
WINAPI
IsDBCSLeadByte
(
BYTE
);
WINBASEAPI
BOOL
WINAPI
IsDBCSLeadByte
(
BYTE
);
WINBASEAPI
BOOL
WINAPI
IsDBCSLeadByteEx
(
UINT
,
BYTE
);
WINBASEAPI
BOOL
WINAPI
IsDBCSLeadByteEx
(
UINT
,
BYTE
);
WINBASEAPI
BOOL
WINAPI
IsNLSDefinedString
(
NLS_FUNCTION
,
DWORD
,
NLSVERSIONINFO
*
,
LPCWSTR
,
INT
);
WINNORMALIZEAPI
BOOL
WINAPI
IsNormalizedString
(
NORM_FORM
,
LPCWSTR
,
INT
);
WINNORMALIZEAPI
BOOL
WINAPI
IsNormalizedString
(
NORM_FORM
,
LPCWSTR
,
INT
);
WINBASEAPI
BOOL
WINAPI
IsValidCodePage
(
UINT
);
WINBASEAPI
BOOL
WINAPI
IsValidCodePage
(
UINT
);
WINBASEAPI
BOOL
WINAPI
IsValidLanguageGroup
(
LGRPID
,
DWORD
);
WINBASEAPI
BOOL
WINAPI
IsValidLanguageGroup
(
LGRPID
,
DWORD
);
...
...
tools/winedump/nls.c
View file @
1e52895e
...
@@ -110,7 +110,7 @@ struct ctype
...
@@ -110,7 +110,7 @@ struct ctype
static
const
char
*
get_ctype
(
const
struct
ctype
*
ctype
)
static
const
char
*
get_ctype
(
const
struct
ctype
*
ctype
)
{
{
static
char
buffer
[
100
];
static
char
buffer
[
100
];
static
const
char
*
c1
[]
=
{
"up "
,
"lo "
,
"dg "
,
"sp "
,
"pt "
,
"cl "
,
"bl "
,
"xd "
,
"al "
};
static
const
char
*
c1
[]
=
{
"up "
,
"lo "
,
"dg "
,
"sp "
,
"pt "
,
"cl "
,
"bl "
,
"xd "
,
"al "
,
"df "
};
static
const
char
*
c2
[]
=
{
" "
,
"L "
,
"R "
,
"EN"
,
"ES"
,
"ET"
,
static
const
char
*
c2
[]
=
{
" "
,
"L "
,
"R "
,
"EN"
,
"ES"
,
"ET"
,
"AN"
,
"CS"
,
"B "
,
"S "
,
"WS"
,
"ON"
};
"AN"
,
"CS"
,
"B "
,
"S "
,
"WS"
,
"ON"
};
static
const
char
*
c3
[]
=
{
"ns "
,
"di "
,
"vo "
,
"sy "
,
"ka "
,
"hi "
,
"hw "
,
"fw "
,
static
const
char
*
c3
[]
=
{
"ns "
,
"di "
,
"vo "
,
"sy "
,
"ka "
,
"hi "
,
"hw "
,
"fw "
,
...
...
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