advapi32: Move access control functions to kernelbase.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-06-25 12:36:14 +02:00
parent 0ded440242
commit de406c70e5
4 changed files with 330 additions and 437 deletions

View File

@ -4,10 +4,10 @@
@ stdcall A_SHAUpdate(ptr ptr long) ntdll.A_SHAUpdate
@ stdcall AbortSystemShutdownA(ptr)
@ stdcall AbortSystemShutdownW(ptr)
@ stdcall AccessCheck(ptr long long ptr ptr ptr ptr ptr)
@ stdcall -import AccessCheck(ptr long long ptr ptr ptr ptr ptr)
@ stdcall AccessCheckAndAuditAlarmA(str ptr str str ptr long ptr long ptr ptr ptr)
@ stdcall AccessCheckAndAuditAlarmW(wstr ptr wstr wstr ptr long ptr long ptr ptr ptr)
@ stdcall AccessCheckByType(ptr ptr long long ptr long ptr ptr ptr ptr ptr)
@ stdcall -import AccessCheckAndAuditAlarmW(wstr ptr wstr wstr ptr long ptr long ptr ptr ptr)
@ stdcall -import AccessCheckByType(ptr ptr long long ptr long ptr ptr ptr ptr ptr)
# @ stub AccessCheckByTypeAndAuditAlarmA
# @ stub AccessCheckByTypeAndAuditAlarmW
# @ stub AccessCheckByTypeResultList
@ -15,26 +15,26 @@
# @ stub AccessCheckByTypeResultListAndAuditAlarmByHandleA
# @ stub AccessCheckByTypeResultListAndAuditAlarmByHandleW
# @ stub AccessCheckByTypeResultListAndAuditAlarmW
@ stdcall AddAccessAllowedAce (ptr long long ptr)
@ stdcall AddAccessAllowedAceEx (ptr long long long ptr)
@ stdcall AddAccessAllowedObjectAce(ptr long long long ptr ptr ptr)
@ stdcall AddAccessDeniedAce(ptr long long ptr)
@ stdcall AddAccessDeniedAceEx(ptr long long long ptr)
@ stdcall AddAccessDeniedObjectAce(ptr long long long ptr ptr ptr)
@ stdcall AddAce(ptr long long ptr long)
@ stdcall AddAuditAccessAce(ptr long long ptr long long)
@ stdcall AddAuditAccessAceEx(ptr long long long ptr long long)
@ stdcall AddAuditAccessObjectAce(ptr long long long ptr ptr ptr long long)
@ stdcall -import AddAccessAllowedAce (ptr long long ptr)
@ stdcall -import AddAccessAllowedAceEx (ptr long long long ptr)
@ stdcall -import AddAccessAllowedObjectAce(ptr long long long ptr ptr ptr)
@ stdcall -import AddAccessDeniedAce(ptr long long ptr)
@ stdcall -import AddAccessDeniedAceEx(ptr long long long ptr)
@ stdcall -import AddAccessDeniedObjectAce(ptr long long long ptr ptr ptr)
@ stdcall -import AddAce(ptr long long ptr long)
@ stdcall -import AddAuditAccessAce(ptr long long ptr long long)
@ stdcall -import AddAuditAccessAceEx(ptr long long long ptr long long)
@ stdcall -import AddAuditAccessObjectAce(ptr long long long ptr ptr ptr long long)
# @ stub AddConditionalAce
@ stdcall AddMandatoryAce(ptr long long long ptr)
@ stdcall -import AddMandatoryAce(ptr long long long ptr)
# @ stub AddUsersToEncryptedFile
# @ stub AddUsersToEncryptedFileEx
@ stdcall -import AdjustTokenGroups(long long ptr long ptr ptr)
@ stdcall -import AdjustTokenPrivileges(long long ptr long ptr ptr)
@ stdcall -import AllocateAndInitializeSid(ptr long long long long long long long long long ptr)
@ stdcall -import AllocateLocallyUniqueId(ptr)
@ stdcall AreAllAccessesGranted(long long)
@ stdcall AreAnyAccessesGranted(long long)
@ stdcall -import AreAllAccessesGranted(long long)
@ stdcall -import AreAnyAccessesGranted(long long)
# @ stub AuditComputeEffectivePolicyBySid
# @ stub AuditComputeEffectivePolicyByToken
# @ stub AuditEnumerateCategories
@ -234,7 +234,7 @@
# @ stub CveEventWrite
@ stdcall DecryptFileA(str long)
@ stdcall DecryptFileW(wstr long)
@ stdcall DeleteAce(ptr long)
@ stdcall -import DeleteAce(ptr long)
@ stdcall DeleteService(long)
@ stdcall DeregisterEventSource(long)
@ stdcall -import DestroyPrivateObjectSecurity(ptr)
@ -301,7 +301,7 @@
@ stdcall EventWriteTransfer(int64 ptr ptr ptr long ptr) ntdll.EtwEventWriteTransfer
@ stdcall FileEncryptionStatusA(str ptr)
@ stdcall FileEncryptionStatusW(wstr ptr)
@ stdcall FindFirstFreeAce(ptr ptr)
@ stdcall -import FindFirstFreeAce(ptr ptr)
# @ stub FlushEfsCache
@ stdcall FlushTraceA(int64 str ptr)
@ stdcall FlushTraceW(int64 wstr ptr)
@ -312,8 +312,8 @@
@ stdcall -import FreeSid(ptr)
# @ stub GetAccessPermissionsForObjectA
# @ stub GetAccessPermissionsForObjectW
@ stdcall GetAce(ptr long ptr)
@ stdcall GetAclInformation(ptr ptr long long)
@ stdcall -import GetAce(ptr long ptr)
@ stdcall -import GetAclInformation(ptr ptr long long)
@ stdcall GetAuditedPermissionsFromAclA(ptr ptr ptr ptr)
@ stdcall GetAuditedPermissionsFromAclW(ptr ptr ptr ptr)
@ stdcall GetCurrentHwProfileA(ptr)
@ -402,7 +402,7 @@
@ stdcall -import ImpersonateLoggedOnUser(long)
@ stdcall -import ImpersonateNamedPipeClient(long)
@ stdcall -import ImpersonateSelf(long)
@ stdcall InitializeAcl(ptr long long)
@ stdcall -import InitializeAcl(ptr long long)
@ stdcall -import InitializeSecurityDescriptor(ptr long)
@ stdcall -import InitializeSid(ptr ptr long)
@ stdcall InitiateShutdownA(str str long long long)
@ -416,7 +416,7 @@
@ stdcall IsTextUnicode(ptr long ptr)
@ stdcall -import IsTokenRestricted(long)
# @ stub IsTokenUntrusted
@ stdcall IsValidAcl(ptr)
@ stdcall -import IsValidAcl(ptr)
# @ stub IsValidRelativeSecurityDescriptor
@ stdcall -import IsValidSecurityDescriptor(ptr)
@ stdcall -import IsValidSid(ptr)
@ -521,7 +521,7 @@
@ stdcall -import MakeAbsoluteSD(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr)
# @ stub MakeAbsoluteSD2
@ stdcall -import MakeSelfRelativeSD(ptr ptr ptr)
@ stdcall MapGenericMask(ptr ptr)
@ stdcall -import MapGenericMask(ptr ptr)
@ stdcall NotifyBootConfigStatus(long)
@ stdcall NotifyChangeEventLog (long long)
# @ stub NotifyServiceStatusChange
@ -529,13 +529,13 @@
@ stdcall NotifyServiceStatusChangeW(ptr long ptr)
# @ stub NpGetUserName
@ stdcall ObjectCloseAuditAlarmA(str ptr long)
@ stdcall ObjectCloseAuditAlarmW(wstr ptr long)
@ stdcall -import ObjectCloseAuditAlarmW(wstr ptr long)
# @ stub ObjectDeleteAuditAlarmA
@ stdcall ObjectDeleteAuditAlarmW(wstr ptr long)
@ stdcall -import ObjectDeleteAuditAlarmW(wstr ptr long)
@ stdcall ObjectOpenAuditAlarmA(str ptr str str ptr long long long ptr long long ptr)
@ stdcall ObjectOpenAuditAlarmW(wstr ptr wstr wstr ptr long long long ptr long long ptr)
@ stdcall -import ObjectOpenAuditAlarmW(wstr ptr wstr wstr ptr long long long ptr long long ptr)
@ stdcall ObjectPrivilegeAuditAlarmA(str ptr long long ptr long)
@ stdcall ObjectPrivilegeAuditAlarmW(wstr ptr long long ptr long)
@ stdcall -import ObjectPrivilegeAuditAlarmW(wstr ptr long long ptr long)
@ stdcall OpenBackupEventLogA (str str)
@ stdcall OpenBackupEventLogW (wstr wstr)
@ stdcall OpenEncryptedFileRawA(str long ptr)
@ -584,7 +584,7 @@
@ stdcall PerfStopProvider(long)
@ stdcall -import PrivilegeCheck(ptr ptr ptr)
@ stdcall PrivilegedServiceAuditAlarmA(str str long ptr long)
@ stdcall PrivilegedServiceAuditAlarmW(wstr wstr long ptr long)
@ stdcall -import PrivilegedServiceAuditAlarmW(wstr wstr long ptr long)
# @ stub ProcessIdleTasks
# @ stub ProcessIdleTasksW
@ stdcall ProcessTrace(ptr long ptr ptr)
@ -731,7 +731,7 @@
# @ stub SaferiRecordEventLogEntry
# @ stub SaferiReplaceProcessThreadTokens
# @ stub SaferiSearchMatchingHashRules
@ stdcall SetAclInformation(ptr ptr long long)
@ stdcall -import SetAclInformation(ptr ptr long long)
# @ stub SetEncryptedFileMetadata
# @ stub SetEntriesInAccessListA
# @ stub SetEntriesInAccessListW

View File

@ -390,14 +390,6 @@ const char * debugstr_sid(PSID sid)
return "(too-big)";
}
/* set last error code from NT status and get the proper boolean return value */
/* used for functions that are a simple wrapper around the corresponding ntdll API */
static inline BOOL set_ntstatus( NTSTATUS status )
{
if (status) SetLastError( RtlNtStatusToDosError( status ));
return !status;
}
/* helper function for SE_FILE_OBJECT objects in [Get|Set]NamedSecurityInfo */
static inline DWORD get_security_file( LPCWSTR full_file_name, DWORD access, HANDLE *file )
{
@ -693,168 +685,6 @@ done:
}
/* ##############################
###### ACL FUNCTIONS ######
##############################
*/
/*************************************************************************
* InitializeAcl [ADVAPI32.@]
*/
BOOL WINAPI InitializeAcl(PACL acl, DWORD size, DWORD rev)
{
return set_ntstatus( RtlCreateAcl(acl, size, rev));
}
/******************************************************************************
* AddAccessAllowedAce [ADVAPI32.@]
*/
BOOL WINAPI AddAccessAllowedAce(
IN OUT PACL pAcl,
IN DWORD dwAceRevision,
IN DWORD AccessMask,
IN PSID pSid)
{
return set_ntstatus(RtlAddAccessAllowedAce(pAcl, dwAceRevision, AccessMask, pSid));
}
/******************************************************************************
* AddAccessAllowedAceEx [ADVAPI32.@]
*/
BOOL WINAPI AddAccessAllowedAceEx(
IN OUT PACL pAcl,
IN DWORD dwAceRevision,
IN DWORD AceFlags,
IN DWORD AccessMask,
IN PSID pSid)
{
return set_ntstatus(RtlAddAccessAllowedAceEx(pAcl, dwAceRevision, AceFlags, AccessMask, pSid));
}
/******************************************************************************
* AddAccessAllowedObjectAce [ADVAPI32.@]
*/
BOOL WINAPI AddAccessAllowedObjectAce(
IN OUT PACL pAcl,
IN DWORD dwAceRevision,
IN DWORD dwAceFlags,
IN DWORD dwAccessMask,
IN GUID* pObjectTypeGuid,
IN GUID* pInheritedObjectTypeGuid,
IN PSID pSid)
{
return set_ntstatus(RtlAddAccessAllowedObjectAce(pAcl, dwAceRevision, dwAceFlags, dwAccessMask,
pObjectTypeGuid, pInheritedObjectTypeGuid, pSid));
}
/******************************************************************************
* AddAccessDeniedAce [ADVAPI32.@]
*/
BOOL WINAPI AddAccessDeniedAce(
IN OUT PACL pAcl,
IN DWORD dwAceRevision,
IN DWORD AccessMask,
IN PSID pSid)
{
return set_ntstatus(RtlAddAccessDeniedAce(pAcl, dwAceRevision, AccessMask, pSid));
}
/******************************************************************************
* AddAccessDeniedAceEx [ADVAPI32.@]
*/
BOOL WINAPI AddAccessDeniedAceEx(
IN OUT PACL pAcl,
IN DWORD dwAceRevision,
IN DWORD AceFlags,
IN DWORD AccessMask,
IN PSID pSid)
{
return set_ntstatus(RtlAddAccessDeniedAceEx(pAcl, dwAceRevision, AceFlags, AccessMask, pSid));
}
/******************************************************************************
* AddAccessDeniedObjectAce [ADVAPI32.@]
*/
BOOL WINAPI AddAccessDeniedObjectAce(
IN OUT PACL pAcl,
IN DWORD dwAceRevision,
IN DWORD dwAceFlags,
IN DWORD dwAccessMask,
IN GUID* pObjectTypeGuid,
IN GUID* pInheritedObjectTypeGuid,
IN PSID pSid)
{
return set_ntstatus( RtlAddAccessDeniedObjectAce(pAcl, dwAceRevision, dwAceFlags, dwAccessMask,
pObjectTypeGuid, pInheritedObjectTypeGuid, pSid) );
}
/******************************************************************************
* AddAce [ADVAPI32.@]
*/
BOOL WINAPI AddAce(
IN OUT PACL pAcl,
IN DWORD dwAceRevision,
IN DWORD dwStartingAceIndex,
LPVOID pAceList,
DWORD nAceListLength)
{
return set_ntstatus(RtlAddAce(pAcl, dwAceRevision, dwStartingAceIndex, pAceList, nAceListLength));
}
/******************************************************************************
* AddMandatoryAce [ADVAPI32.@]
*/
BOOL WINAPI AddMandatoryAce(ACL *acl, DWORD ace_revision, DWORD ace_flags, DWORD mandatory_policy, PSID label_sid)
{
return set_ntstatus(RtlAddMandatoryAce(acl, ace_revision, ace_flags, mandatory_policy,
SYSTEM_MANDATORY_LABEL_ACE_TYPE, label_sid));
}
/******************************************************************************
* DeleteAce [ADVAPI32.@]
*/
BOOL WINAPI DeleteAce(PACL pAcl, DWORD dwAceIndex)
{
return set_ntstatus(RtlDeleteAce(pAcl, dwAceIndex));
}
/******************************************************************************
* FindFirstFreeAce [ADVAPI32.@]
*/
BOOL WINAPI FindFirstFreeAce(IN PACL pAcl, LPVOID * pAce)
{
return RtlFirstFreeAce(pAcl, (PACE_HEADER *)pAce);
}
/******************************************************************************
* GetAce [ADVAPI32.@]
*/
BOOL WINAPI GetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce )
{
return set_ntstatus(RtlGetAce(pAcl, dwAceIndex, pAce));
}
/******************************************************************************
* GetAclInformation [ADVAPI32.@]
*/
BOOL WINAPI GetAclInformation(
PACL pAcl,
LPVOID pAclInformation,
DWORD nAclInformationLength,
ACL_INFORMATION_CLASS dwAclInformationClass)
{
return set_ntstatus(RtlQueryInformationAcl(pAcl, pAclInformation,
nAclInformationLength, dwAclInformationClass));
}
/******************************************************************************
* IsValidAcl [ADVAPI32.@]
*/
BOOL WINAPI IsValidAcl(IN PACL pAcl)
{
return RtlValidAcl(pAcl);
}
static const WCHAR SE_CREATE_TOKEN_NAME_W[] =
{ 'S','e','C','r','e','a','t','e','T','o','k','e','n','P','r','i','v','i','l','e','g','e',0 };
static const WCHAR SE_ASSIGNPRIMARYTOKEN_NAME_W[] =
@ -1519,120 +1349,6 @@ NotifyBootConfigStatus( BOOL x1 )
return TRUE;
}
/******************************************************************************
* AccessCheck [ADVAPI32.@]
*/
BOOL WINAPI
AccessCheck(
PSECURITY_DESCRIPTOR SecurityDescriptor,
HANDLE ClientToken,
DWORD DesiredAccess,
PGENERIC_MAPPING GenericMapping,
PPRIVILEGE_SET PrivilegeSet,
LPDWORD PrivilegeSetLength,
LPDWORD GrantedAccess,
LPBOOL AccessStatus)
{
NTSTATUS access_status;
BOOL ret = set_ntstatus( NtAccessCheck(SecurityDescriptor, ClientToken, DesiredAccess,
GenericMapping, PrivilegeSet, PrivilegeSetLength,
GrantedAccess, &access_status) );
if (ret) *AccessStatus = set_ntstatus( access_status );
return ret;
}
/******************************************************************************
* AccessCheckByType [ADVAPI32.@]
*/
BOOL WINAPI AccessCheckByType(
PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID PrincipalSelfSid,
HANDLE ClientToken,
DWORD DesiredAccess,
POBJECT_TYPE_LIST ObjectTypeList,
DWORD ObjectTypeListLength,
PGENERIC_MAPPING GenericMapping,
PPRIVILEGE_SET PrivilegeSet,
LPDWORD PrivilegeSetLength,
LPDWORD GrantedAccess,
LPBOOL AccessStatus)
{
FIXME("stub\n");
*AccessStatus = TRUE;
return !*AccessStatus;
}
/******************************************************************************
* MapGenericMask [ADVAPI32.@]
*
* Maps generic access rights into specific access rights according to the
* supplied mapping.
*
* PARAMS
* AccessMask [I/O] Access rights.
* GenericMapping [I] The mapping between generic and specific rights.
*
* RETURNS
* Nothing.
*/
VOID WINAPI MapGenericMask( PDWORD AccessMask, PGENERIC_MAPPING GenericMapping )
{
RtlMapGenericMask( AccessMask, GenericMapping );
}
/******************************************************************************
* AddAuditAccessAce [ADVAPI32.@]
*/
BOOL WINAPI AddAuditAccessAce(
IN OUT PACL pAcl,
IN DWORD dwAceRevision,
IN DWORD dwAccessMask,
IN PSID pSid,
IN BOOL bAuditSuccess,
IN BOOL bAuditFailure)
{
return set_ntstatus( RtlAddAuditAccessAce(pAcl, dwAceRevision, dwAccessMask, pSid,
bAuditSuccess, bAuditFailure) );
}
/******************************************************************************
* AddAuditAccessAceEx [ADVAPI32.@]
*/
BOOL WINAPI AddAuditAccessAceEx(
IN OUT PACL pAcl,
IN DWORD dwAceRevision,
IN DWORD dwAceFlags,
IN DWORD dwAccessMask,
IN PSID pSid,
IN BOOL bAuditSuccess,
IN BOOL bAuditFailure)
{
return set_ntstatus( RtlAddAuditAccessAceEx(pAcl, dwAceRevision, dwAceFlags, dwAccessMask, pSid,
bAuditSuccess, bAuditFailure) );
}
/******************************************************************************
* AddAuditAccessObjectAce [ADVAPI32.@]
*/
BOOL WINAPI AddAuditAccessObjectAce(
IN OUT PACL pAcl,
IN DWORD dwAceRevision,
IN DWORD dwAceFlags,
IN DWORD dwAccessMask,
IN GUID* pObjectTypeGuid,
IN GUID* pInheritedObjectTypeGuid,
IN PSID pSid,
IN BOOL bAuditSuccess,
IN BOOL bAuditFailure)
{
return set_ntstatus( RtlAddAuditAccessObjectAce(pAcl, dwAceRevision, dwAceFlags, dwAccessMask,
pObjectTypeGuid, pInheritedObjectTypeGuid, pSid, bAuditSuccess, bAuditFailure) );
}
/******************************************************************************
* LookupAccountNameA [ADVAPI32.@]
*/
@ -2005,21 +1721,6 @@ BOOL WINAPI AccessCheckAndAuditAlarmA(LPCSTR Subsystem, LPVOID HandleId, LPSTR O
return TRUE;
}
/******************************************************************************
* AccessCheckAndAuditAlarmW [ADVAPI32.@]
*/
BOOL WINAPI AccessCheckAndAuditAlarmW(LPCWSTR Subsystem, LPVOID HandleId, LPWSTR ObjectTypeName,
LPWSTR ObjectName, PSECURITY_DESCRIPTOR SecurityDescriptor, DWORD DesiredAccess,
PGENERIC_MAPPING GenericMapping, BOOL ObjectCreation, LPDWORD GrantedAccess,
LPBOOL AccessStatus, LPBOOL pfGenerateOnClose)
{
FIXME("stub (%s,%p,%s,%s,%p,%08x,%p,%x,%p,%p,%p)\n", debugstr_w(Subsystem),
HandleId, debugstr_w(ObjectTypeName), debugstr_w(ObjectName),
SecurityDescriptor, DesiredAccess, GenericMapping,
ObjectCreation, GrantedAccess, AccessStatus, pfGenerateOnClose);
return TRUE;
}
BOOL WINAPI ObjectCloseAuditAlarmA(LPCSTR SubsystemName, LPVOID HandleId, BOOL GenerateOnClose)
{
FIXME("stub (%s,%p,%x)\n", debugstr_a(SubsystemName), HandleId, GenerateOnClose);
@ -2027,20 +1728,6 @@ BOOL WINAPI ObjectCloseAuditAlarmA(LPCSTR SubsystemName, LPVOID HandleId, BOOL G
return TRUE;
}
BOOL WINAPI ObjectCloseAuditAlarmW(LPCWSTR SubsystemName, LPVOID HandleId, BOOL GenerateOnClose)
{
FIXME("stub (%s,%p,%x)\n", debugstr_w(SubsystemName), HandleId, GenerateOnClose);
return TRUE;
}
BOOL WINAPI ObjectDeleteAuditAlarmW(LPCWSTR SubsystemName, LPVOID HandleId, BOOL GenerateOnClose)
{
FIXME("stub (%s,%p,%x)\n", debugstr_w(SubsystemName), HandleId, GenerateOnClose);
return TRUE;
}
BOOL WINAPI ObjectOpenAuditAlarmA(LPCSTR SubsystemName, LPVOID HandleId, LPSTR ObjectTypeName,
LPSTR ObjectName, PSECURITY_DESCRIPTOR pSecurityDescriptor, HANDLE ClientToken, DWORD DesiredAccess,
DWORD GrantedAccess, PPRIVILEGE_SET Privileges, BOOL ObjectCreation, BOOL AccessGranted,
@ -2054,19 +1741,6 @@ BOOL WINAPI ObjectOpenAuditAlarmA(LPCSTR SubsystemName, LPVOID HandleId, LPSTR O
return TRUE;
}
BOOL WINAPI ObjectOpenAuditAlarmW(LPCWSTR SubsystemName, LPVOID HandleId, LPWSTR ObjectTypeName,
LPWSTR ObjectName, PSECURITY_DESCRIPTOR pSecurityDescriptor, HANDLE ClientToken, DWORD DesiredAccess,
DWORD GrantedAccess, PPRIVILEGE_SET Privileges, BOOL ObjectCreation, BOOL AccessGranted,
LPBOOL GenerateOnClose)
{
FIXME("stub (%s,%p,%s,%s,%p,%p,0x%08x,0x%08x,%p,%x,%x,%p)\n", debugstr_w(SubsystemName),
HandleId, debugstr_w(ObjectTypeName), debugstr_w(ObjectName), pSecurityDescriptor,
ClientToken, DesiredAccess, GrantedAccess, Privileges, ObjectCreation, AccessGranted,
GenerateOnClose);
return TRUE;
}
BOOL WINAPI ObjectPrivilegeAuditAlarmA( LPCSTR SubsystemName, LPVOID HandleId, HANDLE ClientToken,
DWORD DesiredAccess, PPRIVILEGE_SET Privileges, BOOL AccessGranted)
{
@ -2076,15 +1750,6 @@ BOOL WINAPI ObjectPrivilegeAuditAlarmA( LPCSTR SubsystemName, LPVOID HandleId, H
return TRUE;
}
BOOL WINAPI ObjectPrivilegeAuditAlarmW( LPCWSTR SubsystemName, LPVOID HandleId, HANDLE ClientToken,
DWORD DesiredAccess, PPRIVILEGE_SET Privileges, BOOL AccessGranted)
{
FIXME("stub (%s,%p,%p,0x%08x,%p,%x)\n", debugstr_w(SubsystemName), HandleId, ClientToken,
DesiredAccess, Privileges, AccessGranted);
return TRUE;
}
BOOL WINAPI PrivilegedServiceAuditAlarmA( LPCSTR SubsystemName, LPCSTR ServiceName, HANDLE ClientToken,
PPRIVILEGE_SET Privileges, BOOL AccessGranted)
{
@ -2094,15 +1759,6 @@ BOOL WINAPI PrivilegedServiceAuditAlarmA( LPCSTR SubsystemName, LPCSTR ServiceNa
return TRUE;
}
BOOL WINAPI PrivilegedServiceAuditAlarmW( LPCWSTR SubsystemName, LPCWSTR ServiceName, HANDLE ClientToken,
PPRIVILEGE_SET Privileges, BOOL AccessGranted)
{
FIXME("stub %s,%s,%p,%p,%x)\n", debugstr_w(SubsystemName), debugstr_w(ServiceName),
ClientToken, Privileges, AccessGranted);
return TRUE;
}
/******************************************************************************
* GetSecurityInfo [ADVAPI32.@]
*
@ -2571,16 +2227,6 @@ TRUSTEE_TYPE WINAPI GetTrusteeTypeW(PTRUSTEEW pTrustee)
return pTrustee->TrusteeType;
}
BOOL WINAPI SetAclInformation( PACL pAcl, LPVOID pAclInformation,
DWORD nAclInformationLength,
ACL_INFORMATION_CLASS dwAclInformationClass )
{
FIXME("%p %p 0x%08x 0x%08x - stub\n", pAcl, pAclInformation,
nAclInformationLength, dwAclInformationClass);
return TRUE;
}
static DWORD trustee_name_A_to_W(TRUSTEE_FORM form, char *trustee_nameA, WCHAR **ptrustee_nameW)
{
switch (form)
@ -2993,31 +2639,6 @@ DWORD WINAPI SetNamedSecurityInfoA(LPSTR pObjectName,
return r;
}
BOOL WINAPI AreAllAccessesGranted( DWORD GrantedAccess, DWORD DesiredAccess )
{
return RtlAreAllAccessesGranted( GrantedAccess, DesiredAccess );
}
/******************************************************************************
* AreAnyAccessesGranted [ADVAPI32.@]
*
* Determines whether or not any of a set of specified access permissions have
* been granted or not.
*
* PARAMS
* GrantedAccess [I] The permissions that have been granted.
* DesiredAccess [I] The permissions that you want to have.
*
* RETURNS
* Nonzero if any of the permissions have been granted, zero if none of the
* permissions have been granted.
*/
BOOL WINAPI AreAnyAccessesGranted( DWORD GrantedAccess, DWORD DesiredAccess )
{
return RtlAreAnyAccessesGranted( GrantedAccess, DesiredAccess );
}
/******************************************************************************
* SetNamedSecurityInfoW [ADVAPI32.@]
*/

View File

@ -1,6 +1,6 @@
@ stdcall AccessCheck(ptr long long ptr ptr ptr ptr ptr) advapi32.AccessCheck
@ stdcall AccessCheckAndAuditAlarmW(wstr ptr wstr wstr ptr long ptr long ptr ptr ptr) advapi32.AccessCheckAndAuditAlarmW
@ stdcall AccessCheckByType(ptr ptr long long ptr long ptr ptr ptr ptr ptr) advapi32.AccessCheckByType
@ stdcall AccessCheck(ptr long long ptr ptr ptr ptr ptr)
@ stdcall AccessCheckAndAuditAlarmW(wstr ptr wstr wstr ptr long ptr long ptr ptr ptr)
@ stdcall AccessCheckByType(ptr ptr long long ptr long ptr ptr ptr ptr ptr)
@ stub AccessCheckByTypeAndAuditAlarmW
@ stub AccessCheckByTypeResultList
@ stub AccessCheckByTypeResultListAndAuditAlarmByHandleW
@ -9,18 +9,18 @@
@ stdcall AcquireSRWLockShared(ptr) kernel32.AcquireSRWLockShared
# @ stub AcquireStateLock
@ stdcall ActivateActCtx(ptr ptr) kernel32.ActivateActCtx
@ stdcall AddAccessAllowedAce(ptr long long ptr) advapi32.AddAccessAllowedAce
@ stdcall AddAccessAllowedAceEx(ptr long long long ptr) advapi32.AddAccessAllowedAceEx
@ stdcall AddAccessAllowedObjectAce(ptr long long long ptr ptr ptr) advapi32.AddAccessAllowedObjectAce
@ stdcall AddAccessDeniedAce(ptr long long ptr) advapi32.AddAccessDeniedAce
@ stdcall AddAccessDeniedAceEx(ptr long long long ptr) advapi32.AddAccessDeniedAceEx
@ stdcall AddAccessDeniedObjectAce(ptr long long long ptr ptr ptr) advapi32.AddAccessDeniedObjectAce
@ stdcall AddAce(ptr long long ptr long) advapi32.AddAce
@ stdcall AddAuditAccessAce(ptr long long ptr long long) advapi32.AddAuditAccessAce
@ stdcall AddAuditAccessAceEx(ptr long long long ptr long long) advapi32.AddAuditAccessAceEx
@ stdcall AddAuditAccessObjectAce(ptr long long long ptr ptr ptr long long) advapi32.AddAuditAccessObjectAce
@ stdcall AddAccessAllowedAce(ptr long long ptr)
@ stdcall AddAccessAllowedAceEx(ptr long long long ptr)
@ stdcall AddAccessAllowedObjectAce(ptr long long long ptr ptr ptr)
@ stdcall AddAccessDeniedAce(ptr long long ptr)
@ stdcall AddAccessDeniedAceEx(ptr long long long ptr)
@ stdcall AddAccessDeniedObjectAce(ptr long long long ptr ptr ptr)
@ stdcall AddAce(ptr long long ptr long)
@ stdcall AddAuditAccessAce(ptr long long ptr long long)
@ stdcall AddAuditAccessAceEx(ptr long long long ptr long long)
@ stdcall AddAuditAccessObjectAce(ptr long long long ptr ptr ptr long long)
@ stdcall AddDllDirectory(wstr) kernel32.AddDllDirectory
@ stdcall AddMandatoryAce(ptr long long long ptr) advapi32.AddMandatoryAce
@ stdcall AddMandatoryAce(ptr long long long ptr)
@ stdcall AddRefActCtx(ptr) kernel32.AddRefActCtx
# @ stub AddResourceAttributeAce
# @ stub AddSIDToBoundaryDescriptor
@ -62,8 +62,8 @@
# @ stub AppXReleaseAppXContext
# @ stub AppXUpdatePackageCapabilities
# @ stub ApplicationUserModelIdFromProductId
@ stdcall AreAllAccessesGranted(long long) advapi32.AreAllAccessesGranted
@ stdcall AreAnyAccessesGranted(long long) advapi32.AreAnyAccessesGranted
@ stdcall AreAllAccessesGranted(long long)
@ stdcall AreAnyAccessesGranted(long long)
@ stdcall AreFileApisANSI() kernel32.AreFileApisANSI
# @ stub AreThereVisibleLogoffScriptsInternal
# @ stub AreThereVisibleShutdownScriptsInternal
@ -246,7 +246,7 @@
@ stdcall DefineDosDeviceW(long wstr wstr) kernel32.DefineDosDeviceW
@ stdcall DelayLoadFailureHook(str str) kernel32.DelayLoadFailureHook
# @ stub DelayLoadFailureHookLookup
@ stdcall DeleteAce(ptr long) advapi32.DeleteAce
@ stdcall DeleteAce(ptr long)
# @ stub DeleteBoundaryDescriptor
@ stdcall DeleteCriticalSection(ptr) kernel32.DeleteCriticalSection
@ stdcall DeleteFiber(ptr) kernel32.DeleteFiber
@ -359,7 +359,7 @@
@ stdcall FindFirstFileExW(wstr long ptr long ptr long) kernel32.FindFirstFileExW
# @ stub FindFirstFileNameW
@ stdcall FindFirstFileW(wstr ptr) kernel32.FindFirstFileW
@ stdcall FindFirstFreeAce(ptr ptr) advapi32.FindFirstFreeAce
@ stdcall FindFirstFreeAce(ptr ptr)
@ stdcall FindFirstStreamW(wstr long ptr long) kernel32.FindFirstStreamW
@ stdcall FindFirstVolumeW(ptr long) kernel32.FindFirstVolumeW
@ stub FindNLSString
@ -405,8 +405,8 @@
@ stdcall GetACP() kernel32.GetACP
@ stdcall GetAcceptLanguagesA(ptr ptr)
@ stdcall GetAcceptLanguagesW(ptr ptr)
@ stdcall GetAce(ptr long ptr) advapi32.GetAce
@ stdcall GetAclInformation(ptr ptr long long) advapi32.GetAclInformation
@ stdcall GetAce(ptr long ptr)
@ stdcall GetAclInformation(ptr ptr long long)
# @ stub GetAdjustObjectAttributesForPrivateNamespaceRoutine
# @ stub GetAlternatePackageRoots
# @ stub GetAppContainerAce
@ -798,7 +798,7 @@
@ stdcall InitOnceComplete(ptr long ptr) kernel32.InitOnceComplete
@ stdcall InitOnceExecuteOnce(ptr ptr ptr ptr) kernel32.InitOnceExecuteOnce
@ stdcall InitOnceInitialize(ptr) kernel32.InitOnceInitialize
@ stdcall InitializeAcl(ptr long long) advapi32.InitializeAcl
@ stdcall InitializeAcl(ptr long long)
@ stdcall InitializeConditionVariable(ptr) kernel32.InitializeConditionVariable
# @ stub InitializeContext
@ stdcall InitializeCriticalSection(ptr) kernel32.InitializeCriticalSection
@ -874,7 +874,7 @@
@ stdcall IsThreadpoolTimerSet(ptr) kernel32.IsThreadpoolTimerSet
# @ stub IsTimeZoneRedirectionEnabled
@ stdcall IsTokenRestricted(long)
@ stdcall IsValidAcl(ptr) advapi32.IsValidAcl
@ stdcall IsValidAcl(ptr)
@ stdcall IsValidCodePage(long) kernel32.IsValidCodePage
@ stdcall IsValidLanguageGroup(long long) kernel32.IsValidLanguageGroup
@ stdcall IsValidLocale(long long) kernel32.IsValidLocale
@ -947,7 +947,7 @@
@ stdcall MakeAbsoluteSD(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr)
@ stub MakeAbsoluteSD2
@ stdcall MakeSelfRelativeSD(ptr ptr ptr)
@ stdcall MapGenericMask(ptr ptr) advapi32.MapGenericMask
@ stdcall MapGenericMask(ptr ptr)
# @ stub MapPredefinedHandleInternal
@ stdcall MapUserPhysicalPages(ptr long ptr) kernel32.MapUserPhysicalPages
@ stdcall MapViewOfFile(long long long long long) kernel32.MapViewOfFile
@ -976,10 +976,10 @@
@ stdcall NormalizeString(long wstr long ptr long) kernel32.NormalizeString
@ stub NotifyMountMgr
@ stub NotifyRedirectedStringChange
@ stdcall ObjectCloseAuditAlarmW(wstr ptr long) advapi32.ObjectCloseAuditAlarmW
@ stdcall ObjectDeleteAuditAlarmW(wstr ptr long) advapi32.ObjectDeleteAuditAlarmW
@ stdcall ObjectOpenAuditAlarmW(wstr ptr wstr wstr ptr long long long ptr long long ptr) advapi32.ObjectOpenAuditAlarmW
@ stdcall ObjectPrivilegeAuditAlarmW(wstr ptr long long ptr long) advapi32.ObjectPrivilegeAuditAlarmW
@ stdcall ObjectCloseAuditAlarmW(wstr ptr long)
@ stdcall ObjectDeleteAuditAlarmW(wstr ptr long)
@ stdcall ObjectOpenAuditAlarmW(wstr ptr wstr wstr ptr long long long ptr long long ptr)
@ stdcall ObjectPrivilegeAuditAlarmW(wstr ptr long long ptr long)
# @ stub OfferVirtualMemory
@ stdcall OpenEventA(long long str) kernel32.OpenEventA
@ stdcall OpenEventW(long long wstr) kernel32.OpenEventW
@ -1164,7 +1164,7 @@
# @ stub PrefetchVirtualMemory
@ stub PrivCopyFileExW
@ stdcall PrivilegeCheck(ptr ptr ptr)
@ stdcall PrivilegedServiceAuditAlarmW(wstr wstr long ptr long) advapi32.PrivilegedServiceAuditAlarmW
@ stdcall PrivilegedServiceAuditAlarmW(wstr wstr long ptr long)
@ stdcall ProcessIdToSessionId(long ptr) kernel32.ProcessIdToSessionId
# @ stub ProductIdFromPackageFamilyName
# @ stub PsmCreateKey
@ -1388,7 +1388,7 @@
@ stdcall ScrollConsoleScreenBufferW(long ptr ptr ptr ptr) kernel32.ScrollConsoleScreenBufferW
@ stdcall SearchPathA(str str str long ptr ptr) kernel32.SearchPathA
@ stdcall SearchPathW(wstr wstr wstr long ptr ptr) kernel32.SearchPathW
@ stdcall SetAclInformation(ptr ptr long long) advapi32.SetAclInformation
@ stdcall SetAclInformation(ptr ptr long long)
# @ stub SetCachedSigningLevel
@ stdcall SetCalendarInfoW(long long long wstr) kernel32.SetCalendarInfoW
# @ stub SetClientDynamicTimeZoneInformation

View File

@ -1196,3 +1196,275 @@ BOOL WINAPI SetSecurityDescriptorSacl ( PSECURITY_DESCRIPTOR descr, BOOL present
{
return set_ntstatus( RtlSetSaclSecurityDescriptor( descr, present, sacl, defaulted ));
}
/******************************************************************************
* Access control functions
******************************************************************************/
/******************************************************************************
* AccessCheck (kernelbase.@)
*/
BOOL WINAPI AccessCheck( PSECURITY_DESCRIPTOR descr, HANDLE token, DWORD access, PGENERIC_MAPPING mapping,
PPRIVILEGE_SET priv, LPDWORD priv_len, LPDWORD granted, LPBOOL status )
{
NTSTATUS access_status;
BOOL ret = set_ntstatus( NtAccessCheck( descr, token, access, mapping, priv, priv_len,
granted, &access_status ));
if (ret) *status = set_ntstatus( access_status );
return ret;
}
/******************************************************************************
* AccessCheckAndAuditAlarmW (kernelbase.@)
*/
BOOL WINAPI AccessCheckAndAuditAlarmW( LPCWSTR subsystem, LPVOID id, LPWSTR type_name,
LPWSTR name, PSECURITY_DESCRIPTOR descr, DWORD access,
PGENERIC_MAPPING mapping, BOOL creation,
LPDWORD granted, LPBOOL status, LPBOOL on_close )
{
FIXME( "stub (%s,%p,%s,%s,%p,%08x,%p,%x,%p,%p,%p)\n", debugstr_w(subsystem),
id, debugstr_w(type_name), debugstr_w(name), descr, access, mapping,
creation, granted, status, on_close );
return TRUE;
}
/******************************************************************************
* AccessCheckByType (kernelbase.@)
*/
BOOL WINAPI AccessCheckByType( PSECURITY_DESCRIPTOR descr, PSID sid, HANDLE token, DWORD access,
POBJECT_TYPE_LIST types, DWORD types_len, PGENERIC_MAPPING mapping,
PPRIVILEGE_SET priv, LPDWORD priv_len, LPDWORD granted, LPBOOL status )
{
FIXME("stub\n");
*status = TRUE;
return !*status;
}
/******************************************************************************
* AddAccessAllowedAce (kernelbase.@)
*/
BOOL WINAPI AddAccessAllowedAce( PACL acl, DWORD rev, DWORD access, PSID sid )
{
return set_ntstatus( RtlAddAccessAllowedAce( acl, rev, access, sid ));
}
/******************************************************************************
* AddAccessAllowedAceEx (kernelbase.@)
*/
BOOL WINAPI AddAccessAllowedAceEx( PACL acl, DWORD rev, DWORD flags, DWORD access, PSID sid )
{
return set_ntstatus( RtlAddAccessAllowedAceEx( acl, rev, flags, access, sid ));
}
/******************************************************************************
* AddAccessAllowedObjectAce (kernelbase.@)
*/
BOOL WINAPI AddAccessAllowedObjectAce( PACL acl, DWORD rev, DWORD flags, DWORD access,
GUID *type, GUID *inherit, PSID sid )
{
return set_ntstatus( RtlAddAccessAllowedObjectAce( acl, rev, flags, access, type, inherit, sid ));
}
/******************************************************************************
* AddAccessDeniedAce (kernelbase.@)
*/
BOOL WINAPI AddAccessDeniedAce( PACL acl, DWORD rev, DWORD access, PSID sid )
{
return set_ntstatus( RtlAddAccessDeniedAce( acl, rev, access, sid ));
}
/******************************************************************************
* AddAccessDeniedAceEx (kernelbase.@)
*/
BOOL WINAPI AddAccessDeniedAceEx( PACL acl, DWORD rev, DWORD flags, DWORD access, PSID sid )
{
return set_ntstatus( RtlAddAccessDeniedAceEx( acl, rev, flags, access, sid ));
}
/******************************************************************************
* AddAccessDeniedObjectAce (kernelbase.@)
*/
BOOL WINAPI AddAccessDeniedObjectAce( PACL acl, DWORD rev, DWORD flags, DWORD access,
GUID *type, GUID *inherit, PSID sid )
{
return set_ntstatus( RtlAddAccessDeniedObjectAce( acl, rev, flags, access, type, inherit, sid ));
}
/******************************************************************************
* AddAce (kernelbase.@)
*/
BOOL WINAPI AddAce( PACL acl, DWORD rev, DWORD index, LPVOID list, DWORD len )
{
return set_ntstatus( RtlAddAce( acl, rev, index, list, len ));
}
/******************************************************************************
* AddAuditAccessAce (kernelbase.@)
*/
BOOL WINAPI AddAuditAccessAce( PACL acl, DWORD rev, DWORD access, PSID sid, BOOL success, BOOL failure )
{
return set_ntstatus( RtlAddAuditAccessAce( acl, rev, access, sid, success, failure ));
}
/******************************************************************************
* AddAuditAccessAceEx (kernelbase.@)
*/
BOOL WINAPI AddAuditAccessAceEx( PACL acl, DWORD rev, DWORD flags, DWORD access,
PSID sid, BOOL success, BOOL failure )
{
return set_ntstatus( RtlAddAuditAccessAceEx( acl, rev, flags, access, sid, success, failure ));
}
/******************************************************************************
* AddAuditAccessObjectAce (kernelbase.@)
*/
BOOL WINAPI AddAuditAccessObjectAce( PACL acl, DWORD rev, DWORD flags, DWORD access,
GUID *type, GUID *inherit, PSID sid, BOOL success, BOOL failure )
{
return set_ntstatus( RtlAddAuditAccessObjectAce( acl, rev, flags, access,
type, inherit, sid, success, failure ));
}
/******************************************************************************
* AddMandatoryAce (kernelbase.@)
*/
BOOL WINAPI AddMandatoryAce( PACL acl, DWORD rev, DWORD flags, DWORD policy, PSID sid )
{
return set_ntstatus( RtlAddMandatoryAce( acl, rev, flags, policy,
SYSTEM_MANDATORY_LABEL_ACE_TYPE, sid ));
}
/******************************************************************************
* AreAllAccessesGranted (kernelbase.@)
*/
BOOL WINAPI AreAllAccessesGranted( DWORD granted, DWORD desired )
{
return RtlAreAllAccessesGranted( granted, desired );
}
/******************************************************************************
* AreAnyAccessesGranted (kernelbase.@)
*/
BOOL WINAPI AreAnyAccessesGranted( DWORD granted, DWORD desired )
{
return RtlAreAnyAccessesGranted( granted, desired );
}
/******************************************************************************
* DeleteAce (kernelbase.@)
*/
BOOL WINAPI DeleteAce( PACL acl, DWORD index )
{
return set_ntstatus( RtlDeleteAce( acl, index ));
}
/******************************************************************************
* FindFirstFreeAce (kernelbase.@)
*/
BOOL WINAPI FindFirstFreeAce( PACL acl, LPVOID *ace)
{
return RtlFirstFreeAce( acl, (PACE_HEADER *)ace );
}
/******************************************************************************
* GetAce (kernelbase.@)
*/
BOOL WINAPI GetAce( PACL acl, DWORD index, LPVOID *ace )
{
return set_ntstatus( RtlGetAce( acl, index, ace ));
}
/******************************************************************************
* GetAclInformation (kernelbase.@)
*/
BOOL WINAPI GetAclInformation( PACL acl, LPVOID info, DWORD len, ACL_INFORMATION_CLASS class )
{
return set_ntstatus( RtlQueryInformationAcl( acl, info, len, class ));
}
/*************************************************************************
* InitializeAcl (kernelbase.@)
*/
BOOL WINAPI InitializeAcl( PACL acl, DWORD size, DWORD rev )
{
return set_ntstatus( RtlCreateAcl( acl, size, rev ));
}
/******************************************************************************
* IsValidAcl (kernelbase.@)
*/
BOOL WINAPI IsValidAcl( PACL acl )
{
return RtlValidAcl( acl );
}
/******************************************************************************
* MapGenericMask (kernelbase.@)
*/
void WINAPI MapGenericMask( PDWORD access, PGENERIC_MAPPING mapping )
{
RtlMapGenericMask( access, mapping );
}
/******************************************************************************
* ObjectCloseAuditAlarmW (kernelbase.@)
*/
BOOL WINAPI ObjectCloseAuditAlarmW( LPCWSTR subsystem, LPVOID id, BOOL on_close )
{
FIXME( "stub (%s,%p,%x)\n", debugstr_w(subsystem), id, on_close );
return TRUE;
}
/******************************************************************************
* ObjectDeleteAuditAlarmW (kernelbase.@)
*/
BOOL WINAPI ObjectDeleteAuditAlarmW( LPCWSTR subsystem, LPVOID id, BOOL on_close )
{
FIXME( "stub (%s,%p,%x)\n", debugstr_w(subsystem), id, on_close );
return TRUE;
}
/******************************************************************************
* ObjectOpenAuditAlarmW (kernelbase.@)
*/
BOOL WINAPI ObjectOpenAuditAlarmW( LPCWSTR subsystem, LPVOID id, LPWSTR type, LPWSTR name,
PSECURITY_DESCRIPTOR descr, HANDLE token, DWORD desired,
DWORD granted, PPRIVILEGE_SET privs, BOOL creation,
BOOL access, LPBOOL on_close )
{
FIXME( "stub (%s,%p,%s,%s,%p,%p,0x%08x,0x%08x,%p,%x,%x,%p)\n", debugstr_w(subsystem),
id, debugstr_w(type), debugstr_w(name), descr, token, desired, granted,
privs, creation, access, on_close );
return TRUE;
}
/******************************************************************************
* ObjectPrivilegeAuditAlarmW (kernelbase.@)
*/
BOOL WINAPI ObjectPrivilegeAuditAlarmW( LPCWSTR subsystem, LPVOID id, HANDLE token,
DWORD desired, PPRIVILEGE_SET privs, BOOL granted )
{
FIXME( "stub (%s,%p,%p,0x%08x,%p,%x)\n", debugstr_w(subsystem), id, token, desired, privs, granted );
return TRUE;
}
/******************************************************************************
* PrivilegedServiceAuditAlarmW (kernelbase.@)
*/
BOOL WINAPI PrivilegedServiceAuditAlarmW( LPCWSTR subsystem, LPCWSTR service, HANDLE token,
PPRIVILEGE_SET privs, BOOL granted )
{
FIXME( "stub %s,%s,%p,%p,%x)\n", debugstr_w(subsystem), debugstr_w(service), token, privs, granted );
return TRUE;
}
/******************************************************************************
* SetAclInformation (kernelbase.@)
*/
BOOL WINAPI SetAclInformation( PACL acl, LPVOID info, DWORD len, ACL_INFORMATION_CLASS class )
{
FIXME( "%p %p 0x%08x 0x%08x - stub\n", acl, info, len, class );
return TRUE;
}