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
d55233cc
Commit
d55233cc
authored
Mar 18, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mlang: Use EnumSystemLocalesEx() to enumerate locales.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2b963bf5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
27 deletions
+6
-27
mlang.c
dlls/mlang/mlang.c
+6
-27
No files found.
dlls/mlang/mlang.c
View file @
d55233cc
...
...
@@ -48,8 +48,6 @@ static HRESULT MultiLanguage_create(IUnknown *pUnkOuter, LPVOID *ppObj);
static
HRESULT
MLangConvertCharset_create
(
IUnknown
*
outer
,
void
**
obj
);
static
HRESULT
EnumRfc1766_create
(
LANGID
LangId
,
IEnumRfc1766
**
ppEnum
);
static
DWORD
MLANG_tls_index
;
/* to store various per thead data */
/* FIXME:
* Under what circumstances HKEY_CLASSES_ROOT\MIME\Database\Codepage and
* HKEY_CLASSES_ROOT\MIME\Database\Charset are used?
...
...
@@ -930,21 +928,6 @@ static void UnlockModule(void)
InterlockedDecrement
(
&
dll_count
);
}
BOOL
WINAPI
DllMain
(
HINSTANCE
hInstDLL
,
DWORD
fdwReason
,
LPVOID
lpv
)
{
switch
(
fdwReason
)
{
case
DLL_PROCESS_ATTACH
:
MLANG_tls_index
=
TlsAlloc
();
DisableThreadLibraryCalls
(
hInstDLL
);
break
;
case
DLL_PROCESS_DETACH
:
if
(
lpv
)
break
;
TlsFree
(
MLANG_tls_index
);
break
;
}
return
TRUE
;
}
HRESULT
WINAPI
ConvertINetMultiByteToUnicode
(
LPDWORD
pdwMode
,
DWORD
dwEncoding
,
...
...
@@ -2403,26 +2386,24 @@ struct enum_locales_data
DWORD
total
,
allocated
;
};
static
BOOL
CALLBACK
enum_locales_proc
(
LPWSTR
locale
)
static
BOOL
CALLBACK
enum_locales_proc
(
LPWSTR
locale
,
DWORD
flags
,
LPARAM
lparam
)
{
WCHAR
*
end
;
struct
enum_locales_data
*
data
=
TlsGetValue
(
MLANG_tls_index
);
struct
enum_locales_data
*
data
=
(
struct
enum_locales_data
*
)
lparam
;
RFC1766INFO
*
info
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
locale
));
if
(
data
->
total
>=
data
->
allocated
)
{
data
->
allocated
+=
3
2
;
data
->
allocated
*=
2
;
data
->
info
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
data
->
info
,
data
->
allocated
*
sizeof
(
RFC1766INFO
));
if
(
!
data
->
info
)
return
FALSE
;
}
info
=
&
data
->
info
[
data
->
total
];
info
->
lcid
=
wcstol
(
locale
,
&
end
,
16
);
if
(
*
end
)
/* invalid number */
return
FALSE
;
info
->
lcid
=
LocaleNameToLCID
(
locale
,
0
);
if
(
info
->
lcid
==
LOCALE_CUSTOM_UNSPECIFIED
)
return
TRUE
;
info
->
wszRfc1766
[
0
]
=
0
;
lcid_to_rfc1766W
(
info
->
lcid
,
info
->
wszRfc1766
,
MAX_RFC1766_NAME
);
...
...
@@ -2458,9 +2439,7 @@ static HRESULT EnumRfc1766_create(LANGID LangId, IEnumRfc1766 **ppEnum)
return
E_OUTOFMEMORY
;
}
TlsSetValue
(
MLANG_tls_index
,
&
data
);
EnumSystemLocalesW
(
enum_locales_proc
,
0
/*LOCALE_SUPPORTED*/
);
TlsSetValue
(
MLANG_tls_index
,
NULL
);
EnumSystemLocalesEx
(
enum_locales_proc
,
LOCALE_WINDOWS
,
(
LPARAM
)
&
data
,
NULL
);
TRACE
(
"enumerated %ld rfc1766 structures
\n
"
,
data
.
total
);
...
...
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