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