Move VerLanguageName[AW] back to base (exported from KERNEL32 ...).
This commit is contained in:
parent
bf35d809d4
commit
3467dab377
|
@ -504,78 +504,3 @@ DWORD WINAPI VerQueryValueW( LPVOID pBlock, LPCWSTR lpSubBlock,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
extern LPCSTR WINE_GetLanguageName( UINT langid );
|
||||
|
||||
/***********************************************************************
|
||||
* VerLanguageName32A [VERSION.9]
|
||||
*/
|
||||
DWORD WINAPI VerLanguageNameA( UINT wLang, LPSTR szLang, UINT nSize )
|
||||
{
|
||||
char buffer[80];
|
||||
LPCSTR name;
|
||||
DWORD result;
|
||||
|
||||
TRACE("(%d,%p,%d)\n", wLang, szLang, nSize );
|
||||
|
||||
/*
|
||||
* First, check \System\CurrentControlSet\control\Nls\Locale\<langid>
|
||||
* from the registry.
|
||||
*/
|
||||
|
||||
sprintf( buffer,
|
||||
"\\System\\CurrentControlSet\\control\\Nls\\Locale\\%08x",
|
||||
wLang );
|
||||
|
||||
result = RegQueryValueA( HKEY_LOCAL_MACHINE, buffer, szLang, (LPDWORD)&nSize );
|
||||
if ( result == ERROR_SUCCESS || result == ERROR_MORE_DATA )
|
||||
return nSize;
|
||||
|
||||
/*
|
||||
* If that fails, use the internal table
|
||||
* (actually, Windows stores the names in a string table resource ...)
|
||||
*/
|
||||
|
||||
name = WINE_GetLanguageName( wLang );
|
||||
lstrcpynA( szLang, name, nSize );
|
||||
return lstrlenA( name );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* VerLanguageName32W [VERSION.10]
|
||||
*/
|
||||
DWORD WINAPI VerLanguageNameW( UINT wLang, LPWSTR szLang, UINT nSize )
|
||||
{
|
||||
char buffer[80];
|
||||
LPWSTR keyname;
|
||||
LPCSTR name;
|
||||
DWORD result;
|
||||
|
||||
TRACE("(%d,%p,%d)\n", wLang, szLang, nSize );
|
||||
|
||||
/*
|
||||
* First, check \System\CurrentControlSet\control\Nls\Locale\<langid>
|
||||
* from the registry.
|
||||
*/
|
||||
|
||||
sprintf( buffer,
|
||||
"\\System\\CurrentControlSet\\control\\Nls\\Locale\\%08x",
|
||||
wLang );
|
||||
|
||||
keyname = HEAP_strdupAtoW( GetProcessHeap(), 0, buffer );
|
||||
result = RegQueryValueW( HKEY_LOCAL_MACHINE, keyname, szLang, (LPDWORD)&nSize );
|
||||
HeapFree( GetProcessHeap(), 0, keyname );
|
||||
|
||||
if ( result == ERROR_SUCCESS || result == ERROR_MORE_DATA )
|
||||
return nSize;
|
||||
|
||||
/*
|
||||
* If that fails, use the internal table
|
||||
* (actually, Windows stores the names in a string table resource ...)
|
||||
*/
|
||||
|
||||
name = WINE_GetLanguageName( wLang );
|
||||
lstrcpynAtoW( szLang, name, nSize );
|
||||
return lstrlenA( name );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
name version
|
||||
type win32
|
||||
|
||||
import kernel32.dll
|
||||
|
||||
0 stdcall GetFileVersionInfoA(str long long ptr) GetFileVersionInfoA
|
||||
1 stdcall GetFileVersionInfoSizeA(str ptr) GetFileVersionInfoSizeA
|
||||
2 stdcall GetFileVersionInfoSizeW(wstr ptr) GetFileVersionInfoSizeW
|
||||
|
@ -10,8 +12,8 @@ type win32
|
|||
6 stdcall VerFindFileW(long wstr wstr wstr ptr ptr ptr ptr) VerFindFileW
|
||||
7 stdcall VerInstallFileA(long str str str str str ptr ptr) VerInstallFileA
|
||||
8 stdcall VerInstallFileW(long wstr wstr wstr wstr wstr ptr ptr) VerInstallFileW
|
||||
9 stdcall VerLanguageNameA(long ptr long) VerLanguageNameA
|
||||
10 stdcall VerLanguageNameW(long ptr long) VerLanguageNameW
|
||||
9 forward VerLanguageNameA KERNEL32.VerLanguageNameA
|
||||
10 forward VerLanguageNameW KERNEL32.VerLanguageNameW
|
||||
11 stdcall VerQueryValueA(ptr str ptr ptr) VerQueryValueA
|
||||
12 stdcall VerQueryValueW(ptr wstr ptr ptr) VerQueryValueW
|
||||
#13 stub VerThkSL_ThunkData32
|
||||
|
|
|
@ -1716,9 +1716,6 @@ BOOL WINAPI SetVolumeLabelW(LPCWSTR,LPCWSTR);
|
|||
#define SetVolumeLabel WINELIB_NAME_AW(SetVolumeLabel)
|
||||
DWORD WINAPI SizeofResource(HMODULE,HRSRC);
|
||||
#define UnlockSegment(handle) GlobalUnfix((HANDLE)(handle))
|
||||
DWORD WINAPI VerLanguageNameA(UINT,LPSTR,UINT);
|
||||
DWORD WINAPI VerLanguageNameW(UINT,LPWSTR,UINT);
|
||||
#define VerLanguageName WINELIB_NAME_AW(VerLanguageName)
|
||||
BOOL WINAPI WritePrivateProfileSectionA(LPCSTR,LPCSTR,LPCSTR);
|
||||
BOOL WINAPI WritePrivateProfileSectionW(LPCWSTR,LPCWSTR,LPCWSTR);
|
||||
#define WritePrivateProfileSection WINELIB_NAME_AW(WritePrivateProfileSection)
|
||||
|
|
|
@ -152,6 +152,9 @@ DWORD WINAPI VerInstallFileA(UINT,LPCSTR,LPCSTR,LPCSTR,LPCSTR,LPCSTR,LPSTR
|
|||
DWORD WINAPI VerInstallFileW(UINT,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,UINT*);
|
||||
#define VerInstallFile WINELIB_NAME_AW(VerInstallFile)
|
||||
DWORD WINAPI VerLanguageName16(UINT16,LPSTR,UINT16);
|
||||
DWORD WINAPI VerLanguageNameA(UINT,LPSTR,UINT);
|
||||
DWORD WINAPI VerLanguageNameW(UINT,LPWSTR,UINT);
|
||||
#define VerLanguageName WINELIB_NAME_AW(VerLanguageName)
|
||||
DWORD WINAPI VerQueryValue16(SEGPTR,LPCSTR,SEGPTR*,UINT16*);
|
||||
DWORD WINAPI VerQueryValueA(LPVOID,LPCSTR,LPVOID*,UINT*);
|
||||
DWORD WINAPI VerQueryValueW(LPVOID,LPCWSTR,LPVOID*,UINT*);
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "winuser.h"
|
||||
#include "heap.h"
|
||||
#include "options.h"
|
||||
#include "winver.h"
|
||||
#include "winnls.h"
|
||||
#include "winreg.h"
|
||||
#include "winerror.h"
|
||||
|
@ -1535,11 +1536,8 @@ BOOL WINAPI GetStringTypeExW(LCID locale,DWORD dwInfoType,LPCWSTR src,
|
|||
|
||||
/*****************************************************************
|
||||
* WINE_GetLanguageName [internal]
|
||||
*
|
||||
* FIXME: Windows keeps language names in a string table
|
||||
* resource in VER.DLL ...
|
||||
*/
|
||||
LPCSTR WINE_GetLanguageName( UINT langid )
|
||||
static LPCSTR WINE_GetLanguageName( UINT langid )
|
||||
{
|
||||
int i;
|
||||
for ( i = 0; languages[i].langid != 0; i++ )
|
||||
|
@ -1549,6 +1547,73 @@ LPCSTR WINE_GetLanguageName( UINT langid )
|
|||
return languages[i].langname;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* VerLanguageNameA [KERNEL32.709][VERSION.9]
|
||||
*/
|
||||
DWORD WINAPI VerLanguageNameA( UINT wLang, LPSTR szLang, UINT nSize )
|
||||
{
|
||||
char buffer[80];
|
||||
LPCSTR name;
|
||||
DWORD result;
|
||||
|
||||
/*
|
||||
* First, check \System\CurrentControlSet\control\Nls\Locale\<langid>
|
||||
* from the registry.
|
||||
*/
|
||||
|
||||
sprintf( buffer,
|
||||
"\\System\\CurrentControlSet\\control\\Nls\\Locale\\%08x",
|
||||
wLang );
|
||||
|
||||
result = RegQueryValueA( HKEY_LOCAL_MACHINE, buffer, szLang, (LPDWORD)&nSize );
|
||||
if ( result == ERROR_SUCCESS || result == ERROR_MORE_DATA )
|
||||
return nSize;
|
||||
|
||||
/*
|
||||
* If that fails, use the internal table
|
||||
*/
|
||||
|
||||
name = WINE_GetLanguageName( wLang );
|
||||
lstrcpynA( szLang, name, nSize );
|
||||
return lstrlenA( name );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* VerLanguageNameW [KERNEL32.710][VERSION.10]
|
||||
*/
|
||||
DWORD WINAPI VerLanguageNameW( UINT wLang, LPWSTR szLang, UINT nSize )
|
||||
{
|
||||
char buffer[80];
|
||||
LPWSTR keyname;
|
||||
LPCSTR name;
|
||||
DWORD result;
|
||||
|
||||
/*
|
||||
* First, check \System\CurrentControlSet\control\Nls\Locale\<langid>
|
||||
* from the registry.
|
||||
*/
|
||||
|
||||
sprintf( buffer,
|
||||
"\\System\\CurrentControlSet\\control\\Nls\\Locale\\%08x",
|
||||
wLang );
|
||||
|
||||
keyname = HEAP_strdupAtoW( GetProcessHeap(), 0, buffer );
|
||||
result = RegQueryValueW( HKEY_LOCAL_MACHINE, keyname, szLang, (LPDWORD)&nSize );
|
||||
HeapFree( GetProcessHeap(), 0, keyname );
|
||||
|
||||
if ( result == ERROR_SUCCESS || result == ERROR_MORE_DATA )
|
||||
return nSize;
|
||||
|
||||
/*
|
||||
* If that fails, use the internal table
|
||||
*/
|
||||
|
||||
name = WINE_GetLanguageName( wLang );
|
||||
lstrcpynAtoW( szLang, name, nSize );
|
||||
return lstrlenA( name );
|
||||
}
|
||||
|
||||
|
||||
static const unsigned char LCM_Unicode_LUT[] = {
|
||||
6 , 3, /* - 1 */
|
||||
6 , 4, /* - 2 */
|
||||
|
|
Loading…
Reference in New Issue