hotspot/src/os/windows/vm/os_windows.cpp
changeset 15236 27d5f33652c7
parent 15098 3ed1d0332785
child 15237 9dadd171eeb8
equal deleted inserted replaced
15193:8e6b5694267f 15236:27d5f33652c7
  1872       if (sigbreakHandler != NULL) {
  1872       if (sigbreakHandler != NULL) {
  1873         (*sigbreakHandler)(SIGBREAK);
  1873         (*sigbreakHandler)(SIGBREAK);
  1874       }
  1874       }
  1875       return TRUE;
  1875       return TRUE;
  1876       break;
  1876       break;
       
  1877     case CTRL_LOGOFF_EVENT: {
       
  1878       // Don't terminate JVM if it is running in a non-interactive session,
       
  1879       // such as a service process.
       
  1880       USEROBJECTFLAGS flags;
       
  1881       HANDLE handle = GetProcessWindowStation();
       
  1882       if (handle != NULL &&
       
  1883           GetUserObjectInformation(handle, UOI_FLAGS, &flags,
       
  1884             sizeof( USEROBJECTFLAGS), NULL)) {
       
  1885         // If it is a non-interactive session, let next handler to deal
       
  1886         // with it.
       
  1887         if ((flags.dwFlags & WSF_VISIBLE) == 0) {
       
  1888           return FALSE;
       
  1889         }
       
  1890       }
       
  1891     }
  1877     case CTRL_CLOSE_EVENT:
  1892     case CTRL_CLOSE_EVENT:
  1878     case CTRL_LOGOFF_EVENT:
       
  1879     case CTRL_SHUTDOWN_EVENT:
  1893     case CTRL_SHUTDOWN_EVENT:
  1880       os::signal_raise(SIGTERM);
  1894       os::signal_raise(SIGTERM);
  1881       return TRUE;
  1895       return TRUE;
  1882       break;
  1896       break;
  1883     default:
  1897     default: