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