Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 1999, 2000 Microsoft Corporation
  3. Module Name:
  4. vs_sec.hxx
  5. Abstract:
  6. Declaration of IsAdministrator
  7. Adi Oltean [aoltean] 10/05/1999
  8. Revision History:
  9. Name Date Comments
  10. aoltean 09/27/1999 Created
  11. aoltean 10/05/1999 Moved into security.hxx from admin.hxx
  12. aoltean 12/16/1999 Moved into vs_sec.hxx
  13. brianb 04/27/2000 Added IsRestoreOperator, TurnOnSecurityPrivilegeRestore, TurnOnSecurityPrivilegeBackup
  14. brianb 05/03/2000 Added GetClientTokenOwner method
  15. --*/
  16. #ifndef __VSS_SECURITY_HXX__
  17. #define __VSS_SECURITY_HXX__
  18. #if _MSC_VER > 1000
  19. #pragma once
  20. #endif
  21. ////////////////////////////////////////////////////////////////////////
  22. // Standard foo for file name aliasing. This code block must be after
  23. // all includes of VSS header files.
  24. //
  25. #ifdef VSS_FILE_ALIAS
  26. #undef VSS_FILE_ALIAS
  27. #endif
  28. #define VSS_FILE_ALIAS "INCSECH"
  29. //
  30. ////////////////////////////////////////////////////////////////////////
  31. /////////////////////////////////////////////////////////////////////////////
  32. // global methods
  33. // is caller member of administrators group
  34. bool IsAdministrator() throw (HRESULT);
  35. // is caller member of administrators group or has SE_BACKUP_NAME privilege
  36. // enabled
  37. bool IsBackupOperator() throw(HRESULT);
  38. // is caller member of administrators group or has SE_RESTORE_NAME privilege
  39. // enabled
  40. bool IsRestoreOperator() throw(HRESULT);
  41. // enable SE_BACKUP_NAME privilege
  42. HRESULT TurnOnSecurityPrivilegeBackup();
  43. // enable SE_RESTORE_NAME privilege
  44. HRESULT TurnOnSecurityPrivilegeRestore();
  45. // determine if process has ADMIN privileges
  46. bool IsProcessAdministrator() throw(HRESULT);
  47. // determine if process has backup privilege enabled
  48. bool IsProcessBackupOperator() throw(HRESULT);
  49. // determine if the process is a local service
  50. bool IsProcessLocalService();
  51. // determine if the process is a network service
  52. bool IsProcessNetworkService();
  53. // determine if the process has the restore privilege enabeled
  54. bool IsProcessRestoreOperator() throw(HRESULT);
  55. // get SID of calling client process
  56. TOKEN_OWNER *GetClientTokenOwner(BOOL bImpersonate) throw(HRESULT);
  57. #endif // __VSS_SECURITY_HXX__