/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include <windows.h>
#include <shlobj.h>
#include <objidl.h>
#include <locale.h>
#include <tchar.h>
#include "locale_str.h"
#include "java_props.h"
#ifndef VER_PLATFORM_WIN32_WINDOWS
#endif
#ifndef PROCESSOR_ARCHITECTURE_AMD64
#endif
static char *
{
int codepage;
if (GetLocaleInfo(lcid,
codepage = 1252;
} else {
}
switch (codepage) {
case 0:
break;
case 874: /* 9:Thai */
case 932: /* 10:Japanese */
case 949: /* 12:Korean Extended Wansung */
case 950: /* 13:Chinese (Taiwan, Hongkong, Macau) */
case 1361: /* 15:Korean Johab */
ret[0] = 'M';
break;
case 936:
break;
case 54936:
break;
default:
ret[0] = 'C';
break;
}
//Traditional Chinese Windows should use MS950_HKSCS_XP as the
//default encoding, if HKSCS patch has been installed.
// "old" MS950 0xfa41 -> u+e001
// "new" MS950 0xfa41 -> u+92db
if (unicodeChar == 0x92db) {
}
} else {
//SimpChinese Windows should use GB18030 as the default
//encoding, if gb18030 patch has been installed (on windows
//2000/XP, (1)Codepage 54936 will be available
//(2)simsun18030.ttc will exist under system fonts dir )
fclose(f);
}
}
}
}
return ret;
}
// Exported entries for AWT
DllExport const char *
{
}
// Returns BCP47 Language Tag
DllExport const char *
{
int index;
// there always is the "language" tag
// append other elements, if any
}
}
}
return ret;
}
/*
* Code to figure out the user's home directory using the registry
*/
static WCHAR*
{
int rc;
WCHAR *p;
if (rc != ERROR_SUCCESS) {
// Shell folder doesn't exist??!!
return NULL;
}
path[0] = 0;
return NULL;
}
/* Get the parent of Desktop directory */
if (p == NULL) {
return NULL;
}
*p = L'\0';
}
/*
* Code to figure out the user's home directory using shell32.dll
*/
{
WCHAR *p;
// we can't find the shell folder.
return NULL;
}
path[0] = 0;
/* Get the parent of Desktop directory */
if (p) {
*p = 0;
}
/*
* We've been successful. Note that we don't free the memory allocated
* by ShGetSpecialFolderLocation. We only ever come through here once,
* and only if the registry lookup failed, so it's just not worth it.
*
* We also don't unload the SHELL32 DLL. We've paid the hit for loading
* it and we may need it again later.
*/
}
static boolean
haveMMX(void)
{
}
static const char *
cpu_isalist(void)
{
switch (info.wProcessorArchitecture) {
#ifdef PROCESSOR_ARCHITECTURE_IA64
case PROCESSOR_ARCHITECTURE_IA64: return "ia64";
#endif
#ifdef PROCESSOR_ARCHITECTURE_AMD64
case PROCESSOR_ARCHITECTURE_AMD64: return "amd64";
#endif
switch (info.wProcessorLevel) {
case 6: return haveMMX()
? "pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86"
: "pentium_pro pentium i486 i386 i86";
case 5: return haveMMX()
? "pentium+mmx pentium i486 i386 i86"
: "pentium i486 i386 i86";
case 4: return "i486 i386 i86";
case 3: return "i386 i86";
}
}
return NULL;
}
static void
/* script */
if (GetLocaleInfo(lcid,
(*script)[0] = '\0';
}
/* country */
if (GetLocaleInfo(lcid,
(*country)[0] = '\0';
}
/* language */
if (GetLocaleInfo(lcid,
/* defaults to en_US */
}
/* variant */
(*variant)[0] = '\0';
/* handling for Norwegian */
}
/* encoding */
}
{
return &sprops;
}
/* AWT properties */
/* tmp dir */
{
/* we might want to check that this succeed */
}
/* Printing properties */
/* Java2D properties */
{ /* This is used only for debugging of font problems. */
}
/* OS properties */
{
// Call GetNativeSystemInfo if supported or GetSystemInfo otherwise.
"GetNativeSystemInfo");
else
GetSystemInfo(&si);
/*
* From msdn page on OSVERSIONINFOEX, current as of this
* writing, decoding of dwMajorVersion and dwMinorVersion.
*
* Operating system dwMajorVersion dwMinorVersion
* ================== ============== ==============
*
* Windows 95 4 0
* Windows 98 4 10
* Windows ME 4 90
* Windows 3.51 3 51
* Windows NT 4.0 4 0
* Windows 2000 5 0
* Windows XP 32 bit 5 1
* Windows Server 2003 family 5 2
* Windows XP 64 bit 5 2
* where ((&ver.wServicePackMinor) + 2) = 1
* and si.wProcessorArchitecture = 9
* Windows Vista family 6 0 (VER_NT_WORKSTATION)
* Windows Server 2008 6 0 (!VER_NT_WORKSTATION)
* Windows 7 6 1 (VER_NT_WORKSTATION)
* Windows Server 2008 R2 6 1 (!VER_NT_WORKSTATION)
* Windows 8 6 2 (VER_NT_WORKSTATION)
* Windows Server 2012 6 2 (!VER_NT_WORKSTATION)
*
* This mapping will presumably be augmented as new Windows
* versions are released.
*/
switch (ver.dwPlatformId) {
case VER_PLATFORM_WIN32s:
break;
switch (ver.dwMinorVersion) {
}
} else {
}
break;
case VER_PLATFORM_WIN32_NT:
switch (ver.dwMinorVersion) {
case 2:
/*
* From MSDN OSVERSIONINFOEX and SYSTEM_INFO documentation:
*
* "Because the version numbers for Windows Server 2003
* and Windows XP 6u4 bit are identical, you must also test
* whether the wProductType member is VER_NT_WORKSTATION.
* and si.wProcessorArchitecture is
* PROCESSOR_ARCHITECTURE_AMD64 (which is 9)
* If it is, the operating system is Windows XP 64 bit;
* otherwise, it is Windows Server 2003."
*/
} else {
}
break;
}
/*
* See table in MSDN OSVERSIONINFOEX documentation.
*/
switch (ver.dwMinorVersion) {
}
} else {
switch (ver.dwMinorVersion) {
}
}
} else {
}
break;
default:
break;
}
#if _M_IA64
#else
#endif
}
/* Endianness of platform */
{
if (((char*)(&endianTest))[0] != 0) {
} else {
}
}
/* CPU ISA list */
/*
* User name
* We try to avoid calling GetUserName as it turns out to
* be surprisingly expensive on NT. It pulls in an extra
* 100 K of footprint.
*/
{
} else {
{
}
} else {
}
}
}
/*
* Home directory/
*
* We first look under a standard registry key. If that fails we
* fall back on using a SHELL32.DLL API. If that fails we use a
* default value.
*
* Note: To save space we want to avoid loading SHELL32.DLL
* unless really necessary. However if we do load it, we leave it
* in memory, as it may be needed again later.
*
* The normal result is that for a given user name XXX:
* On multi-user NT, user.home gets set to c:\winnt\profiles\XXX.
* On multi-user Win95, user.home gets set to c:\windows\profiles\XXX.
* On single-user Win95, user.home gets set to c:\windows.
*/
{
homep = getHomeFromShell32();
homep = L"C:\\";
}
}
/*
* user.language
* file.encoding
* file.encoding.pkg
*/
{
/*
* query the system for the current system default locale
* (which is a Windows LCID value),
*/
{
char * display_encoding;
// Windows UI Language selection list only cares "language"
// information of the UI Language. For example, the list
// just lists "English" but it actually means "en_US", and
// the user cannot select "en_GB" (if exists) in the list.
// So, this hack is to use the user LCID region information
// for the UI Language, if the "language" portion of those
// two locales are the same.
}
// MS claims "Vista has built-in support for HKSCS-2004.
// All of the HKSCS-2004 characters have Unicode 4.1.
// PUA code point assignments". But what it really means
// is that the HKSCS-2004 is ONLY supported in Unicode.
// Test indicates the MS950 in its zh_HK locale is a
// "regular" MS950 which does not handle HKSCS-2004 at
// all. Set encoding to MS950_HKSCS.
}
}
}
/* User TIMEZONE */
{
/*
* We defer setting up timezone until it's actually necessary.
* Refer to TimeZone.getDefault(). However, the system
* property is necessary to be able to be set by the command
* line interface -D. Here temporarily set a null string to
* timezone.
*/
}
/* Current directory */
{
}
return &sprops;
}
{
}