The real, definitive, Visual C++ support branch. Accept no substitutes
[reactos.git] / dll / win32 / aclui / precomp.h
1 #define WIN32_NO_STATUS
2 #define NTOS_MODE_USER
3 #define _ACLUI_
4 #include <windows.h>
5 #include <ndk/ntndk.h>
6 #include <commctrl.h>
7 #include <oleauto.h>
8 #include <objsel.h>
9 #include <prsht.h>
10 #include <aclui.h>
11 #include <sddl.h>
12 #include <ntsecapi.h>
13 #ifdef SUPPORT_UXTHEME
14 #include <uxtheme.h>
15 #include <tmschema.h>
16 #endif
17 #include "resource.h"
18
19 #define EnableRedrawWindow(hwnd) \
20 SendMessage((hwnd), WM_SETREDRAW, TRUE, 0)
21
22 #define DisableRedrawWindow(hwnd) \
23 SendMessage((hwnd), WM_SETREDRAW, FALSE, 0)
24
25 extern HINSTANCE hDllInstance;
26
27 typedef struct _ACE_ENTRY
28 {
29 struct _ACE_ENTRY *Next;
30 } ACE_ENTRY, *PACE_ENTRY;
31
32 typedef struct _PRINCIPAL_LISTITEM
33 {
34 struct _PRINCIPAL_LISTITEM *Next;
35 struct _SIDREQRESULT *SidReqResult;
36 PACE_ENTRY ACEs;
37 LPWSTR DisplayString;
38 } PRINCIPAL_LISTITEM, *PPRINCIPAL_LISTITEM;
39
40 typedef struct _SECURITY_PAGE
41 {
42 HWND hWnd;
43 HWND hBtnAdd;
44 HWND hBtnRemove;
45 HWND hBtnAdvanced;
46 HWND hAceCheckList;
47 HWND hPermissionsForLabel;
48
49 /* Main Principals List */
50 HWND hWndPrincipalsList;
51 PPRINCIPAL_LISTITEM PrincipalsListHead;
52
53 PSID OwnerSid;
54 BOOL OwnerDefaulted;
55
56 INT ControlsMargin;
57
58 INT SpecialPermCheckIndex;
59
60 HIMAGELIST hiPrincipals;
61
62 LPSECURITYINFO psi;
63 SI_OBJECT_INFO ObjectInfo;
64 IDsObjectPicker *pDsObjectPicker;
65
66 SI_ACCESS DefaultAccess;
67
68 HANDLE SidCacheMgr;
69 LONG SidLookupsPending;
70 UINT Initializing : 1;
71
72 LPCWSTR ServerName;
73 } SECURITY_PAGE, *PSECURITY_PAGE;
74
75 /* MISC ***********************************************************************/
76
77 DWORD
78 LoadAndFormatString(IN HINSTANCE hInstance,
79 IN UINT uID,
80 OUT LPWSTR *lpTarget,
81 ...);
82
83 LPARAM
84 ListViewGetSelectedItemData(IN HWND hwnd);
85
86 BOOL
87 ListViewSelectItem(IN HWND hwnd,
88 IN INT Index);
89
90 HRESULT
91 InitializeObjectPicker(IN PCWSTR ServerName,
92 IN PSI_OBJECT_INFO ObjectInfo,
93 OUT IDsObjectPicker **pDsObjectPicker);
94
95 VOID
96 FreeObjectPicker(IN IDsObjectPicker *pDsObjectPicker);
97
98 typedef BOOL (*POBJPICK_SELECTED_SID)(IN IDsObjectPicker *pDsObjectPicker,
99 IN HWND hwndParent OPTIONAL,
100 IN PSID pSid,
101 IN PVOID Context OPTIONAL);
102
103 HRESULT
104 InvokeObjectPickerDialog(IN IDsObjectPicker *pDsObjectPicker,
105 IN HWND hwndParent OPTIONAL,
106 IN POBJPICK_SELECTED_SID SelectedSidCallback,
107 IN PVOID Context OPTIONAL);
108
109 /* CHECKLIST CONTROL **********************************************************/
110
111 #define CIS_DENYDISABLED (0x8)
112 #define CIS_DENYENABLED (0x0)
113 #define CIS_ALLOWDISABLED (0x4)
114 #define CIS_ALLOWENABLED (0x0)
115 #define CIS_ALLOW (0x2)
116 #define CIS_DENY (0x1)
117 #define CIS_NONE (0x0)
118 #define CIS_DISABLED (CIS_ALLOWDISABLED | CIS_DENYDISABLED)
119
120 #define CLB_ALLOW (0x1)
121 #define CLB_DENY (0x0)
122
123 #define CIS_MASK (CIS_DISABLED | CIS_ALLOW | CIS_DENY)
124
125 #define CLM_ADDITEM (WM_USER + 1)
126 #define CLM_DELITEM (WM_USER + 2)
127 #define CLM_GETITEMCOUNT (WM_USER + 3)
128 #define CLM_CLEAR (WM_USER + 4)
129 #define CLM_SETCHECKBOXCOLUMN (WM_USER + 5)
130 #define CLM_GETCHECKBOXCOLUMN (WM_USER + 6)
131 #define CLM_CLEARCHECKBOXES (WM_USER + 7)
132 #define CLM_SETITEMSTATE (WM_USER + 8)
133 #define CLM_ENABLEQUICKSEARCH (WM_USER + 9)
134 #define CLM_SETQUICKSEARCH_TIMEOUT_RESET (WM_USER + 10)
135 #define CLM_SETQUICKSEARCH_TIMEOUT_SETFOCUS (WM_USER + 11)
136 #define CLM_FINDITEMBYACCESSMASK (WM_USER + 12)
137
138 #define CLN_CHANGINGITEMCHECKBOX (101)
139
140 typedef struct _NMCHANGEITEMCHECKBOX
141 {
142 NMHDR nmhdr;
143 DWORD OldState;
144 DWORD NewState;
145 DWORD CheckBox;
146 BOOL Checked;
147 } NMCHANGEITEMCHECKBOX, *PNMCHANGEITEMCHECKBOX;
148
149 BOOL
150 RegisterCheckListControl(HINSTANCE hInstance);
151
152 VOID
153 UnregisterCheckListControl(HINSTANCE hInstance);
154
155 /* DLLMAIN ********************************************************************/
156
157 BOOL
158 WINAPI
159 DllMain(IN HINSTANCE hinstDLL,
160 IN DWORD dwReason,
161 IN LPVOID lpvReserved);
162
163 /* SIDCACHE *******************************************************************/
164
165 typedef struct _SIDREQRESULT
166 {
167 LONG RefCount;
168 SID_NAME_USE SidNameUse;
169 LPWSTR AccountName;
170 LPWSTR DomainName;
171 } SIDREQRESULT, *PSIDREQRESULT;
172
173 typedef VOID (*PSIDREQCOMPLETIONPROC)(IN HANDLE SidCacheMgr,
174 IN PSID Sid,
175 IN PSIDREQRESULT SidRequestResult,
176 IN PVOID Context);
177
178 HANDLE
179 CreateSidCacheMgr(IN HANDLE Heap,
180 IN LPCWSTR SystemName);
181
182 VOID
183 DestroySidCacheMgr(IN HANDLE SidCacheMgr);
184
185 VOID
186 DequeueSidLookup(IN HANDLE SidCacheMgr,
187 IN PSID pSid);
188
189 BOOL
190 LookupSidCache(IN HANDLE SidCacheMgr,
191 IN PSID pSid,
192 IN PSIDREQCOMPLETIONPROC CompletionProc,
193 IN PVOID Context);
194
195 VOID
196 ReferenceSidReqResult(IN HANDLE SidCacheMgr,
197 IN PSIDREQRESULT ReqResult);
198
199 VOID
200 DereferenceSidReqResult(IN HANDLE SidCacheMgr,
201 IN PSIDREQRESULT ReqResult);
202
203 /* EOF */