< prev index next >

src/java.base/windows/native/libjava/java_props_md.c

Print this page




 348     if (*encoding == NULL) {
 349         return FALSE;
 350     }
 351     return TRUE;
 352 }
 353 
 354 // GetVersionEx is deprecated; disable the warning until a replacement is found
 355 #pragma warning(disable : 4996)
 356 java_props_t *
 357 GetJavaProperties(JNIEnv* env)
 358 {
 359     static java_props_t sprops = {0};
 360     int majorVersion;
 361     int minorVersion;
 362     int buildNumber = 0;
 363 
 364     if (sprops.line_separator) {
 365         return &sprops;
 366     }
 367 
 368     /* AWT properties */
 369     sprops.awt_toolkit = "sun.awt.windows.WToolkit";
 370 
 371     /* tmp dir */
 372     {
 373         WCHAR tmpdir[MAX_PATH + 1];
 374         /* we might want to check that this succeed */
 375         GetTempPathW(MAX_PATH + 1, tmpdir);
 376         sprops.tmp_dir = _wcsdup(tmpdir);
 377     }
 378 
 379     /* OS properties */
 380     {
 381         char buf[100];
 382         boolean is_workstation;
 383         boolean is_64bit;
 384         DWORD platformId;
 385         {
 386             OSVERSIONINFOEX ver;
 387             ver.dwOSVersionInfoSize = sizeof(ver);
 388             GetVersionEx((OSVERSIONINFO *) &ver);
 389             majorVersion = ver.dwMajorVersion;
 390             minorVersion = ver.dwMinorVersion;




 348     if (*encoding == NULL) {
 349         return FALSE;
 350     }
 351     return TRUE;
 352 }
 353 
 354 // GetVersionEx is deprecated; disable the warning until a replacement is found
 355 #pragma warning(disable : 4996)
 356 java_props_t *
 357 GetJavaProperties(JNIEnv* env)
 358 {
 359     static java_props_t sprops = {0};
 360     int majorVersion;
 361     int minorVersion;
 362     int buildNumber = 0;
 363 
 364     if (sprops.line_separator) {
 365         return &sprops;
 366     }
 367 



 368     /* tmp dir */
 369     {
 370         WCHAR tmpdir[MAX_PATH + 1];
 371         /* we might want to check that this succeed */
 372         GetTempPathW(MAX_PATH + 1, tmpdir);
 373         sprops.tmp_dir = _wcsdup(tmpdir);
 374     }
 375 
 376     /* OS properties */
 377     {
 378         char buf[100];
 379         boolean is_workstation;
 380         boolean is_64bit;
 381         DWORD platformId;
 382         {
 383             OSVERSIONINFOEX ver;
 384             ver.dwOSVersionInfoSize = sizeof(ver);
 385             GetVersionEx((OSVERSIONINFO *) &ver);
 386             majorVersion = ver.dwMajorVersion;
 387             minorVersion = ver.dwMinorVersion;


< prev index next >