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.

90 lines
2.9 KiB

  1. // PermPage.h : Declaration of the standard permissions page class
  2. #ifndef __PERMPAGE_H_INCLUDED__
  3. #define __PERMPAGE_H_INCLUDED__
  4. #include "aclui.h"
  5. class CSecurityInformation : public ISecurityInformation, public CComObjectRoot
  6. {
  7. DECLARE_NOT_AGGREGATABLE(CSecurityInformation)
  8. BEGIN_COM_MAP(CSecurityInformation)
  9. COM_INTERFACE_ENTRY(ISecurityInformation)
  10. END_COM_MAP()
  11. // *** ISecurityInformation methods ***
  12. STDMETHOD(GetObjectInformation) (PSI_OBJECT_INFO pObjectInfo ) = 0;
  13. STDMETHOD(GetSecurity) (SECURITY_INFORMATION RequestedInformation,
  14. PSECURITY_DESCRIPTOR *ppSecurityDescriptor,
  15. BOOL fDefault ) = 0;
  16. STDMETHOD(SetSecurity) (SECURITY_INFORMATION SecurityInformation,
  17. PSECURITY_DESCRIPTOR pSecurityDescriptor ) = 0;
  18. STDMETHOD(GetAccessRights) (const GUID* pguidObjectType,
  19. DWORD dwFlags,
  20. PSI_ACCESS *ppAccess,
  21. ULONG *pcAccesses,
  22. ULONG *piDefaultAccess );
  23. STDMETHOD(MapGeneric) (const GUID *pguidObjectType,
  24. UCHAR *pAceFlags,
  25. ACCESS_MASK *pMask);
  26. STDMETHOD(GetInheritTypes) (PSI_INHERIT_TYPE *ppInheritTypes,
  27. ULONG *pcInheritTypes );
  28. STDMETHOD(PropertySheetPageCallback)(HWND hwnd, UINT uMsg, SI_PAGE_TYPE uPage );
  29. protected:
  30. HRESULT NewDefaultDescriptor(
  31. PSECURITY_DESCRIPTOR* ppsd,
  32. SECURITY_INFORMATION RequestedInformation
  33. );
  34. // this will throw a memory exception where appropriate
  35. HRESULT MakeSelfRelativeCopy(
  36. PSECURITY_DESCRIPTOR psdOriginal,
  37. PSECURITY_DESCRIPTOR* ppsdNew );
  38. };
  39. class CShareSecurityInformation : public CSecurityInformation
  40. {
  41. private:
  42. LPWSTR m_strMachineName;
  43. LPWSTR m_strShareName;
  44. public:
  45. void SetMachineName( LPWSTR pszMachineName )
  46. {
  47. m_strMachineName = pszMachineName;
  48. }
  49. void SetShareName( LPWSTR pszShareName )
  50. {
  51. m_strShareName = pszShareName;
  52. }
  53. // note: these should be LPCTSTR but are left this way for convenience
  54. LPWSTR QueryMachineName()
  55. {
  56. return m_strMachineName;
  57. }
  58. LPWSTR QueryShareName()
  59. {
  60. return m_strShareName;
  61. }
  62. // *** ISecurityInformation methods ***
  63. STDMETHOD(GetObjectInformation) (PSI_OBJECT_INFO pObjectInfo );
  64. };
  65. class CSMBSecurityInformation : public CShareSecurityInformation
  66. {
  67. STDMETHOD(GetSecurity) (SECURITY_INFORMATION RequestedInformation,
  68. PSECURITY_DESCRIPTOR *ppSecurityDescriptor,
  69. BOOL fDefault );
  70. STDMETHOD(SetSecurity) (SECURITY_INFORMATION SecurityInformation,
  71. PSECURITY_DESCRIPTOR pSecurityDescriptor );
  72. public:
  73. // SHARE_INFO_502* m_pvolumeinfo;
  74. PSECURITY_DESCRIPTOR m_pInitialDescriptor;
  75. PSECURITY_DESCRIPTOR* m_ppCurrentDescriptor;
  76. CSMBSecurityInformation();
  77. ~CSMBSecurityInformation();
  78. };
  79. #endif // ~__PERMPAGE_H_INCLUDED__