diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-21 21:58:47 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-21 21:58:47 +0000 |
commit | 7c0fdf0c457d55b6bfdda0282cf5099057c715c7 (patch) | |
tree | 31389d750c1fb6a6e7ecdd9279d32c238a50ff62 /plugins/AutoShutdown/src/shutdownsvc.cpp | |
parent | 4d970faf406c59e807a9ffd4d7a51f1aaad6636a (diff) |
Not needed version checks removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@6172 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AutoShutdown/src/shutdownsvc.cpp')
-rw-r--r-- | plugins/AutoShutdown/src/shutdownsvc.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp index d22ed2e2f3..4228b56b32 100644 --- a/plugins/AutoShutdown/src/shutdownsvc.cpp +++ b/plugins/AutoShutdown/src/shutdownsvc.cpp @@ -94,7 +94,7 @@ static BOOL IsShutdownTypeEnabled(BYTE shutdownType) }
}
/* test privilege */
- if(bReturn && IsWinVerNT()) {
+ if(bReturn) {
bReturn=WinNT_SetPrivilege(SE_SHUTDOWN_NAME,TRUE);
if(bReturn) WinNT_SetPrivilege(SE_SHUTDOWN_NAME,FALSE);
}
@@ -127,7 +127,7 @@ static BOOL IsShutdownTypeEnabled(BYTE shutdownType) RegCloseKey(hKey);
}
}
- else if(IsWinVerNT()) /* for WinNT4 */
+ else
bReturn=SearchPath(NULL,_T("LOGIN.SCR"),NULL,0,NULL,NULL)!=0;
}
break;
@@ -142,11 +142,9 @@ static BOOL IsShutdownTypeEnabled(BYTE shutdownType) case SDSDT_REBOOT:
case SDSDT_SHUTDOWN:
/* test privileges */
- if(IsWinVerNT()) {
- bReturn=WinNT_SetPrivilege(SE_SHUTDOWN_NAME,TRUE);
- if(bReturn) WinNT_SetPrivilege(SE_SHUTDOWN_NAME,FALSE);
- }
- else bReturn=TRUE;
+ bReturn=WinNT_SetPrivilege(SE_SHUTDOWN_NAME,TRUE);
+ if(bReturn)
+ WinNT_SetPrivilege(SE_SHUTDOWN_NAME,FALSE);
break;
}
return bReturn;
@@ -192,7 +190,7 @@ static DWORD ShutdownNow(BYTE shutdownType) if(pfnLockWorkStation!=NULL) /* Win2000+ */
if(!pfnLockWorkStation() && !WinNT_IsWorkStationLocked())
dwErrCode=GetLastError();
- else if(IsWinVerNT()) { /* WinNT4 */
+ else {
HKEY hKey;
/* start LOGON.SCR screensaver (locks workstation on NT4) */
if(!SearchPath(NULL,_T("LOGIN.SCR"),NULL,0,NULL,NULL)) {
@@ -332,7 +330,7 @@ static DWORD ShutdownNow(BYTE shutdownType) case SDSDT_REBOOT: flags=EWX_REBOOT; break;
default: flags=EWX_SHUTDOWN|EWX_POWEROFF;
}
- if(shutdownType==SDSDT_LOGOFF && IsWinVer2000Plus() && !WinNT_IsWorkStationLocked())
+ if(shutdownType==SDSDT_LOGOFF && !WinNT_IsWorkStationLocked())
flags|=EWX_FORCEIFHUNG; /* only considered for WM_ENDSESSION messages */
else flags|=EWX_FORCE; /* must be used when workstation locked */
|