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