aclui.h 8.75 KB
Newer Older
Nikolay Sivov's avatar
Nikolay Sivov committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
/*
 * Copyright (C) 2009 Nikolay Sivov
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 */

#ifndef __WINE_ACLUI_H
#define __WINE_ACLUI_H

#include <objbase.h>
#include <commctrl.h>
#include <accctrl.h>

26 27 28 29
#ifdef __cplusplus
extern "C" {
#endif  /* __cplusplus */

Nikolay Sivov's avatar
Nikolay Sivov committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
typedef struct _SI_OBJECT_INFO
{
    DWORD       dwFlags;
    HINSTANCE   hInstance;
    LPWSTR      pszServerName;
    LPWSTR      pszObjectName;
    LPWSTR      pszPageTitle;
    GUID        guidObjectType;
} SI_OBJECT_INFO, *PSI_OBJECT_INFO;

#define SI_EDIT_PERMS                0x00000000
#define SI_EDIT_OWNER                0x00000001
#define SI_EDIT_AUDITS               0x00000002
#define SI_CONTAINER                 0x00000004
#define SI_READONLY                  0x00000008
#define SI_ADVANCED                  0x00000010
#define SI_RESET                     0x00000020
#define SI_OWNER_READONLY            0x00000040
#define SI_EDIT_PROPERTIES           0x00000080
#define SI_OWNER_RECURSE             0x00000100
#define SI_NO_ACL_PROTECT            0x00000200
#define SI_NO_TREE_APPLY             0x00000400
#define SI_PAGE_TITLE                0x00000800
#define SI_SERVER_IS_DC              0x00001000
#define SI_RESET_DACL_TREE           0x00004000
#define SI_RESET_SACL_TREE           0x00008000
#define SI_OBJECT_GUID               0x00010000
#define SI_EDIT_EFFECTIVE            0x00020000
#define SI_RESET_DACL                0x00040000
#define SI_RESET_SACL                0x00080000
#define SI_RESET_OWNER               0x00100000
#define SI_NO_ADDITIONAL_PERMISSION  0x00200000
#define SI_VIEW_ONLY                 0x00400000
#define SI_PERMS_ELEVATION_REQUIRED  0x01000000
#define SI_AUDITS_ELEVATION_REQUIRED 0x02000000
#define SI_OWNER_ELEVATION_REQUIRED  0x04000000
#define SI_MAY_WRITE                 0x10000000

#define SI_EDIT_ALL     (SI_EDIT_PERMS | SI_EDIT_OWNER | SI_EDIT_AUDITS)

typedef struct _SI_ACCESS
{
    const GUID *pguid;
    ACCESS_MASK mask;
    LPCWSTR     pszName;
    DWORD       dwFlags;
} SI_ACCESS, *PSI_ACCESS;

#define SI_ACCESS_SPECIFIC  0x00010000
#define SI_ACCESS_GENERAL   0x00020000
#define SI_ACCESS_CONTAINER 0x00040000
#define SI_ACCESS_PROPERTY  0x00080000

typedef struct _SI_INHERIT_TYPE
{
    const GUID *pguid;
    ULONG       dwFlags;
    LPCWSTR     pszName;
} SI_INHERIT_TYPE, *PSI_INHERIT_TYPE;

typedef enum _SI_PAGE_TYPE
{
    SI_PAGE_PERM,
    SI_PAGE_ADVPERM,
    SI_PAGE_AUDIT,
    SI_PAGE_OWNER,
    SI_PAGE_EFFECTIVE,
    SI_PAGE_TAKEOWNERSHIP
} SI_PAGE_TYPE;

#define PSPCB_SI_INITDIALOG (WM_USER + 1)

#undef INTERFACE
#define INTERFACE ISecurityInformation
DECLARE_INTERFACE_IID_(ISecurityInformation, IUnknown, "965fc360-16ff-11d0-91cb-00aa00bbb723")
{
    /* IUnknown methods */
    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
    STDMETHOD_(ULONG,Release) (THIS) PURE;

    /* ISecurityInformation methods */
    STDMETHOD(GetObjectInformation) (THIS_ PSI_OBJECT_INFO pObjectInfo ) PURE;
    STDMETHOD(GetSecurity) (THIS_ SECURITY_INFORMATION RequestedInformation,
                            PSECURITY_DESCRIPTOR *ppSecurityDescriptor,
                            BOOL fDefault ) PURE;
    STDMETHOD(SetSecurity) (THIS_ SECURITY_INFORMATION SecurityInformation,
                            PSECURITY_DESCRIPTOR pSecurityDescriptor ) PURE;
    STDMETHOD(GetAccessRights) (THIS_ const GUID* pguidObjectType,
                                DWORD dwFlags,
                                PSI_ACCESS *ppAccess,
                                ULONG *pcAccesses,
                                ULONG *piDefaultAccess ) PURE;
    STDMETHOD(MapGeneric) (THIS_ const GUID *pguidObjectType,
                           UCHAR *pAceFlags,
                           ACCESS_MASK *pMask) PURE;
    STDMETHOD(GetInheritTypes) (THIS_ PSI_INHERIT_TYPE *ppInheritTypes,
                                ULONG *pcInheritTypes ) PURE;
    STDMETHOD(PropertySheetPageCallback)(THIS_ HWND hwnd, UINT uMsg, SI_PAGE_TYPE uPage ) PURE;
};
130
#undef INTERFACE
Nikolay Sivov's avatar
Nikolay Sivov committed
131 132 133 134 135 136 137 138 139 140 141 142 143 144
typedef ISecurityInformation *LPSECURITYINFO;

#define INTERFACE ISecurityInformation2
DECLARE_INTERFACE_IID_(ISecurityInformation2, IUnknown, "c3ccfdb4-6f88-11d2-a3ce-00c04fb1782a")
{
    /* IUnknown methods */
    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
    STDMETHOD_(ULONG,Release) (THIS) PURE;

    /* ISecurityInformation2 methods */
    STDMETHOD_(BOOL,IsDaclCanonical) (THIS_ PACL pDacl) PURE;
    STDMETHOD(LookupSids) (THIS_ ULONG cSids, PSID *rgpSids, LPDATAOBJECT *ppdo) PURE;
};
145
#undef INTERFACE
Nikolay Sivov's avatar
Nikolay Sivov committed
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
typedef ISecurityInformation2 *LPSECURITYINFO2;

#define CFSTR_ACLUI_SID_INFO_LIST   TEXT("CFSTR_ACLUI_SID_INFO_LIST")

typedef struct _SID_INFO
{
    PSID    pSid;
    PWSTR   pwzCommonName;
    PWSTR   pwzClass;
    PWSTR   pwzUPN;
} SID_INFO, *PSID_INFO;

typedef struct _SID_INFO_LIST
{
    ULONG       cItems;
    SID_INFO    aSidInfo[ANYSIZE_ARRAY];
} SID_INFO_LIST, *PSID_INFO_LIST;


#define INTERFACE IEffectivePermission
DECLARE_INTERFACE_IID_(IEffectivePermission, IUnknown, "3853dc76-9f35-407c-88a1-d19344365fbc")
{
    /* IUnknown methods */
    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
    STDMETHOD_(ULONG,Release) (THIS) PURE;

    /* ISecurityInformation methods */
    STDMETHOD(GetEffectivePermission) (THIS_
                                       const GUID* pguidObjectType,
                                       PSID pUserSid,
                                       LPCWSTR pszServerName,
                                       PSECURITY_DESCRIPTOR pSD,
                                       POBJECT_TYPE_LIST *ppObjectTypeList,
                                       ULONG *pcObjectTypeListLength,
                                       PACCESS_MASK *ppGrantedAccessList,
                                       ULONG *pcGrantedAccessListLength) PURE;
};
184
#undef INTERFACE
Nikolay Sivov's avatar
Nikolay Sivov committed
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
typedef IEffectivePermission *LPEFFECTIVEPERMISSION;

#define INTERFACE ISecurityObjectTypeInfo
DECLARE_INTERFACE_IID_(ISecurityObjectTypeInfo, IUnknown, "fc3066eb-79ef-444b-9111-d18a75ebf2fa")
{
    /* IUnknown methods */
    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
    STDMETHOD_(ULONG,Release) (THIS) PURE;

    /* ISecurityInformation methods */
    STDMETHOD(GetInheritSource)(THIS_ SECURITY_INFORMATION si,
                                PACL pACL,
#ifndef WINE_NO_UNICODE_MACROS
                                PINHERITED_FROM *ppInheritArray
#else
                                PINHERITED_FROMW *ppInheritArray
#endif
                                ) PURE;
};
205
#undef INTERFACE
Nikolay Sivov's avatar
Nikolay Sivov committed
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
typedef ISecurityObjectTypeInfo *LPSecurityObjectTypeInfo;


#define INTERFACE ISecurityInformation3
DECLARE_INTERFACE_IID_(ISecurityInformation3, IUnknown, "e2cdc9cc-31bd-4f8f-8c8b-b641af516a1a")
{
    /* IUnknown methods */
    STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
    STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
    STDMETHOD_(ULONG,Release) (THIS) PURE;

    /* ISecurityInformation3 methods */
    STDMETHOD(GetFullResourceName) (THIS_ LPWSTR *ppszResourceName) PURE;
    STDMETHOD(OpenElevatedEditor) (THIS_ HWND hWnd, SI_PAGE_TYPE uPage) PURE;
};
221
#undef INTERFACE
Nikolay Sivov's avatar
Nikolay Sivov committed
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
typedef ISecurityInformation3 *LPSECURITYINFO3;

DEFINE_GUID(IID_ISecurityInformation, 0x965fc360, 0x16ff, 0x11d0, 0x91, 0xcb, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x23);
DEFINE_GUID(IID_ISecurityInformation2, 0xc3ccfdb4, 0x6f88, 0x11d2, 0xa3, 0xce, 0x0, 0xc0, 0x4f, 0xb1, 0x78, 0x2a);
DEFINE_GUID(IID_IEffectivePermission, 0x3853dc76, 0x9f35, 0x407c, 0x88, 0xa1, 0xd1, 0x93, 0x44, 0x36, 0x5f, 0xbc);
DEFINE_GUID(IID_ISecurityObjectTypeInfo, 0xfc3066eb, 0x79ef, 0x444b, 0x91, 0x11, 0xd1, 0x8a, 0x75, 0xeb, 0xf2, 0xfa);
DEFINE_GUID(IID_ISecurityInformation3, 0xe2cdc9cc, 0x31bd, 0x4f8f, 0x8c, 0x8b, 0xb6, 0x41, 0xaf, 0x51, 0x6a, 0x1a);

HPROPSHEETPAGE WINAPI CreateSecurityPage(LPSECURITYINFO psi);
BOOL WINAPI EditSecurity(HWND owner, LPSECURITYINFO psi);
HRESULT WINAPI EditSecurityAdvanced(HWND owner, LPSECURITYINFO psi, SI_PAGE_TYPE uSIPage);

#ifdef __cplusplus
}
#endif  /* __cplusplus */

#endif /* __WINE_ACLUI_H */