msxml3/tests: Avoid an unneeded lstrlenW() call.
[wine/zf.git] / include / aclui.h
blobc64b2f2a0a7f387572e4baf8a7dd088dfebebfe3
1 /*
2 * Copyright (C) 2009 Nikolay Sivov
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.
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.
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
19 #ifndef __WINE_ACLUI_H
20 #define __WINE_ACLUI_H
22 #include <objbase.h>
23 #include <commctrl.h>
24 #include <accctrl.h>
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
30 typedef struct _SI_OBJECT_INFO
32 DWORD dwFlags;
33 HINSTANCE hInstance;
34 LPWSTR pszServerName;
35 LPWSTR pszObjectName;
36 LPWSTR pszPageTitle;
37 GUID guidObjectType;
38 } SI_OBJECT_INFO, *PSI_OBJECT_INFO;
40 #define SI_EDIT_PERMS 0x00000000
41 #define SI_EDIT_OWNER 0x00000001
42 #define SI_EDIT_AUDITS 0x00000002
43 #define SI_CONTAINER 0x00000004
44 #define SI_READONLY 0x00000008
45 #define SI_ADVANCED 0x00000010
46 #define SI_RESET 0x00000020
47 #define SI_OWNER_READONLY 0x00000040
48 #define SI_EDIT_PROPERTIES 0x00000080
49 #define SI_OWNER_RECURSE 0x00000100
50 #define SI_NO_ACL_PROTECT 0x00000200
51 #define SI_NO_TREE_APPLY 0x00000400
52 #define SI_PAGE_TITLE 0x00000800
53 #define SI_SERVER_IS_DC 0x00001000
54 #define SI_RESET_DACL_TREE 0x00004000
55 #define SI_RESET_SACL_TREE 0x00008000
56 #define SI_OBJECT_GUID 0x00010000
57 #define SI_EDIT_EFFECTIVE 0x00020000
58 #define SI_RESET_DACL 0x00040000
59 #define SI_RESET_SACL 0x00080000
60 #define SI_RESET_OWNER 0x00100000
61 #define SI_NO_ADDITIONAL_PERMISSION 0x00200000
62 #define SI_VIEW_ONLY 0x00400000
63 #define SI_PERMS_ELEVATION_REQUIRED 0x01000000
64 #define SI_AUDITS_ELEVATION_REQUIRED 0x02000000
65 #define SI_OWNER_ELEVATION_REQUIRED 0x04000000
66 #define SI_MAY_WRITE 0x10000000
68 #define SI_EDIT_ALL (SI_EDIT_PERMS | SI_EDIT_OWNER | SI_EDIT_AUDITS)
70 typedef struct _SI_ACCESS
72 const GUID *pguid;
73 ACCESS_MASK mask;
74 LPCWSTR pszName;
75 DWORD dwFlags;
76 } SI_ACCESS, *PSI_ACCESS;
78 #define SI_ACCESS_SPECIFIC 0x00010000
79 #define SI_ACCESS_GENERAL 0x00020000
80 #define SI_ACCESS_CONTAINER 0x00040000
81 #define SI_ACCESS_PROPERTY 0x00080000
83 typedef struct _SI_INHERIT_TYPE
85 const GUID *pguid;
86 ULONG dwFlags;
87 LPCWSTR pszName;
88 } SI_INHERIT_TYPE, *PSI_INHERIT_TYPE;
90 typedef enum _SI_PAGE_TYPE
92 SI_PAGE_PERM,
93 SI_PAGE_ADVPERM,
94 SI_PAGE_AUDIT,
95 SI_PAGE_OWNER,
96 SI_PAGE_EFFECTIVE,
97 SI_PAGE_TAKEOWNERSHIP
98 } SI_PAGE_TYPE;
100 #define PSPCB_SI_INITDIALOG (WM_USER + 1)
102 #undef INTERFACE
103 #define INTERFACE ISecurityInformation
104 DECLARE_INTERFACE_IID_(ISecurityInformation, IUnknown, "965fc360-16ff-11d0-91cb-00aa00bbb723")
106 /* IUnknown methods */
107 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
108 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
109 STDMETHOD_(ULONG,Release) (THIS) PURE;
111 /* ISecurityInformation methods */
112 STDMETHOD(GetObjectInformation) (THIS_ PSI_OBJECT_INFO pObjectInfo ) PURE;
113 STDMETHOD(GetSecurity) (THIS_ SECURITY_INFORMATION RequestedInformation,
114 PSECURITY_DESCRIPTOR *ppSecurityDescriptor,
115 BOOL fDefault ) PURE;
116 STDMETHOD(SetSecurity) (THIS_ SECURITY_INFORMATION SecurityInformation,
117 PSECURITY_DESCRIPTOR pSecurityDescriptor ) PURE;
118 STDMETHOD(GetAccessRights) (THIS_ const GUID* pguidObjectType,
119 DWORD dwFlags,
120 PSI_ACCESS *ppAccess,
121 ULONG *pcAccesses,
122 ULONG *piDefaultAccess ) PURE;
123 STDMETHOD(MapGeneric) (THIS_ const GUID *pguidObjectType,
124 UCHAR *pAceFlags,
125 ACCESS_MASK *pMask) PURE;
126 STDMETHOD(GetInheritTypes) (THIS_ PSI_INHERIT_TYPE *ppInheritTypes,
127 ULONG *pcInheritTypes ) PURE;
128 STDMETHOD(PropertySheetPageCallback)(THIS_ HWND hwnd, UINT uMsg, SI_PAGE_TYPE uPage ) PURE;
130 #undef INTERFACE
131 typedef ISecurityInformation *LPSECURITYINFO;
133 #define INTERFACE ISecurityInformation2
134 DECLARE_INTERFACE_IID_(ISecurityInformation2, IUnknown, "c3ccfdb4-6f88-11d2-a3ce-00c04fb1782a")
136 /* IUnknown methods */
137 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
138 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
139 STDMETHOD_(ULONG,Release) (THIS) PURE;
141 /* ISecurityInformation2 methods */
142 STDMETHOD_(BOOL,IsDaclCanonical) (THIS_ PACL pDacl) PURE;
143 STDMETHOD(LookupSids) (THIS_ ULONG cSids, PSID *rgpSids, LPDATAOBJECT *ppdo) PURE;
145 #undef INTERFACE
146 typedef ISecurityInformation2 *LPSECURITYINFO2;
148 #define CFSTR_ACLUI_SID_INFO_LIST TEXT("CFSTR_ACLUI_SID_INFO_LIST")
150 typedef struct _SID_INFO
152 PSID pSid;
153 PWSTR pwzCommonName;
154 PWSTR pwzClass;
155 PWSTR pwzUPN;
156 } SID_INFO, *PSID_INFO;
158 typedef struct _SID_INFO_LIST
160 ULONG cItems;
161 SID_INFO aSidInfo[ANYSIZE_ARRAY];
162 } SID_INFO_LIST, *PSID_INFO_LIST;
165 #define INTERFACE IEffectivePermission
166 DECLARE_INTERFACE_IID_(IEffectivePermission, IUnknown, "3853dc76-9f35-407c-88a1-d19344365fbc")
168 /* IUnknown methods */
169 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
170 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
171 STDMETHOD_(ULONG,Release) (THIS) PURE;
173 /* ISecurityInformation methods */
174 STDMETHOD(GetEffectivePermission) (THIS_
175 const GUID* pguidObjectType,
176 PSID pUserSid,
177 LPCWSTR pszServerName,
178 PSECURITY_DESCRIPTOR pSD,
179 POBJECT_TYPE_LIST *ppObjectTypeList,
180 ULONG *pcObjectTypeListLength,
181 PACCESS_MASK *ppGrantedAccessList,
182 ULONG *pcGrantedAccessListLength) PURE;
184 #undef INTERFACE
185 typedef IEffectivePermission *LPEFFECTIVEPERMISSION;
187 #define INTERFACE ISecurityObjectTypeInfo
188 DECLARE_INTERFACE_IID_(ISecurityObjectTypeInfo, IUnknown, "fc3066eb-79ef-444b-9111-d18a75ebf2fa")
190 /* IUnknown methods */
191 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
192 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
193 STDMETHOD_(ULONG,Release) (THIS) PURE;
195 /* ISecurityInformation methods */
196 STDMETHOD(GetInheritSource)(THIS_ SECURITY_INFORMATION si,
197 PACL pACL,
198 #ifndef WINE_NO_UNICODE_MACROS
199 PINHERITED_FROM *ppInheritArray
200 #else
201 PINHERITED_FROMW *ppInheritArray
202 #endif
203 ) PURE;
205 #undef INTERFACE
206 typedef ISecurityObjectTypeInfo *LPSecurityObjectTypeInfo;
209 #define INTERFACE ISecurityInformation3
210 DECLARE_INTERFACE_IID_(ISecurityInformation3, IUnknown, "e2cdc9cc-31bd-4f8f-8c8b-b641af516a1a")
212 /* IUnknown methods */
213 STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
214 STDMETHOD_(ULONG,AddRef) (THIS) PURE;
215 STDMETHOD_(ULONG,Release) (THIS) PURE;
217 /* ISecurityInformation3 methods */
218 STDMETHOD(GetFullResourceName) (THIS_ LPWSTR *ppszResourceName) PURE;
219 STDMETHOD(OpenElevatedEditor) (THIS_ HWND hWnd, SI_PAGE_TYPE uPage) PURE;
221 #undef INTERFACE
222 typedef ISecurityInformation3 *LPSECURITYINFO3;
224 DEFINE_GUID(IID_ISecurityInformation, 0x965fc360, 0x16ff, 0x11d0, 0x91, 0xcb, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x23);
225 DEFINE_GUID(IID_ISecurityInformation2, 0xc3ccfdb4, 0x6f88, 0x11d2, 0xa3, 0xce, 0x0, 0xc0, 0x4f, 0xb1, 0x78, 0x2a);
226 DEFINE_GUID(IID_IEffectivePermission, 0x3853dc76, 0x9f35, 0x407c, 0x88, 0xa1, 0xd1, 0x93, 0x44, 0x36, 0x5f, 0xbc);
227 DEFINE_GUID(IID_ISecurityObjectTypeInfo, 0xfc3066eb, 0x79ef, 0x444b, 0x91, 0x11, 0xd1, 0x8a, 0x75, 0xeb, 0xf2, 0xfa);
228 DEFINE_GUID(IID_ISecurityInformation3, 0xe2cdc9cc, 0x31bd, 0x4f8f, 0x8c, 0x8b, 0xb6, 0x41, 0xaf, 0x51, 0x6a, 0x1a);
230 HPROPSHEETPAGE WINAPI CreateSecurityPage(LPSECURITYINFO psi);
231 BOOL WINAPI EditSecurity(HWND owner, LPSECURITYINFO psi);
232 HRESULT WINAPI EditSecurityAdvanced(HWND owner, LPSECURITYINFO psi, SI_PAGE_TYPE uSIPage);
234 #ifdef __cplusplus
236 #endif /* __cplusplus */
238 #endif /* __WINE_ACLUI_H */