dssec.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef _DSSEC_H_
  2. #define _DSSEC_H_
  3. #include <aclui.h> // LPSECURITYINFO
  4. //+---------------------------------------------------------------------------
  5. //
  6. // Function: PFNREADOBJECTSECURITY
  7. //
  8. // Synopsis: Reads the security descriptor of a DS object
  9. //
  10. // Arguments: [IN LPCWSTR] -- ADS path of DS Object
  11. // [IN SECURITY_INFORMATION] -- Which SD parts to read
  12. // [OUT PSECURITY_DESCRIPTOR*] -- Return SD here. Caller frees with LocalFree
  13. // [IN LPARAM] -- Context param
  14. //
  15. // Return: HRESULT
  16. //
  17. //----------------------------------------------------------------------------
  18. //
  19. // Function: PFNWRITEOBJECTSECURITY
  20. //
  21. // Synopsis: Writes a security descriptor to a DS object
  22. //
  23. // Arguments: [IN LPCWSTR] -- ADS path of DS Object
  24. // [IN SECURITY_INFORMATION] -- Which SD parts to write
  25. // [OUT PSECURITY_DESCRIPTOR] -- Security descriptor to write
  26. // [IN LPARAM] -- Context param
  27. //
  28. // Return: HRESULT
  29. //
  30. //----------------------------------------------------------------------------
  31. typedef HRESULT (WINAPI *PFNREADOBJECTSECURITY)(LPCWSTR, SECURITY_INFORMATION, PSECURITY_DESCRIPTOR*, LPARAM);
  32. typedef HRESULT (WINAPI *PFNWRITEOBJECTSECURITY)(LPCWSTR, SECURITY_INFORMATION, PSECURITY_DESCRIPTOR, LPARAM);
  33. #define DSSI_READ_ONLY 0x00000001
  34. #define DSSI_NO_ACCESS_CHECK 0x00000002
  35. #define DSSI_NO_EDIT_SACL 0x00000004
  36. #define DSSI_NO_EDIT_OWNER 0x00000008
  37. #define DSSI_IS_ROOT 0x00000010
  38. #define DSSI_NO_FILTER 0x00000020
  39. #define DSSI_NO_READONLY_MESSAGE 0x00000040
  40. //+---------------------------------------------------------------------------
  41. //
  42. // Function: DSCreateSecurityPage
  43. //
  44. // Synopsis: Creates a Security property page for a DS object
  45. //
  46. // Arguments: [IN pwszObjectPath] -- Full ADS path of DS object
  47. // [IN pwszObjectClass] -- Class of the object (optional)
  48. // [IN dwFlags] -- Combination of DSSI_* flags
  49. // [OUT phPage] -- HPROPSHEETPAGE returned here
  50. // [IN pfnReadSD] -- Optional function for reading SD
  51. // [IN pfnWriteSD] -- Optional function for writing SD
  52. // [IN LPARAM] -- Passed to pfnReadSD/pfnWriteSD
  53. //
  54. // Return: HRESULT
  55. //
  56. //----------------------------------------------------------------------------
  57. STDAPI
  58. DSCreateSecurityPage(LPCWSTR pwszObjectPath,
  59. LPCWSTR pwszObjectClass,
  60. DWORD dwFlags,
  61. HPROPSHEETPAGE *phPage,
  62. PFNREADOBJECTSECURITY pfnReadSD,
  63. PFNWRITEOBJECTSECURITY pfnWriteSD,
  64. LPARAM lpContext);
  65. typedef HRESULT (WINAPI *PFNDSCREATESECPAGE)(LPCWSTR,
  66. LPCWSTR,
  67. DWORD,
  68. HPROPSHEETPAGE*,
  69. PFNREADOBJECTSECURITY,
  70. PFNWRITEOBJECTSECURITY,
  71. LPARAM);
  72. #endif /* _DSSEC_H_ */