Source code of Windows XP (NT5)
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.

82 lines
1.3 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. );
  25. BOOL
  26. CreateAndSetProcessToken(
  27. PPROCESS_INFORMATION ProcessInformation,
  28. HANDLE hUserToken,
  29. PSID psidUserSid
  30. );
  31. BOOL
  32. DuplicateTokenForSessionUse(
  33. HANDLE hUserToken,
  34. HANDLE *hDuplicate
  35. );
  36. PSID
  37. GetUserSid(
  38. HANDLE hUserToken
  39. );
  40. HANDLE
  41. GetShellProcessToken(
  42. ULONG ulSessionId
  43. );
  44. DWORD
  45. InitSidWinsta();
  46. CSecDescriptor*
  47. GetDefaultLaunchPermissions();
  48. void
  49. SetDefaultLaunchPermissions(CSecDescriptor* pNewLaunchPerms);
  50. //
  51. // Small class to add refcount semantics around a security descriptor.
  52. //
  53. class CSecDescriptor
  54. {
  55. public:
  56. CSecDescriptor(SECURITY_DESCRIPTOR*);
  57. ~CSecDescriptor();
  58. void IncRefCount();
  59. void DecRefCount();
  60. SECURITY_DESCRIPTOR* GetSD();
  61. private:
  62. SECURITY_DESCRIPTOR* _pSD;
  63. LONG _lRefs;
  64. };