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
408d0fd6
Commit
408d0fd6
authored
Mar 20, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved a couple of locale functions from ole2nls.c into locale.c.
parent
7463af6b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
101 deletions
+93
-101
locale.c
dlls/kernel/locale.c
+93
-0
ole2nls.c
ole/ole2nls.c
+0
-101
No files found.
dlls/kernel/locale.c
View file @
408d0fd6
...
...
@@ -789,6 +789,99 @@ BOOL WINAPI SetThreadLocale( LCID lcid ) /* [in] Locale identifier */
}
/******************************************************************************
* ConvertDefaultLocale (KERNEL32.@)
*/
LCID
WINAPI
ConvertDefaultLocale
(
LCID
lcid
)
{
switch
(
lcid
)
{
case
LOCALE_SYSTEM_DEFAULT
:
return
GetSystemDefaultLCID
();
case
LOCALE_USER_DEFAULT
:
return
GetUserDefaultLCID
();
case
LOCALE_NEUTRAL
:
return
MAKELCID
(
LANG_NEUTRAL
,
SUBLANG_NEUTRAL
);
}
return
MAKELANGID
(
PRIMARYLANGID
(
lcid
),
SUBLANG_NEUTRAL
);
}
/******************************************************************************
* IsValidLocale (KERNEL32.@)
*/
BOOL
WINAPI
IsValidLocale
(
LCID
lcid
,
DWORD
flags
)
{
/* check if language is registered in the kernel32 resources */
return
FindResourceExW
(
GetModuleHandleA
(
"KERNEL32"
),
RT_STRINGW
,
(
LPCWSTR
)
LOCALE_ILANGUAGE
,
LANGIDFROMLCID
(
lcid
))
!=
0
;
}
static
BOOL
CALLBACK
enum_lang_proc_a
(
HMODULE
hModule
,
LPCSTR
type
,
LPCSTR
name
,
WORD
LangID
,
LONG
lParam
)
{
LOCALE_ENUMPROCA
lpfnLocaleEnum
=
(
LOCALE_ENUMPROCA
)
lParam
;
char
buf
[
20
];
sprintf
(
buf
,
"%08x"
,
(
UINT
)
LangID
);
return
lpfnLocaleEnum
(
buf
);
}
static
BOOL
CALLBACK
enum_lang_proc_w
(
HMODULE
hModule
,
LPCWSTR
type
,
LPCWSTR
name
,
WORD
LangID
,
LONG
lParam
)
{
static
const
WCHAR
formatW
[]
=
{
'%'
,
'0'
,
'8'
,
'x'
,
0
};
LOCALE_ENUMPROCW
lpfnLocaleEnum
=
(
LOCALE_ENUMPROCW
)
lParam
;
WCHAR
buf
[
20
];
sprintfW
(
buf
,
formatW
,
(
UINT
)
LangID
);
return
lpfnLocaleEnum
(
buf
);
}
/******************************************************************************
* EnumSystemLocalesA (KERNEL32.@)
*/
BOOL
WINAPI
EnumSystemLocalesA
(
LOCALE_ENUMPROCA
lpfnLocaleEnum
,
DWORD
flags
)
{
TRACE
(
"(%p,%08lx)
\n
"
,
lpfnLocaleEnum
,
flags
);
EnumResourceLanguagesA
(
GetModuleHandleA
(
"KERNEL32"
),
RT_STRINGA
,
(
LPCSTR
)
LOCALE_ILANGUAGE
,
enum_lang_proc_a
,
(
LONG
)
lpfnLocaleEnum
);
return
TRUE
;
}
/******************************************************************************
* EnumSystemLocalesW (KERNEL32.@)
*/
BOOL
WINAPI
EnumSystemLocalesW
(
LOCALE_ENUMPROCW
lpfnLocaleEnum
,
DWORD
flags
)
{
TRACE
(
"(%p,%08lx)
\n
"
,
lpfnLocaleEnum
,
flags
);
EnumResourceLanguagesW
(
GetModuleHandleA
(
"KERNEL32"
),
RT_STRINGW
,
(
LPCWSTR
)
LOCALE_ILANGUAGE
,
enum_lang_proc_w
,
(
LONG
)
lpfnLocaleEnum
);
return
TRUE
;
}
/***********************************************************************
* VerLanguageNameA (KERNEL32.@)
*/
DWORD
WINAPI
VerLanguageNameA
(
UINT
wLang
,
LPSTR
szLang
,
UINT
nSize
)
{
return
GetLocaleInfoA
(
MAKELCID
(
wLang
,
SORT_DEFAULT
),
LOCALE_SENGLANGUAGE
,
szLang
,
nSize
);
}
/***********************************************************************
* VerLanguageNameW (KERNEL32.@)
*/
DWORD
WINAPI
VerLanguageNameW
(
UINT
wLang
,
LPWSTR
szLang
,
UINT
nSize
)
{
return
GetLocaleInfoW
(
MAKELCID
(
wLang
,
SORT_DEFAULT
),
LOCALE_SENGLANGUAGE
,
szLang
,
nSize
);
}
/******************************************************************************
* GetStringTypeW (KERNEL32.@)
...
...
ole/ole2nls.c
View file @
408d0fd6
...
...
@@ -44,107 +44,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
nls
);
/******************************************************************************
* ConvertDefaultLocale (KERNEL32.@)
*/
LCID
WINAPI
ConvertDefaultLocale
(
LCID
lcid
)
{
switch
(
lcid
)
{
case
LOCALE_SYSTEM_DEFAULT
:
return
GetSystemDefaultLCID
();
case
LOCALE_USER_DEFAULT
:
return
GetUserDefaultLCID
();
case
LOCALE_NEUTRAL
:
return
MAKELCID
(
LANG_NEUTRAL
,
SUBLANG_NEUTRAL
);
}
return
MAKELANGID
(
PRIMARYLANGID
(
lcid
),
SUBLANG_NEUTRAL
);
}
/******************************************************************************
* IsValidLocale [KERNEL32.@]
*/
BOOL
WINAPI
IsValidLocale
(
LCID
lcid
,
DWORD
flags
)
{
/* check if language is registered in the kernel32 resources */
if
(
!
FindResourceExW
(
GetModuleHandleA
(
"KERNEL32"
),
RT_STRINGW
,
(
LPCWSTR
)
LOCALE_ILANGUAGE
,
LOWORD
(
lcid
)))
return
FALSE
;
else
return
TRUE
;
}
static
BOOL
CALLBACK
EnumResourceLanguagesProcW
(
HMODULE
hModule
,
LPCWSTR
type
,
LPCWSTR
name
,
WORD
LangID
,
LONG
lParam
)
{
CHAR
bufA
[
20
];
WCHAR
bufW
[
20
];
LOCALE_ENUMPROCW
lpfnLocaleEnum
=
(
LOCALE_ENUMPROCW
)
lParam
;
sprintf
(
bufA
,
"%08x"
,
(
UINT
)
LangID
);
MultiByteToWideChar
(
CP_ACP
,
0
,
bufA
,
-
1
,
bufW
,
sizeof
(
bufW
)
/
sizeof
(
bufW
[
0
]));
return
lpfnLocaleEnum
(
bufW
);
}
/******************************************************************************
* EnumSystemLocalesW [KERNEL32.@]
*/
BOOL
WINAPI
EnumSystemLocalesW
(
LOCALE_ENUMPROCW
lpfnLocaleEnum
,
DWORD
flags
)
{
TRACE
(
"(%p,%08lx)
\n
"
,
lpfnLocaleEnum
,
flags
);
EnumResourceLanguagesW
(
GetModuleHandleA
(
"KERNEL32"
),
RT_STRINGW
,
(
LPCWSTR
)
LOCALE_ILANGUAGE
,
EnumResourceLanguagesProcW
,
(
LONG
)
lpfnLocaleEnum
);
return
TRUE
;
}
static
BOOL
CALLBACK
EnumResourceLanguagesProcA
(
HMODULE
hModule
,
LPCSTR
type
,
LPCSTR
name
,
WORD
LangID
,
LONG
lParam
)
{
CHAR
bufA
[
20
];
LOCALE_ENUMPROCA
lpfnLocaleEnum
=
(
LOCALE_ENUMPROCA
)
lParam
;
sprintf
(
bufA
,
"%08x"
,
(
UINT
)
LangID
);
return
lpfnLocaleEnum
(
bufA
);
}
/******************************************************************************
* EnumSystemLocalesA [KERNEL32.@]
*/
BOOL
WINAPI
EnumSystemLocalesA
(
LOCALE_ENUMPROCA
lpfnLocaleEnum
,
DWORD
flags
)
{
TRACE
(
"(%p,%08lx)
\n
"
,
lpfnLocaleEnum
,
flags
);
EnumResourceLanguagesA
(
GetModuleHandleA
(
"KERNEL32"
),
RT_STRINGA
,
(
LPCSTR
)
LOCALE_ILANGUAGE
,
EnumResourceLanguagesProcA
,
(
LONG
)
lpfnLocaleEnum
);
return
TRUE
;
}
/***********************************************************************
* VerLanguageNameA [KERNEL32.@]
*/
DWORD
WINAPI
VerLanguageNameA
(
UINT
wLang
,
LPSTR
szLang
,
UINT
nSize
)
{
if
(
!
szLang
)
return
0
;
return
GetLocaleInfoA
(
MAKELCID
(
wLang
,
SORT_DEFAULT
),
LOCALE_SENGLANGUAGE
,
szLang
,
nSize
);
}
/***********************************************************************
* VerLanguageNameW [KERNEL32.@]
*/
DWORD
WINAPI
VerLanguageNameW
(
UINT
wLang
,
LPWSTR
szLang
,
UINT
nSize
)
{
if
(
!
szLang
)
return
0
;
return
GetLocaleInfoW
(
MAKELCID
(
wLang
,
SORT_DEFAULT
),
LOCALE_SENGLANGUAGE
,
szLang
,
nSize
);
}
static
const
unsigned
char
LCM_Unicode_LUT
[]
=
{
6
,
3
,
/* - 1 */
6
,
4
,
/* - 2 */
...
...
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