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.

81 lines
1.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: security.hxx
  7. //
  8. // Contents:
  9. //
  10. //--------------------------------------------------------------------------
  11. #pragma once
  12. class CSecDescriptor;
  13. BOOL
  14. CheckForAccess(
  15. IN CToken * pToken,
  16. IN SECURITY_DESCRIPTOR * pSD
  17. );
  18. HANDLE
  19. GetRunAsToken(
  20. DWORD clsctx,
  21. WCHAR *pwszAppID,
  22. WCHAR *pwszRunAsDomainName,
  23. WCHAR *pwszRunAsUserName,
  24. BOOL fForLaunch
  25. );
  26. BOOL
  27. DuplicateTokenAsPrimary(
  28. HANDLE hUserToken,
  29. PSID psidUserSid,
  30. HANDLE *hPrimaryToken
  31. );
  32. BOOL
  33. DuplicateTokenForSessionUse(
  34. HANDLE hUserToken,
  35. HANDLE *hDuplicate
  36. );
  37. PSID
  38. GetUserSid(
  39. HANDLE hUserToken
  40. );
  41. HANDLE
  42. GetUserTokenForSession(
  43. ULONG ulSessionId
  44. );
  45. CSecDescriptor*
  46. GetDefaultLaunchPermissions();
  47. void
  48. SetDefaultLaunchPermissions(CSecDescriptor* pNewLaunchPerms);
  49. //
  50. // Small class to add refcount semantics around a security descriptor.
  51. //
  52. class CSecDescriptor
  53. {
  54. public:
  55. CSecDescriptor(SECURITY_DESCRIPTOR*);
  56. ~CSecDescriptor();
  57. void IncRefCount();
  58. void DecRefCount();
  59. SECURITY_DESCRIPTOR* GetSD();
  60. private:
  61. SECURITY_DESCRIPTOR* _pSD;
  62. LONG _lRefs;
  63. };