home *** CD-ROM | disk | FTP | other *** search
/ Beginning C++ Through Gam…rogramming (2nd Edition) / BCGP2E.ISO / bloodshed / devcpp-4.9.9.2_setup.exe / aclui.h < prev    next >
C/C++ Source or Header  |  2005-01-29  |  4KB  |  135 lines

  1. #ifndef _ACLUI_H
  2. #define _ACLUI_H
  3. #if __GNUC__ >= 3
  4. #pragma GCC system_header
  5. #endif
  6.  
  7. #ifndef __OBJC__
  8. #include <objbase.h>
  9. #include <commctrl.h>
  10. #include <accctrl.h>
  11. #endif
  12.  
  13. #if !defined(_ACLUI_)
  14. #define ACLUIAPI    DECLSPEC_IMPORT WINAPI
  15. #else
  16. #define ACLUIAPI    WINAPI
  17. #endif
  18.  
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22.  
  23. typedef struct _SI_OBJECT_INFO
  24. {
  25.     DWORD dwFlags;
  26.     HINSTANCE hInstance;
  27.     LPWSTR pszServerName;
  28.     LPWSTR pszObjectName;
  29.     LPWSTR pszPageTitle;
  30.     GUID guidObjectType;
  31. } SI_OBJECT_INFO, *PSI_OBJECT_INFO;
  32.  
  33. /* values for SI_OBJECT_INFO.dwFlags */
  34. #define SI_EDIT_PERMS                0x00000000L
  35. #define SI_EDIT_OWNER                0x00000001L
  36. #define SI_EDIT_AUDITS                0x00000002L
  37. #define SI_CONTAINER                0x00000004L
  38. #define SI_READONLY                    0x00000008L
  39. #define SI_ADVANCED                    0x00000010L
  40. #define SI_RESET                    0x00000020L
  41. #define SI_OWNER_READONLY            0x00000040L
  42. #define SI_EDIT_PROPERTIES            0x00000080L
  43. #define SI_OWNER_RECURSE            0x00000100L
  44. #define SI_NO_ACL_PROTECT            0x00000200L
  45. #define SI_NO_TREE_APPLY            0x00000400L
  46. #define SI_PAGE_TITLE                0x00000800L
  47. #define SI_SERVER_IS_DC                0x00001000L
  48. #define SI_RESET_DACL_TREE            0x00004000L
  49. #define SI_RESET_SACL_TREE            0x00008000L
  50. #define SI_OBJECT_GUID                0x00010000L
  51. #define SI_EDIT_EFFECTIVE            0x00020000L
  52. #define SI_RESET_DACL                0x00040000L
  53. #define SI_RESET_SACL                0x00080000L
  54. #define SI_RESET_OWNER                0x00100000L
  55. #define SI_NO_ADDITIONAL_PERMISSION    0x00200000L
  56. #define SI_MAY_WRITE                0x10000000L
  57.  
  58. #define SI_EDIT_ALL     (SI_EDIT_PERMS | SI_EDIT_OWNER | SI_EDIT_AUDITS)
  59.  
  60.  
  61. typedef struct _SI_ACCESS
  62. {
  63.     const GUID* pguid;
  64.     ACCESS_MASK mask;
  65.     LPCWSTR pszName;
  66.     DWORD dwFlags;
  67. } SI_ACCESS, *PSI_ACCESS;
  68.  
  69. /* values for SI_ACCESS.dwFlags */
  70. #define SI_ACCESS_SPECIFIC            0x00010000L
  71. #define SI_ACCESS_GENERAL            0x00020000L
  72. #define SI_ACCESS_CONTAINER            0x00040000L
  73. #define SI_ACCESS_PROPERTY            0x00080000L
  74.  
  75.  
  76. typedef struct _SI_INHERIT_TYPE
  77. {
  78.     const GUID* pguid;
  79.     ULONG dwFlags;
  80.     LPCWSTR pszName;
  81. } SI_INHERIT_TYPE, *PSI_INHERIT_TYPE;
  82.  
  83. /* values for SI_INHERIT_TYPE.dwFlags
  84.    INHERIT_ONLY_ACE, CONTAINER_INHERIT_ACE, OBJECT_INHERIT_ACE
  85.    defined elsewhere */
  86.  
  87.  
  88. typedef enum _SI_PAGE_TYPE
  89. {
  90.     SI_PAGE_PERM = 0, 
  91.     SI_PAGE_ADVPERM, 
  92.     SI_PAGE_AUDIT, 
  93.     SI_PAGE_OWNER
  94. } SI_PAGE_TYPE;
  95.  
  96.  
  97. #define PSPCB_SI_INITDIALOG    (WM_USER + 1)
  98.  
  99. #ifndef __ISecurityInformation_INTERFACE_DEFINED__
  100. #define __ISecurityInformation_INTERFACE_DEFINED__
  101. #undef INTERFACE
  102. #define INTERFACE ISecurityInformation
  103. DECLARE_INTERFACE_(ISecurityInformation, IUnknown)
  104. {
  105.         STDMETHOD(QueryInterface)(THIS_ REFIID,PVOID*) PURE;
  106.         STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  107.         STDMETHOD_(ULONG,Release)(THIS) PURE;
  108.         
  109.         STDMETHOD(GetObjectInformation)(THIS_ PSI_OBJECT_INFO) PURE;
  110.         STDMETHOD(GetSecurity)(THIS_ SECURITY_INFORMATION,PSECURITY_DESCRIPTOR*,BOOL) PURE;
  111.         STDMETHOD(SetSecurity)(THIS_ SECURITY_INFORMATION,PSECURITY_DESCRIPTOR) PURE;
  112.         STDMETHOD(GetAccessRights)(THIS_ const GUID*,DWORD,PSI_ACCESS*,ULONG*,ULONG*) PURE;
  113.         STDMETHOD(MapGeneric)(THIS_ const GUID*,UCHAR*,ACCESS_MASK*) PURE;
  114.         STDMETHOD(GetInheritTypes)(THIS_ PSI_INHERIT_TYPE*,ULONG*) PURE;
  115.         STDMETHOD(PropertySheetPageCallback)(THIS_ HWND,UINT,SI_PAGE_TYPE) PURE;
  116. };
  117. typedef ISecurityInformation *LPSECURITYINFO;
  118. #endif
  119.  
  120. /*
  121.  * TODO: ISecurityInformation2, IEffectivePermission, ISecurityObjectTypeInfo
  122.  */
  123.  
  124. extern DECLSPEC_IMPORT const IID IID_ISecurityInformation;
  125.  
  126.  
  127. HPROPSHEETPAGE ACLUIAPI CreateSecurityPage(LPSECURITYINFO psi);
  128. BOOL ACLUIAPI EditSecurity(HWND hwndOwner, LPSECURITYINFO psi);
  129.  
  130. #ifdef __cplusplus
  131. }
  132. #endif
  133.  
  134. #endif
  135.