Mercurial > hg > graal-jvmci-8
comparison src/os/windows/vm/os_windows.cpp @ 7631:edd23b35b1a5
6871190: Don't terminate JVM if it is running in a non-interactive session
Summary: Don't handle CTRL_LOGOFF_EVENT event when the process is running in a non-interactive session
Reviewed-by: ctornqvi, acorn
author | zgu |
---|---|
date | Tue, 22 Jan 2013 14:27:41 -0500 |
parents | 4daebd4cc1dd |
children | 2ef7061f13b4 |
comparison
equal
deleted
inserted
replaced
7587:4a916f2ce331 | 7631: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: |