* Sync up to trunk head (r65353).
[reactos.git] / dll / win32 / advapi32 / advapi32.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS System Libraries
4 * FILE: lib/advapi32/advapi32.h
5 * PURPOSE: Win32 Advanced API Libary Header
6 * PROGRAMMER: Alex Ionescu (alex@relsoft.net)
7 */
8 #ifndef __ADVAPI32_H
9 #define __ADVAPI32_H
10
11 /* INCLUDES ******************************************************************/
12
13 /* C Headers */
14 #include <limits.h>
15 #include <stdio.h>
16
17 /* PSDK/NDK Headers */
18 #define WINE_STRICT_PROTOTYPES
19 #define WIN32_NO_STATUS
20 #define WIN32_LEAN_AND_MEAN
21 #define _INC_WINDOWS
22 #define COM_NO_WINDOWS_H
23 #define _WMI_SOURCE_
24 #include <aclapi.h>
25 #include <winsafer.h>
26 #define NTOS_MODE_USER
27 #include <ndk/iofuncs.h>
28 #include <ndk/obfuncs.h>
29 #include <ndk/psfuncs.h>
30 #include <ndk/rtlfuncs.h>
31 #include <ndk/sefuncs.h>
32
33 /* this has to go after the NDK when being used with the NDK */
34 #include <ntsecapi.h>
35
36 #include <services/services.h>
37 #include <svcctl_c.h>
38
39 #include <wine/debug.h>
40 #include <wine/unicode.h>
41
42 #include "wine/crypt.h"
43
44 #ifndef HAS_FN_PROGRESSW
45 #define FN_PROGRESSW FN_PROGRESS
46 #endif
47 #ifndef HAS_FN_PROGRESSA
48 #define FN_PROGRESSA FN_PROGRESS
49 #endif
50
51 /* logon.c */
52
53 NTSTATUS
54 CloseLogonLsaHandle(VOID);
55
56 /* rpc.c */
57
58 RPC_STATUS EvtBindRpc(LPCWSTR pszMachine,
59 RPC_BINDING_HANDLE* BindingHandle);
60 RPC_STATUS EvtUnbindRpc(RPC_BINDING_HANDLE *BindingHandle);
61
62 BOOL
63 EvtGetLocalHandle(RPC_BINDING_HANDLE *BindingHandle);
64 RPC_STATUS EvtUnbindLocalHandle(void);
65
66 /* scm.c */
67 DWORD
68 ScmRpcStatusToWinError(RPC_STATUS Status);
69
70 /* Interface to ntmarta.dll **************************************************/
71
72 typedef struct _NTMARTA
73 {
74 HINSTANCE hDllInstance;
75
76 /* 2CC */PVOID LookupAccountTrustee;
77 /* 2D0 */PVOID LookupAccountName;
78 /* 2D4 */PVOID LookupAccountSid;
79 /* 2D8 */PVOID SetEntriesInAList;
80 /* 2DC */PVOID ConvertAccessToSecurityDescriptor;
81 /* 2E0 */PVOID ConvertSDToAccess;
82 /* 2E4 */PVOID ConvertAclToAccess;
83 /* 2E8 */PVOID GetAccessForTrustee;
84 /* 2EC */PVOID GetExplicitEntries;
85 /* 2F0 */
86 DWORD (WINAPI *RewriteGetNamedRights)(LPWSTR pObjectName,
87 SE_OBJECT_TYPE ObjectType,
88 SECURITY_INFORMATION SecurityInfo,
89 PSID* ppsidOwner,
90 PSID* ppsidGroup,
91 PACL* ppDacl,
92 PACL* ppSacl,
93 PSECURITY_DESCRIPTOR* ppSecurityDescriptor);
94
95 /* 2F4 */
96 DWORD (WINAPI *RewriteSetNamedRights)(LPWSTR pObjectName,
97 SE_OBJECT_TYPE ObjectType,
98 SECURITY_INFORMATION SecurityInfo,
99 PSECURITY_DESCRIPTOR pSecurityDescriptor);
100
101 /*2F8*/
102 DWORD (WINAPI *RewriteGetHandleRights)(HANDLE handle,
103 SE_OBJECT_TYPE ObjectType,
104 SECURITY_INFORMATION SecurityInfo,
105 PSID* ppsidOwner,
106 PSID* ppsidGroup,
107 PACL* ppDacl,
108 PACL* ppSacl,
109 PSECURITY_DESCRIPTOR* ppSecurityDescriptor);
110
111 /* 2FC */
112 DWORD (WINAPI *RewriteSetHandleRights)(HANDLE handle,
113 SE_OBJECT_TYPE ObjectType,
114 SECURITY_INFORMATION SecurityInfo,
115 PSECURITY_DESCRIPTOR pSecurityDescriptor);
116
117 /* 300 */
118 DWORD (WINAPI *RewriteSetEntriesInAcl)(ULONG cCountOfExplicitEntries,
119 PEXPLICIT_ACCESS_W pListOfExplicitEntries,
120 PACL OldAcl,
121 PACL* NewAcl);
122
123 /* 304 */
124 DWORD (WINAPI *RewriteGetExplicitEntriesFromAcl)(PACL pacl,
125 PULONG pcCountOfExplicitEntries,
126 PEXPLICIT_ACCESS_W* pListOfExplicitEntries);
127
128 /* 308 */
129 DWORD (WINAPI *TreeResetNamedSecurityInfo)(LPWSTR pObjectName,
130 SE_OBJECT_TYPE ObjectType,
131 SECURITY_INFORMATION SecurityInfo,
132 PSID pOwner,
133 PSID pGroup,
134 PACL pDacl,
135 PACL pSacl,
136 BOOL KeepExplicit,
137 FN_PROGRESSW fnProgress,
138 PROG_INVOKE_SETTING ProgressInvokeSetting,
139 PVOID Args);
140 /* 30C */
141 DWORD (WINAPI *GetInheritanceSource)(LPWSTR pObjectName,
142 SE_OBJECT_TYPE ObjectType,
143 SECURITY_INFORMATION SecurityInfo,
144 BOOL Container,
145 GUID** pObjectClassGuids,
146 DWORD GuidCount,
147 PACL pAcl,
148 PFN_OBJECT_MGR_FUNCTS pfnArray,
149 PGENERIC_MAPPING pGenericMapping,
150 PINHERITED_FROMW pInheritArray);
151
152 /* 310 */
153 DWORD (WINAPI *FreeIndexArray)(PINHERITED_FROMW pInheritArray,
154 USHORT AceCnt,
155 PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL);
156 } NTMARTA, *PNTMARTA;
157
158 #define AccLookupAccountTrustee NtMartaStatic.LookupAccountTrustee
159 #define AccLookupAccountName NtMartaStatic.LookupAccountName
160 #define AccLookupAccountSid NtMartaStatic.LookupAccountSid
161 #define AccSetEntriesInAList NtMartaStatic.SetEntriesInAList
162 #define AccConvertAccessToSecurityDescriptor NtMartaStatic.ConvertAccessToSecurityDescriptor
163 #define AccConvertSDToAccess NtMartaStatic.ConvertSDToAccess
164 #define AccConvertAclToAccess NtMartaStatic.ConvertAclToAccess
165 #define AccGetAccessForTrustee NtMartaStatic.GetAccessForTrustee
166 #define AccGetExplicitEntries NtMartaStatic.GetExplicitEntries
167 #define AccRewriteGetNamedRights NtMartaStatic.RewriteGetNamedRights
168 #define AccRewriteSetNamedRights NtMartaStatic.RewriteSetNamedRights
169 #define AccRewriteGetHandleRights NtMartaStatic.RewriteGetHandleRights
170 #define AccRewriteSetHandleRights NtMartaStatic.RewriteSetHandleRights
171 #define AccRewriteSetEntriesInAcl NtMartaStatic.RewriteSetEntriesInAcl
172 #define AccRewriteGetExplicitEntriesFromAcl NtMartaStatic.RewriteGetExplicitEntriesFromAcl
173 #define AccTreeResetNamedSecurityInfo NtMartaStatic.TreeResetNamedSecurityInfo
174 #define AccGetInheritanceSource NtMartaStatic.GetInheritanceSource
175 #define AccFreeIndexArray NtMartaStatic.FreeIndexArray
176
177 extern NTMARTA NtMartaStatic;
178
179 DWORD CheckNtMartaPresent(VOID);
180
181 /* heap allocation helpers */
182 static void *heap_alloc( size_t len ) __WINE_ALLOC_SIZE(1);
183 static inline void *heap_alloc( size_t len )
184 {
185 return HeapAlloc( GetProcessHeap(), 0, len );
186 }
187
188 static inline BOOL heap_free( void *mem )
189 {
190 return HeapFree( GetProcessHeap(), 0, mem );
191 }
192
193 #endif /* __ADVAPI32_H */