annotate win32/aclui.d @ 1:4a9dcbd9e54f

-files of 0.13 beta -fixes so that it now compiles with the current dmd version
author marton@basel.hu
date Tue, 05 Apr 2011 20:44:01 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
1 /***********************************************************************\
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
2 * aclui.d *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
3 * *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
4 * Windows API header module *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
5 * *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
6 * Translated from MinGW API for MS-Windows 3.10 *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
7 * by Stewart Gordon *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
8 * *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
9 * Placed into public domain *
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
10 \***********************************************************************/
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
11 module win32.aclui;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
12 pragma(lib, "aclui.lib");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
13
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
14 private import win32.w32api;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
15
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
16 static assert (_WIN32_WINNT_ONLY && _WIN32_WINNT >= 0x500,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
17 "win32.aclui is available only if version WindowsXP, Windows2003 "
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
18 "or WindowsVista is set, or both Windows2000 and WindowsNTonly are set");
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
19
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
20 import win32.accctrl, win32.commctrl, win32.objbase;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
21 private import win32.basetyps, win32.prsht, win32.unknwn, win32.windef,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
22 win32.winuser;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
23
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
24
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
25 struct SI_OBJECT_INFO {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
26 DWORD dwFlags;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
27 HINSTANCE hInstance;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
28 LPWSTR pszServerName;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
29 LPWSTR pszObjectName;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
30 LPWSTR pszPageTitle;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
31 GUID guidObjectType;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
32 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
33 alias SI_OBJECT_INFO* PSI_OBJECT_INFO;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
34
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
35 // values for SI_OBJECT_INFO.dwFlags
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
36 const DWORD
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
37 SI_EDIT_PERMS = 0x00000000,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
38 SI_EDIT_OWNER = 0x00000001,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
39 SI_EDIT_AUDITS = 0x00000002,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
40 SI_CONTAINER = 0x00000004,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
41 SI_READONLY = 0x00000008,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
42 SI_ADVANCED = 0x00000010,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
43 SI_RESET = 0x00000020,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
44 SI_OWNER_READONLY = 0x00000040,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
45 SI_EDIT_PROPERTIES = 0x00000080,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
46 SI_OWNER_RECURSE = 0x00000100,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
47 SI_NO_ACL_PROTECT = 0x00000200,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
48 SI_NO_TREE_APPLY = 0x00000400,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
49 SI_PAGE_TITLE = 0x00000800,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
50 SI_SERVER_IS_DC = 0x00001000,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
51 SI_RESET_DACL_TREE = 0x00004000,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
52 SI_RESET_SACL_TREE = 0x00008000,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
53 SI_OBJECT_GUID = 0x00010000,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
54 SI_EDIT_EFFECTIVE = 0x00020000,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
55 SI_RESET_DACL = 0x00040000,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
56 SI_RESET_SACL = 0x00080000,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
57 SI_RESET_OWNER = 0x00100000,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
58 SI_NO_ADDITIONAL_PERMISSION = 0x00200000,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
59 SI_MAY_WRITE = 0x10000000,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
60 SI_EDIT_ALL = SI_EDIT_PERMS | SI_EDIT_OWNER
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
61 | SI_EDIT_AUDITS;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
62
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
63 struct SI_ACCESS {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
64 CPtr!(GUID) pguid;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
65 ACCESS_MASK mask;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
66 LPCWSTR pszName;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
67 DWORD dwFlags;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
68 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
69 alias SI_ACCESS* PSI_ACCESS;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
70
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
71 // values for SI_ACCESS.dwFlags
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
72 const DWORD
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
73 SI_ACCESS_SPECIFIC = 0x00010000,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
74 SI_ACCESS_GENERAL = 0x00020000,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
75 SI_ACCESS_CONTAINER = 0x00040000,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
76 SI_ACCESS_PROPERTY = 0x00080000;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
77
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
78
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
79 struct SI_INHERIT_TYPE {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
80 CPtr!(GUID) pguid;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
81 ULONG dwFlags;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
82 LPCWSTR pszName;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
83 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
84 alias SI_INHERIT_TYPE* PSI_INHERIT_TYPE;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
85
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
86 /* values for SI_INHERIT_TYPE.dwFlags
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
87 INHERIT_ONLY_ACE, CONTAINER_INHERIT_ACE, OBJECT_INHERIT_ACE
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
88 defined elsewhere */
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
89
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
90 enum SI_PAGE_TYPE {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
91 SI_PAGE_PERM,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
92 SI_PAGE_ADVPERM,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
93 SI_PAGE_AUDIT,
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
94 SI_PAGE_OWNER
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
95 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
96
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
97 const uint PSPCB_SI_INITDIALOG = WM_USER + 1;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
98
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
99 interface ISecurityInformation : IUnknown {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
100 HRESULT GetObjectInformation(PSI_OBJECT_INFO);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
101 HRESULT GetSecurity(SECURITY_INFORMATION, PSECURITY_DESCRIPTOR*, BOOL);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
102 HRESULT SetSecurity(SECURITY_INFORMATION, PSECURITY_DESCRIPTOR);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
103 HRESULT GetAccessRights(CPtr!(GUID), DWORD, PSI_ACCESS*, ULONG*, ULONG*);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
104 HRESULT MapGeneric(CPtr!(GUID), UCHAR*, ACCESS_MASK*);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
105 HRESULT GetInheritTypes(PSI_INHERIT_TYPE*, ULONG*);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
106 HRESULT PropertySheetPageCallback(HWND, UINT, SI_PAGE_TYPE);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
107 }
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
108 alias ISecurityInformation* LPSECURITYINFO;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
109
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
110 /* Comment from MinGW
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
111 * TODO: ISecurityInformation2, IEffectivePermission, ISecurityObjectTypeInfo
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
112 */
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
113
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
114 // FIXME: linkage attribute?
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
115 extern (C) /+DECLSPEC_IMPORT+/ extern const IID IID_ISecurityInformation;
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
116
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
117 extern (Windows) {
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
118 HPROPSHEETPAGE CreateSecurityPage(LPSECURITYINFO psi);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
119 BOOL EditSecurity(HWND hwndOwner, LPSECURITYINFO psi);
4a9dcbd9e54f -files of 0.13 beta
marton@basel.hu
parents:
diff changeset
120 }