src/os/windows/vm/os_windows.cpp

changeset 4473
edd23b35b1a5
parent 4394
4daebd4cc1dd
child 4474
2ef7061f13b4
equal deleted inserted replaced
4430:4a916f2ce331 4473:edd23b35b1a5
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:

mercurial