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
e195a9b0
Commit
e195a9b0
authored
Mar 21, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for NtInitializeNlsFiles() and RtlGetLocaleFileMappingAddress().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c13d88ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
locale.c
dlls/kernel32/tests/locale.c
+54
-0
No files found.
dlls/kernel32/tests/locale.c
View file @
e195a9b0
...
...
@@ -94,6 +94,8 @@ static DWORD (WINAPI *pIsValidNLSVersion)(NLS_FUNCTION,LPCWSTR,NLSVERSIONINFOEX*
static
NTSTATUS
(
WINAPI
*
pRtlNormalizeString
)(
ULONG
,
LPCWSTR
,
INT
,
LPWSTR
,
INT
*
);
static
NTSTATUS
(
WINAPI
*
pRtlIsNormalizedString
)(
ULONG
,
LPCWSTR
,
INT
,
BOOLEAN
*
);
static
NTSTATUS
(
WINAPI
*
pNtGetNlsSectionPtr
)(
ULONG
,
ULONG
,
void
*
,
void
**
,
SIZE_T
*
);
static
NTSTATUS
(
WINAPI
*
pNtInitializeNlsFiles
)(
void
**
,
LCID
*
,
LARGE_INTEGER
*
);
static
NTSTATUS
(
WINAPI
*
pRtlGetLocaleFileMappingAddress
)(
void
**
,
LCID
*
,
LARGE_INTEGER
*
);
static
void
(
WINAPI
*
pRtlInitCodePageTable
)(
USHORT
*
,
CPTABLEINFO
*
);
static
NTSTATUS
(
WINAPI
*
pRtlCustomCPToUnicodeN
)(
CPTABLEINFO
*
,
WCHAR
*
,
DWORD
,
DWORD
*
,
const
char
*
,
DWORD
);
static
NTSTATUS
(
WINAPI
*
pRtlGetSystemPreferredUILanguages
)(
DWORD
,
ULONG
,
ULONG
*
,
WCHAR
*
,
ULONG
*
);
...
...
@@ -146,8 +148,10 @@ static void InitFunctionPointers(void)
X
(
RtlNormalizeString
);
X
(
RtlIsNormalizedString
);
X
(
NtGetNlsSectionPtr
);
X
(
NtInitializeNlsFiles
);
X
(
RtlInitCodePageTable
);
X
(
RtlCustomCPToUnicodeN
);
X
(
RtlGetLocaleFileMappingAddress
);
X
(
RtlGetSystemPreferredUILanguages
);
X
(
RtlGetThreadPreferredUILanguages
);
X
(
RtlGetUserPreferredUILanguages
);
...
...
@@ -6804,6 +6808,55 @@ static void test_NLSVersion(void)
else
win_skip
(
"IsValidNLSVersion not available
\n
"
);
}
static
void
test_locale_nls
(
void
)
{
NTSTATUS
status
;
void
*
addr
,
*
addr2
;
UINT
*
ptr
;
LCID
lcid
;
LARGE_INTEGER
size
;
if
(
!
pNtInitializeNlsFiles
||
!
pRtlGetLocaleFileMappingAddress
)
{
win_skip
(
"locale.nls functions not supported
\n
"
);
return
;
}
size
.
QuadPart
=
0xdeadbeef
;
status
=
pNtInitializeNlsFiles
(
&
addr
,
&
lcid
,
&
size
);
ok
(
!
status
,
"NtInitializeNlsFiles failed %lx
\n
"
,
status
);
trace
(
"locale %04lx size %I64x
\n
"
,
lcid
,
size
.
QuadPart
);
ptr
=
addr
;
ok
(
size
.
QuadPart
==
0xdeadbeef
||
size
.
QuadPart
==
ptr
[
4
]
||
size
.
QuadPart
==
ptr
[
4
]
+
8
,
"wrong offset %x / %I64x
\n
"
,
ptr
[
4
],
size
.
QuadPart
);
ptr
=
(
UINT
*
)((
char
*
)
addr
+
ptr
[
4
]);
ok
(
ptr
[
0
]
==
8
,
"wrong offset %u
\n
"
,
ptr
[
0
]
);
ok
(
ptr
[
3
]
==
0x5344534e
,
"wrong magic %x
\n
"
,
ptr
[
3
]
);
status
=
pNtInitializeNlsFiles
(
&
addr2
,
&
lcid
,
&
size
);
ok
(
!
status
,
"NtInitializeNlsFiles failed %lx
\n
"
,
status
);
ok
(
addr
!=
addr2
,
"got same address %p
\n
"
,
addr
);
ok
(
!
memcmp
(
addr
,
addr2
,
ptr
[
4
]
),
"contents differ
\n
"
);
status
=
NtUnmapViewOfSection
(
GetCurrentProcess
(),
addr
);
ok
(
!
status
,
"NtUnmapViewOfSection failed %lx
\n
"
,
status
);
status
=
NtUnmapViewOfSection
(
GetCurrentProcess
(),
addr2
);
ok
(
!
status
,
"NtUnmapViewOfSection failed %lx
\n
"
,
status
);
size
.
QuadPart
=
0xdeadbeef
;
status
=
pRtlGetLocaleFileMappingAddress
(
&
addr
,
&
lcid
,
&
size
);
ok
(
!
status
,
"NtInitializeNlsFiles failed %lx
\n
"
,
status
);
ptr
=
addr
;
ok
(
size
.
QuadPart
==
0xdeadbeef
||
size
.
QuadPart
==
ptr
[
4
]
||
size
.
QuadPart
==
ptr
[
4
]
+
8
,
"wrong offset %x / %I64x
\n
"
,
ptr
[
4
],
size
.
QuadPart
);
ptr
=
(
UINT
*
)((
char
*
)
addr
+
ptr
[
4
]);
ok
(
ptr
[
0
]
==
8
,
"wrong offset %u
\n
"
,
ptr
[
0
]
);
ok
(
ptr
[
3
]
==
0x5344534e
,
"wrong magic %x
\n
"
,
ptr
[
3
]
);
/* RtlGetLocaleFileMappingAddress caches the pointer */
status
=
pRtlGetLocaleFileMappingAddress
(
&
addr2
,
&
lcid
,
&
size
);
ok
(
!
status
,
"NtInitializeNlsFiles failed %lx
\n
"
,
status
);
ok
(
addr
==
addr2
,
"got different address %p / %p
\n
"
,
addr
,
addr2
);
}
static
void
test_geo_name
(
void
)
{
WCHAR
reg_name
[
32
],
buf
[
32
],
set_name
[
32
],
nation
[
32
],
region
[
32
];
...
...
@@ -7192,6 +7245,7 @@ START_TEST(locale)
test_NormalizeString
();
test_SpecialCasing
();
test_NLSVersion
();
test_locale_nls
();
test_geo_name
();
test_sorting
();
test_EnumCalendarInfoA
();
...
...
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