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
093f6cbb
Commit
093f6cbb
authored
May 16, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Move get_language_sort() to avoid forward declarations.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
05676e83
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
43 deletions
+43
-43
locale.c
dlls/kernelbase/locale.c
+43
-43
No files found.
dlls/kernelbase/locale.c
View file @
093f6cbb
...
...
@@ -439,49 +439,6 @@ static const struct sortguid *find_sortguid( const GUID *guid )
}
static
const
struct
sortguid
*
get_language_sort
(
const
WCHAR
*
locale
)
{
WCHAR
*
p
,
*
end
,
buffer
[
LOCALE_NAME_MAX_LENGTH
],
guidstr
[
39
];
const
struct
sortguid
*
ret
;
UNICODE_STRING
str
;
GUID
guid
;
HKEY
key
=
0
;
DWORD
size
,
type
;
if
(
locale
==
LOCALE_NAME_USER_DEFAULT
)
{
if
(
current_locale_sort
)
return
current_locale_sort
;
GetUserDefaultLocaleName
(
buffer
,
ARRAY_SIZE
(
buffer
));
}
else
lstrcpynW
(
buffer
,
locale
,
LOCALE_NAME_MAX_LENGTH
);
if
(
buffer
[
0
]
&&
!
RegOpenKeyExW
(
nls_key
,
L"Sorting
\\
Ids"
,
0
,
KEY_READ
,
&
key
))
{
for
(;;)
{
size
=
sizeof
(
guidstr
);
if
(
!
RegQueryValueExW
(
key
,
buffer
,
NULL
,
&
type
,
(
BYTE
*
)
guidstr
,
&
size
)
&&
type
==
REG_SZ
)
{
RtlInitUnicodeString
(
&
str
,
guidstr
);
if
(
!
RtlGUIDFromString
(
&
str
,
&
guid
))
{
ret
=
find_sortguid
(
&
guid
);
goto
done
;
}
break
;
}
for
(
p
=
end
=
buffer
;
*
p
;
p
++
)
if
(
*
p
==
'-'
||
*
p
==
'_'
)
end
=
p
;
if
(
end
==
buffer
)
break
;
*
end
=
0
;
}
}
ret
=
find_sortguid
(
&
default_sort_guid
);
done:
RegCloseKey
(
key
);
return
ret
;
}
static
const
NLS_LOCALE_DATA
*
get_locale_data
(
UINT
idx
)
{
ULONG
offset
=
locale_table
->
locales_offset
+
idx
*
locale_table
->
locale_size
;
...
...
@@ -593,6 +550,49 @@ static const NLS_LOCALE_DATA *get_locale_by_name( const WCHAR *name, LCID *lcid
}
static
const
struct
sortguid
*
get_language_sort
(
const
WCHAR
*
locale
)
{
WCHAR
*
p
,
*
end
,
buffer
[
LOCALE_NAME_MAX_LENGTH
],
guidstr
[
39
];
const
struct
sortguid
*
ret
;
UNICODE_STRING
str
;
GUID
guid
;
HKEY
key
=
0
;
DWORD
size
,
type
;
if
(
locale
==
LOCALE_NAME_USER_DEFAULT
)
{
if
(
current_locale_sort
)
return
current_locale_sort
;
GetUserDefaultLocaleName
(
buffer
,
ARRAY_SIZE
(
buffer
));
}
else
lstrcpynW
(
buffer
,
locale
,
LOCALE_NAME_MAX_LENGTH
);
if
(
buffer
[
0
]
&&
!
RegOpenKeyExW
(
nls_key
,
L"Sorting
\\
Ids"
,
0
,
KEY_READ
,
&
key
))
{
for
(;;)
{
size
=
sizeof
(
guidstr
);
if
(
!
RegQueryValueExW
(
key
,
buffer
,
NULL
,
&
type
,
(
BYTE
*
)
guidstr
,
&
size
)
&&
type
==
REG_SZ
)
{
RtlInitUnicodeString
(
&
str
,
guidstr
);
if
(
!
RtlGUIDFromString
(
&
str
,
&
guid
))
{
ret
=
find_sortguid
(
&
guid
);
goto
done
;
}
break
;
}
for
(
p
=
end
=
buffer
;
*
p
;
p
++
)
if
(
*
p
==
'-'
||
*
p
==
'_'
)
end
=
p
;
if
(
end
==
buffer
)
break
;
*
end
=
0
;
}
}
ret
=
find_sortguid
(
&
default_sort_guid
);
done:
RegCloseKey
(
key
);
return
ret
;
}
/******************************************************************************
* NlsValidateLocale (kernelbase.@)
*
...
...
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