diff options
Diffstat (limited to 'shared/privilege.cpp')
-rw-r--r-- | shared/privilege.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/shared/privilege.cpp b/shared/privilege.cpp index 5cb664e1..c854ad4e 100644 --- a/shared/privilege.cpp +++ b/shared/privilege.cpp @@ -1,9 +1,9 @@ #include "privilege.h" -#include "system_func.h" +#include "last_error.h" #include "i18n.h" #include "loki/ScopeGuard.h" -using namespace ffs3; +using namespace zen; Privileges& Privileges::getInstance() @@ -20,8 +20,8 @@ bool Privileges::privilegeIsActive(LPCTSTR privilege) //throw (FileError) TOKEN_QUERY, //__in DWORD DesiredAccess, &hToken)) //__out PHANDLE TokenHandle { - const wxString errorMessage = wxString(_("Error setting privilege:")) + wxT(" \"") + privilege + wxT("\"") + wxT("\n\n"); - throw FileError(errorMessage + ffs3::getLastErrorFormatted()); + const wxString errorMessage = wxString(_("Error setting privilege:")) + wxT(" \"") + privilege + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + zen::getLastErrorFormatted()); } Loki::ScopeGuard dummy = Loki::MakeGuard(::CloseHandle, hToken); (void)dummy; //silence warning "unused variable" @@ -33,8 +33,8 @@ bool Privileges::privilegeIsActive(LPCTSTR privilege) //throw (FileError) privilege, //__in LPCTSTR lpName, &luid )) //__out PLUID lpLuid { - const wxString errorMessage = wxString(_("Error setting privilege:")) + wxT(" \"") + privilege + wxT("\"") + wxT("\n\n"); - throw FileError(errorMessage + ffs3::getLastErrorFormatted()); + const wxString errorMessage = wxString(_("Error setting privilege:")) + wxT(" \"") + privilege + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + zen::getLastErrorFormatted()); } PRIVILEGE_SET priv = {}; @@ -49,8 +49,8 @@ bool Privileges::privilegeIsActive(LPCTSTR privilege) //throw (FileError) &priv, //__inout PPRIVILEGE_SET RequiredPrivileges, &alreadyGranted)) //__out LPBOOL pfResult { - const wxString errorMessage = wxString(_("Error setting privilege:")) + wxT(" \"") + privilege + wxT("\"") + wxT("\n\n"); - throw FileError(errorMessage + ffs3::getLastErrorFormatted()); + const wxString errorMessage = wxString(_("Error setting privilege:")) + wxT(" \"") + privilege + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + zen::getLastErrorFormatted()); } return alreadyGranted == TRUE; @@ -64,8 +64,8 @@ void Privileges::setPrivilege(LPCTSTR privilege, bool enable) //throw (FileError TOKEN_ADJUST_PRIVILEGES, //__in DWORD DesiredAccess, &hToken)) //__out PHANDLE TokenHandle { - const wxString errorMessage = wxString(_("Error setting privilege:")) + wxT(" \"") + privilege + wxT("\"") + wxT("\n\n"); - throw FileError(errorMessage + ffs3::getLastErrorFormatted()); + const wxString errorMessage = wxString(_("Error setting privilege:")) + wxT(" \"") + privilege + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + zen::getLastErrorFormatted()); } Loki::ScopeGuard dummy = Loki::MakeGuard(::CloseHandle, hToken); (void)dummy; //silence warning "unused variable" @@ -76,8 +76,8 @@ void Privileges::setPrivilege(LPCTSTR privilege, bool enable) //throw (FileError privilege, //__in LPCTSTR lpName, &luid )) //__out PLUID lpLuid { - const wxString errorMessage = wxString(_("Error setting privilege:")) + wxT(" \"") + privilege + wxT("\"") + wxT("\n\n"); - throw FileError(errorMessage + ffs3::getLastErrorFormatted()); + const wxString errorMessage = wxString(_("Error setting privilege:")) + wxT(" \"") + privilege + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + zen::getLastErrorFormatted()); } TOKEN_PRIVILEGES tp = {}; @@ -93,13 +93,13 @@ void Privileges::setPrivilege(LPCTSTR privilege, bool enable) //throw (FileError NULL, //__out_opt PTOKEN_PRIVILEGES PreviousState, NULL)) //__out_opt PDWORD ReturnLength { - const wxString errorMessage = wxString(_("Error setting privilege:")) + wxT(" \"") + privilege + wxT("\"") + wxT("\n\n"); - throw FileError(errorMessage + ffs3::getLastErrorFormatted()); + const wxString errorMessage = wxString(_("Error setting privilege:")) + wxT(" \"") + privilege + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + zen::getLastErrorFormatted()); } if (::GetLastError() == ERROR_NOT_ALL_ASSIGNED) //check although previous function returned with success! { - const wxString errorMessage = wxString(_("Error setting privilege:")) + wxT(" \"") + privilege + wxT("\"") + wxT("\n\n"); - throw FileError(errorMessage + ffs3::getLastErrorFormatted()); + const wxString errorMessage = wxString(_("Error setting privilege:")) + wxT(" \"") + privilege + wxT("\""); + throw FileError(errorMessage + wxT("\n\n") + zen::getLastErrorFormatted()); } } |