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
b408b07e
Commit
b408b07e
authored
Mar 17, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Support the sortkey file in NtGetNlsSectionPtr().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
95aeb41c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
14 deletions
+31
-14
locale.c
dlls/ntdll/locale.c
+31
-14
No files found.
dlls/ntdll/locale.c
View file @
b408b07e
...
...
@@ -67,6 +67,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(nls);
enum
nls_section_type
{
NLS_SECTION_SORTKEYS
=
9
,
NLS_SECTION_CASEMAP
=
10
,
NLS_SECTION_CODEPAGE
=
11
,
NLS_SECTION_NORMALIZE
=
12
...
...
@@ -548,6 +549,9 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file )
{
'\\'
,
'R'
,
'e'
,
'g'
,
'i'
,
's'
,
't'
,
'r'
,
'y'
,
'\\'
,
'M'
,
'a'
,
'c'
,
'h'
,
'i'
,
'n'
,
'e'
,
'\\'
,
'S'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'S'
,
'e'
,
't'
,
'\\'
,
'C'
,
'o'
,
'n'
,
't'
,
'r'
,
'o'
,
'l'
,
'\\'
,
'N'
,
'l'
,
's'
,
'\\'
,
'%'
,
's'
,
0
};
static
const
WCHAR
sortdirW
[]
=
{
'C'
,
':'
,
'\\'
,
'w'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'g'
,
'l'
,
'o'
,
'b'
,
'a'
,
'l'
,
'i'
,
'z'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'\\'
,
's'
,
'o'
,
'r'
,
't'
,
'i'
,
'n'
,
'g'
,
'\\'
,
0
};
static
const
WCHAR
cpW
[]
=
{
'C'
,
'o'
,
'd'
,
'e'
,
'p'
,
'a'
,
'g'
,
'e'
,
0
};
static
const
WCHAR
normW
[]
=
{
'N'
,
'o'
,
'r'
,
'm'
,
'a'
,
'l'
,
'i'
,
'z'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
langW
[]
=
{
'L'
,
'a'
,
'n'
,
'g'
,
'u'
,
'a'
,
'g'
,
'e'
,
0
};
...
...
@@ -564,21 +568,26 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file )
static
const
WCHAR
normnfkcW
[]
=
{
'n'
,
'o'
,
'r'
,
'm'
,
'n'
,
'f'
,
'k'
,
'c'
,
'.'
,
'n'
,
'l'
,
's'
,
0
};
static
const
WCHAR
normnfkdW
[]
=
{
'n'
,
'o'
,
'r'
,
'm'
,
'n'
,
'f'
,
'k'
,
'd'
,
'.'
,
'n'
,
'l'
,
's'
,
0
};
static
const
WCHAR
normidnaW
[]
=
{
'n'
,
'o'
,
'r'
,
'm'
,
'i'
,
'd'
,
'n'
,
'a'
,
'.'
,
'n'
,
'l'
,
's'
,
0
};
static
const
WCHAR
sortkeysW
[]
=
{
's'
,
'o'
,
'r'
,
't'
,
'd'
,
'e'
,
'f'
,
'a'
,
'u'
,
'l'
,
't'
,
'.'
,
'n'
,
'l'
,
's'
,
0
};
DWORD
size
;
HANDLE
handle
;
NTSTATUS
status
;
NTSTATUS
status
=
STATUS_OBJECT_NAME_NOT_FOUND
;
IO_STATUS_BLOCK
io
;
OBJECT_ATTRIBUTES
attr
;
UNICODE_STRING
nameW
,
valueW
;
WCHAR
buffer
[
MAX_PATH
],
value
[
10
];
const
WCHAR
*
name
=
NULL
;
const
WCHAR
*
name
=
NULL
,
*
dir
=
system_dir
;
KEY_VALUE_PARTIAL_INFORMATION
*
info
;
/* get filename from registry */
switch
(
type
)
{
case
NLS_SECTION_SORTKEYS
:
if
(
id
)
return
STATUS_INVALID_PARAMETER_1
;
buffer
[
0
]
=
0
;
break
;
case
NLS_SECTION_CASEMAP
:
if
(
id
)
return
STATUS_UNSUCCESSFUL
;
sprintfW
(
buffer
,
keyfmtW
,
langW
);
...
...
@@ -595,25 +604,33 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file )
default:
return
STATUS_INVALID_PARAMETER_1
;
}
RtlInitUnicodeString
(
&
nameW
,
buffer
);
RtlInitUnicodeString
(
&
valueW
,
value
);
InitializeObjectAttributes
(
&
attr
,
&
nameW
,
0
,
0
,
NULL
);
if
(
!
(
status
=
NtOpenKey
(
&
handle
,
KEY_READ
,
&
attr
)))
if
(
buffer
[
0
])
{
info
=
(
KEY_VALUE_PARTIAL_INFORMATION
*
)
buffer
;
size
=
sizeof
(
buffer
)
-
sizeof
(
WCHAR
);
if
(
!
(
status
=
NtQueryValueKey
(
handle
,
&
valueW
,
KeyValuePartialInformation
,
info
,
size
,
&
size
)))
RtlInitUnicodeString
(
&
nameW
,
buffer
);
RtlInitUnicodeString
(
&
valueW
,
value
);
InitializeObjectAttributes
(
&
attr
,
&
nameW
,
0
,
0
,
NULL
);
if
(
!
(
status
=
NtOpenKey
(
&
handle
,
KEY_READ
,
&
attr
)))
{
((
WCHAR
*
)
info
->
Data
)[
info
->
DataLength
/
sizeof
(
WCHAR
)]
=
0
;
name
=
(
WCHAR
*
)
info
->
Data
;
info
=
(
KEY_VALUE_PARTIAL_INFORMATION
*
)
buffer
;
size
=
sizeof
(
buffer
)
-
sizeof
(
WCHAR
);
if
(
!
(
status
=
NtQueryValueKey
(
handle
,
&
valueW
,
KeyValuePartialInformation
,
info
,
size
,
&
size
)))
{
((
WCHAR
*
)
info
->
Data
)[
info
->
DataLength
/
sizeof
(
WCHAR
)]
=
0
;
name
=
(
WCHAR
*
)
info
->
Data
;
}
NtClose
(
handle
);
}
NtClose
(
handle
);
}
if
(
!
name
||
!*
name
)
/* otherwise some hardcoded defaults */
{
switch
(
type
)
{
case
NLS_SECTION_SORTKEYS
:
name
=
sortkeysW
;
dir
=
sortdirW
;
break
;
case
NLS_SECTION_CASEMAP
:
name
=
intlW
;
break
;
...
...
@@ -637,10 +654,10 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file )
/* try to open file in system dir */
valueW
.
MaximumLength
=
(
strlenW
(
name
)
+
strlenW
(
system_
dir
)
+
5
)
*
sizeof
(
WCHAR
);
valueW
.
MaximumLength
=
(
strlenW
(
name
)
+
strlenW
(
dir
)
+
5
)
*
sizeof
(
WCHAR
);
if
(
!
(
valueW
.
Buffer
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
valueW
.
MaximumLength
)))
return
STATUS_NO_MEMORY
;
valueW
.
Length
=
sprintfW
(
valueW
.
Buffer
,
pathfmtW
,
system_
dir
,
name
)
*
sizeof
(
WCHAR
);
valueW
.
Length
=
sprintfW
(
valueW
.
Buffer
,
pathfmtW
,
dir
,
name
)
*
sizeof
(
WCHAR
);
InitializeObjectAttributes
(
&
attr
,
&
valueW
,
0
,
0
,
NULL
);
status
=
NtOpenFile
(
file
,
GENERIC_READ
,
&
attr
,
&
io
,
FILE_SHARE_READ
,
FILE_SYNCHRONOUS_IO_ALERT
);
if
(
!
status
)
TRACE
(
"found %s
\n
"
,
debugstr_w
(
valueW
.
Buffer
));
...
...
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