Commit 3467dab3 authored by Ulrich Weigand's avatar Ulrich Weigand Committed by Alexandre Julliard

Move VerLanguageName[AW] back to base (exported from KERNEL32 ...).

parent bf35d809
...@@ -504,78 +504,3 @@ DWORD WINAPI VerQueryValueW( LPVOID pBlock, LPCWSTR lpSubBlock, ...@@ -504,78 +504,3 @@ DWORD WINAPI VerQueryValueW( LPVOID pBlock, LPCWSTR lpSubBlock,
return TRUE; 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 );
}
name version name version
type win32 type win32
import kernel32.dll
0 stdcall GetFileVersionInfoA(str long long ptr) GetFileVersionInfoA 0 stdcall GetFileVersionInfoA(str long long ptr) GetFileVersionInfoA
1 stdcall GetFileVersionInfoSizeA(str ptr) GetFileVersionInfoSizeA 1 stdcall GetFileVersionInfoSizeA(str ptr) GetFileVersionInfoSizeA
2 stdcall GetFileVersionInfoSizeW(wstr ptr) GetFileVersionInfoSizeW 2 stdcall GetFileVersionInfoSizeW(wstr ptr) GetFileVersionInfoSizeW
...@@ -10,8 +12,8 @@ type win32 ...@@ -10,8 +12,8 @@ type win32
6 stdcall VerFindFileW(long wstr wstr wstr ptr ptr ptr ptr) VerFindFileW 6 stdcall VerFindFileW(long wstr wstr wstr ptr ptr ptr ptr) VerFindFileW
7 stdcall VerInstallFileA(long str str str str str ptr ptr) VerInstallFileA 7 stdcall VerInstallFileA(long str str str str str ptr ptr) VerInstallFileA
8 stdcall VerInstallFileW(long wstr wstr wstr wstr wstr ptr ptr) VerInstallFileW 8 stdcall VerInstallFileW(long wstr wstr wstr wstr wstr ptr ptr) VerInstallFileW
9 stdcall VerLanguageNameA(long ptr long) VerLanguageNameA 9 forward VerLanguageNameA KERNEL32.VerLanguageNameA
10 stdcall VerLanguageNameW(long ptr long) VerLanguageNameW 10 forward VerLanguageNameW KERNEL32.VerLanguageNameW
11 stdcall VerQueryValueA(ptr str ptr ptr) VerQueryValueA 11 stdcall VerQueryValueA(ptr str ptr ptr) VerQueryValueA
12 stdcall VerQueryValueW(ptr wstr ptr ptr) VerQueryValueW 12 stdcall VerQueryValueW(ptr wstr ptr ptr) VerQueryValueW
#13 stub VerThkSL_ThunkData32 #13 stub VerThkSL_ThunkData32
...@@ -1716,9 +1716,6 @@ BOOL WINAPI SetVolumeLabelW(LPCWSTR,LPCWSTR); ...@@ -1716,9 +1716,6 @@ BOOL WINAPI SetVolumeLabelW(LPCWSTR,LPCWSTR);
#define SetVolumeLabel WINELIB_NAME_AW(SetVolumeLabel) #define SetVolumeLabel WINELIB_NAME_AW(SetVolumeLabel)
DWORD WINAPI SizeofResource(HMODULE,HRSRC); DWORD WINAPI SizeofResource(HMODULE,HRSRC);
#define UnlockSegment(handle) GlobalUnfix((HANDLE)(handle)) #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 WritePrivateProfileSectionA(LPCSTR,LPCSTR,LPCSTR);
BOOL WINAPI WritePrivateProfileSectionW(LPCWSTR,LPCWSTR,LPCWSTR); BOOL WINAPI WritePrivateProfileSectionW(LPCWSTR,LPCWSTR,LPCWSTR);
#define WritePrivateProfileSection WINELIB_NAME_AW(WritePrivateProfileSection) #define WritePrivateProfileSection WINELIB_NAME_AW(WritePrivateProfileSection)
......
...@@ -152,6 +152,9 @@ DWORD WINAPI VerInstallFileA(UINT,LPCSTR,LPCSTR,LPCSTR,LPCSTR,LPCSTR,LPSTR ...@@ -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*); DWORD WINAPI VerInstallFileW(UINT,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,LPWSTR,UINT*);
#define VerInstallFile WINELIB_NAME_AW(VerInstallFile) #define VerInstallFile WINELIB_NAME_AW(VerInstallFile)
DWORD WINAPI VerLanguageName16(UINT16,LPSTR,UINT16); 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 VerQueryValue16(SEGPTR,LPCSTR,SEGPTR*,UINT16*);
DWORD WINAPI VerQueryValueA(LPVOID,LPCSTR,LPVOID*,UINT*); DWORD WINAPI VerQueryValueA(LPVOID,LPCSTR,LPVOID*,UINT*);
DWORD WINAPI VerQueryValueW(LPVOID,LPCWSTR,LPVOID*,UINT*); DWORD WINAPI VerQueryValueW(LPVOID,LPCWSTR,LPVOID*,UINT*);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "winuser.h" #include "winuser.h"
#include "heap.h" #include "heap.h"
#include "options.h" #include "options.h"
#include "winver.h"
#include "winnls.h" #include "winnls.h"
#include "winreg.h" #include "winreg.h"
#include "winerror.h" #include "winerror.h"
...@@ -1535,11 +1536,8 @@ BOOL WINAPI GetStringTypeExW(LCID locale,DWORD dwInfoType,LPCWSTR src, ...@@ -1535,11 +1536,8 @@ BOOL WINAPI GetStringTypeExW(LCID locale,DWORD dwInfoType,LPCWSTR src,
/***************************************************************** /*****************************************************************
* WINE_GetLanguageName [internal] * 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; int i;
for ( i = 0; languages[i].langid != 0; i++ ) for ( i = 0; languages[i].langid != 0; i++ )
...@@ -1548,6 +1546,73 @@ LPCSTR WINE_GetLanguageName( UINT langid ) ...@@ -1548,6 +1546,73 @@ LPCSTR WINE_GetLanguageName( UINT langid )
return languages[i].langname; 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[] = { static const unsigned char LCM_Unicode_LUT[] = {
6 , 3, /* - 1 */ 6 , 3, /* - 1 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment