msxml3: Remove superfluous pointer casts.
[wine] / include / aclui.h
1 /*
2  * Copyright (C) 2009 Nikolay Sivov
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #ifndef __WINE_ACLUI_H
20 #define __WINE_ACLUI_H
21
22 #include <objbase.h>
23 #include <commctrl.h>
24 #include <accctrl.h>
25
26 typedef struct _SI_OBJECT_INFO
27 {
28     DWORD       dwFlags;
29     HINSTANCE   hInstance;
30     LPWSTR      pszServerName;
31     LPWSTR      pszObjectName;
32     LPWSTR      pszPageTitle;
33     GUID        guidObjectType;
34 } SI_OBJECT_INFO, *PSI_OBJECT_INFO;
35
36 #define SI_EDIT_PERMS                0x00000000
37 #define SI_EDIT_OWNER                0x00000001
38 #define SI_EDIT_AUDITS               0x00000002
39 #define SI_CONTAINER                 0x00000004
40 #define SI_READONLY                  0x00000008
41 #define SI_ADVANCED                  0x00000010
42 #define SI_RESET                     0x00000020
43 #define SI_OWNER_READONLY            0x00000040
44 #define SI_EDIT_PROPERTIES           0x00000080
45 #define SI_OWNER_RECURSE             0x00000100
46 #define SI_NO_ACL_PROTECT            0x00000200
47 #define SI_NO_TREE_APPLY             0x00000400
48 #define SI_PAGE_TITLE                0x00000800
49 #define SI_SERVER_IS_DC              0x00001000
50 #define SI_RESET_DACL_TREE           0x00004000
51 #define SI_RESET_SACL_TREE           0x00008000
52 #define SI_OBJECT_GUID               0x00010000
53 #define SI_EDIT_EFFECTIVE            0x00020000
54 #define SI_RESET_DACL                0x00040000
55 #define SI_RESET_SACL                0x00080000
56 #define SI_RESET_OWNER               0x00100000
57 #define SI_NO_ADDITIONAL_PERMISSION  0x00200000
58 #define SI_VIEW_ONLY                 0x00400000
59 #define SI_PERMS_ELEVATION_REQUIRED  0x01000000
60 #define SI_AUDITS_ELEVATION_REQUIRED 0x02000000
61 #define SI_OWNER_ELEVATION_REQUIRED  0x04000000
62 #define SI_MAY_WRITE                 0x10000000
63
64 #define SI_EDIT_ALL     (SI_EDIT_PERMS | SI_EDIT_OWNER | SI_EDIT_AUDITS)
65
66 typedef struct _SI_ACCESS
67 {
68     const GUID *pguid;
69     ACCESS_MASK mask;
70     LPCWSTR     pszName;
71     DWORD       dwFlags;
72 } SI_ACCESS, *PSI_ACCESS;
73
74 #define SI_ACCESS_SPECIFIC  0x00010000
75 #define SI_ACCESS_GENERAL   0x00020000
76 #define SI_ACCESS_CONTAINER 0x00040000
77 #define SI_ACCESS_PROPERTY  0x00080000
78
79 typedef struct _SI_INHERIT_TYPE
80 {
81     const GUID *pguid;
82     ULONG       dwFlags;
83     LPCWSTR     pszName;
84 } SI_INHERIT_TYPE, *PSI_INHERIT_TYPE;
85
86 typedef enum _SI_PAGE_TYPE
87 {
88     SI_PAGE_PERM,
89     SI_PAGE_ADVPERM,
90     SI_PAGE_AUDIT,
91     SI_PAGE_OWNER,
92     SI_PAGE_EFFECTIVE,
93     SI_PAGE_TAKEOWNERSHIP
94 } SI_PAGE_TYPE;
95
96 #define PSPCB_SI_INITDIALOG (WM_USER + 1)
97
98 #undef INTERFACE
99 #define INTERFACE ISecurityInformation
100 DECLARE_INTERFACE_IID_(ISecurityInformation, IUnknown, "965fc360-16ff-11d0-91cb-00aa00bbb723")
101 {
102     /* IUnknown methods */
103     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
104     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
105     STDMETHOD_(ULONG,Release) (THIS) PURE;
106
107     /* ISecurityInformation methods */
108     STDMETHOD(GetObjectInformation) (THIS_ PSI_OBJECT_INFO pObjectInfo ) PURE;
109     STDMETHOD(GetSecurity) (THIS_ SECURITY_INFORMATION RequestedInformation,
110                             PSECURITY_DESCRIPTOR *ppSecurityDescriptor,
111                             BOOL fDefault ) PURE;
112     STDMETHOD(SetSecurity) (THIS_ SECURITY_INFORMATION SecurityInformation,
113                             PSECURITY_DESCRIPTOR pSecurityDescriptor ) PURE;
114     STDMETHOD(GetAccessRights) (THIS_ const GUID* pguidObjectType,
115                                 DWORD dwFlags,
116                                 PSI_ACCESS *ppAccess,
117                                 ULONG *pcAccesses,
118                                 ULONG *piDefaultAccess ) PURE;
119     STDMETHOD(MapGeneric) (THIS_ const GUID *pguidObjectType,
120                            UCHAR *pAceFlags,
121                            ACCESS_MASK *pMask) PURE;
122     STDMETHOD(GetInheritTypes) (THIS_ PSI_INHERIT_TYPE *ppInheritTypes,
123                                 ULONG *pcInheritTypes ) PURE;
124     STDMETHOD(PropertySheetPageCallback)(THIS_ HWND hwnd, UINT uMsg, SI_PAGE_TYPE uPage ) PURE;
125 };
126 typedef ISecurityInformation *LPSECURITYINFO;
127
128 #undef INTERFACE
129 #define INTERFACE ISecurityInformation2
130 DECLARE_INTERFACE_IID_(ISecurityInformation2, IUnknown, "c3ccfdb4-6f88-11d2-a3ce-00c04fb1782a")
131 {
132     /* IUnknown methods */
133     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
134     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
135     STDMETHOD_(ULONG,Release) (THIS) PURE;
136
137     /* ISecurityInformation2 methods */
138     STDMETHOD_(BOOL,IsDaclCanonical) (THIS_ PACL pDacl) PURE;
139     STDMETHOD(LookupSids) (THIS_ ULONG cSids, PSID *rgpSids, LPDATAOBJECT *ppdo) PURE;
140 };
141 typedef ISecurityInformation2 *LPSECURITYINFO2;
142
143 #define CFSTR_ACLUI_SID_INFO_LIST   TEXT("CFSTR_ACLUI_SID_INFO_LIST")
144
145 typedef struct _SID_INFO
146 {
147     PSID    pSid;
148     PWSTR   pwzCommonName;
149     PWSTR   pwzClass;
150     PWSTR   pwzUPN;
151 } SID_INFO, *PSID_INFO;
152
153 typedef struct _SID_INFO_LIST
154 {
155     ULONG       cItems;
156     SID_INFO    aSidInfo[ANYSIZE_ARRAY];
157 } SID_INFO_LIST, *PSID_INFO_LIST;
158
159
160 #undef INTERFACE
161 #define INTERFACE IEffectivePermission
162 DECLARE_INTERFACE_IID_(IEffectivePermission, IUnknown, "3853dc76-9f35-407c-88a1-d19344365fbc")
163 {
164     /* IUnknown methods */
165     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
166     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
167     STDMETHOD_(ULONG,Release) (THIS) PURE;
168
169     /* ISecurityInformation methods */
170     STDMETHOD(GetEffectivePermission) (THIS_
171                                        const GUID* pguidObjectType,
172                                        PSID pUserSid,
173                                        LPCWSTR pszServerName,
174                                        PSECURITY_DESCRIPTOR pSD,
175                                        POBJECT_TYPE_LIST *ppObjectTypeList,
176                                        ULONG *pcObjectTypeListLength,
177                                        PACCESS_MASK *ppGrantedAccessList,
178                                        ULONG *pcGrantedAccessListLength) PURE;
179 };
180 typedef IEffectivePermission *LPEFFECTIVEPERMISSION;
181
182 #undef INTERFACE
183 #define INTERFACE ISecurityObjectTypeInfo
184 DECLARE_INTERFACE_IID_(ISecurityObjectTypeInfo, IUnknown, "fc3066eb-79ef-444b-9111-d18a75ebf2fa")
185 {
186     /* IUnknown methods */
187     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
188     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
189     STDMETHOD_(ULONG,Release) (THIS) PURE;
190
191     /* ISecurityInformation methods */
192     STDMETHOD(GetInheritSource)(THIS_ SECURITY_INFORMATION si,
193                                 PACL pACL,
194 #ifndef WINE_NO_UNICODE_MACROS
195                                 PINHERITED_FROM *ppInheritArray
196 #else
197                                 PINHERITED_FROMW *ppInheritArray
198 #endif
199                                 ) PURE;
200 };
201 typedef ISecurityObjectTypeInfo *LPSecurityObjectTypeInfo;
202
203
204 #undef INTERFACE
205 #define INTERFACE ISecurityInformation3
206 DECLARE_INTERFACE_IID_(ISecurityInformation3, IUnknown, "e2cdc9cc-31bd-4f8f-8c8b-b641af516a1a")
207 {
208     /* IUnknown methods */
209     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
210     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
211     STDMETHOD_(ULONG,Release) (THIS) PURE;
212
213     /* ISecurityInformation3 methods */
214     STDMETHOD(GetFullResourceName) (THIS_ LPWSTR *ppszResourceName) PURE;
215     STDMETHOD(OpenElevatedEditor) (THIS_ HWND hWnd, SI_PAGE_TYPE uPage) PURE;
216 };
217 typedef ISecurityInformation3 *LPSECURITYINFO3;
218
219 DEFINE_GUID(IID_ISecurityInformation, 0x965fc360, 0x16ff, 0x11d0, 0x91, 0xcb, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x23);
220 DEFINE_GUID(IID_ISecurityInformation2, 0xc3ccfdb4, 0x6f88, 0x11d2, 0xa3, 0xce, 0x0, 0xc0, 0x4f, 0xb1, 0x78, 0x2a);
221 DEFINE_GUID(IID_IEffectivePermission, 0x3853dc76, 0x9f35, 0x407c, 0x88, 0xa1, 0xd1, 0x93, 0x44, 0x36, 0x5f, 0xbc);
222 DEFINE_GUID(IID_ISecurityObjectTypeInfo, 0xfc3066eb, 0x79ef, 0x444b, 0x91, 0x11, 0xd1, 0x8a, 0x75, 0xeb, 0xf2, 0xfa);
223 DEFINE_GUID(IID_ISecurityInformation3, 0xe2cdc9cc, 0x31bd, 0x4f8f, 0x8c, 0x8b, 0xb6, 0x41, 0xaf, 0x51, 0x6a, 0x1a);
224
225 HPROPSHEETPAGE WINAPI CreateSecurityPage(LPSECURITYINFO psi);
226 BOOL WINAPI EditSecurity(HWND owner, LPSECURITYINFO psi);
227 HRESULT WINAPI EditSecurityAdvanced(HWND owner, LPSECURITYINFO psi, SI_PAGE_TYPE uSIPage);
228
229 #ifdef __cplusplus
230 }
231 #endif  /* __cplusplus */
232
233 #endif /* __WINE_ACLUI_H */