[FORMATTING] No code changes!

svn path=/trunk/; revision=36377
This commit is contained in:
Eric Kohl 2008-09-21 13:55:53 +00:00
parent fff44b9cb5
commit b48aef5119
9 changed files with 2116 additions and 2086 deletions

View file

@ -18,12 +18,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(advapi);
*/
BOOL
STDCALL
GetAclInformation (
PACL pAcl,
GetAclInformation(PACL pAcl,
LPVOID pAclInformation,
DWORD nAclInformationLength,
ACL_INFORMATION_CLASS dwAclInformationClass
)
ACL_INFORMATION_CLASS dwAclInformationClass)
{
NTSTATUS Status;
@ -46,11 +44,9 @@ GetAclInformation (
*/
BOOL
STDCALL
InitializeAcl (
PACL pAcl,
InitializeAcl(PACL pAcl,
DWORD nAclLength,
DWORD dwAclRevision
)
DWORD dwAclRevision)
{
NTSTATUS Status;
@ -72,9 +68,7 @@ InitializeAcl (
*/
BOOL
STDCALL
IsValidAcl (
PACL pAcl
)
IsValidAcl(PACL pAcl)
{
return RtlValidAcl (pAcl);
}
@ -85,12 +79,10 @@ IsValidAcl (
*/
BOOL
STDCALL
SetAclInformation (
PACL pAcl,
SetAclInformation(PACL pAcl,
LPVOID pAclInformation,
DWORD nAclInformationLength,
ACL_INFORMATION_CLASS dwAclInformationClass
)
ACL_INFORMATION_CLASS dwAclInformationClass)
{
NTSTATUS Status;
@ -115,12 +107,10 @@ SetAclInformation (
*/
BOOL
STDCALL
AddAccessAllowedAce (
PACL pAcl,
AddAccessAllowedAce(PACL pAcl,
DWORD dwAceRevision,
DWORD AccessMask,
PSID pSid
)
PSID pSid)
{
NTSTATUS Status;
@ -170,8 +160,7 @@ AddAccessAllowedAceEx(PACL pAcl,
*/
BOOL
STDCALL
AddAccessAllowedObjectAce(
PACL pAcl,
AddAccessAllowedObjectAce(PACL pAcl,
DWORD dwAceRevision,
DWORD AceFlags,
DWORD AccessMask,
@ -203,12 +192,10 @@ AddAccessAllowedObjectAce(
*/
BOOL
STDCALL
AddAccessDeniedAce (
PACL pAcl,
AddAccessDeniedAce(PACL pAcl,
DWORD dwAceRevision,
DWORD AccessMask,
PSID pSid
)
PSID pSid)
{
NTSTATUS Status;
@ -258,8 +245,7 @@ AddAccessDeniedAceEx(PACL pAcl,
*/
BOOL
STDCALL
AddAccessDeniedObjectAce(
PACL pAcl,
AddAccessDeniedObjectAce(PACL pAcl,
DWORD dwAceRevision,
DWORD AceFlags,
DWORD AccessMask,
@ -291,13 +277,11 @@ AddAccessDeniedObjectAce(
*/
BOOL
STDCALL
AddAce (
PACL pAcl,
AddAce(PACL pAcl,
DWORD dwAceRevision,
DWORD dwStartingAceIndex,
LPVOID pAceList,
DWORD nAceListLength
)
DWORD nAceListLength)
{
NTSTATUS Status;
@ -321,14 +305,12 @@ AddAce (
*/
BOOL
STDCALL
AddAuditAccessAce (
PACL pAcl,
AddAuditAccessAce(PACL pAcl,
DWORD dwAceRevision,
DWORD dwAccessMask,
PSID pSid,
BOOL bAuditSuccess,
BOOL bAuditFailure
)
BOOL bAuditFailure)
{
NTSTATUS Status;
@ -384,8 +366,7 @@ AddAuditAccessAceEx(PACL pAcl,
*/
BOOL
STDCALL
AddAuditAccessObjectAce(
PACL pAcl,
AddAuditAccessObjectAce(PACL pAcl,
DWORD dwAceRevision,
DWORD AceFlags,
DWORD AccessMask,
@ -450,10 +431,8 @@ AddMandatoryAce(IN OUT PACL pAcl,
*/
BOOL
STDCALL
DeleteAce (
PACL pAcl,
DWORD dwAceIndex
)
DeleteAce(PACL pAcl,
DWORD dwAceIndex)
{
NTSTATUS Status;
@ -474,10 +453,8 @@ DeleteAce (
*/
BOOL
STDCALL
FindFirstFreeAce (
PACL pAcl,
LPVOID * pAce
)
FindFirstFreeAce(PACL pAcl,
LPVOID *pAce)
{
return RtlFirstFreeAce(pAcl,
(PACE*)pAce);
@ -489,11 +466,9 @@ FindFirstFreeAce (
*/
BOOL
STDCALL
GetAce (
PACL pAcl,
GetAce(PACL pAcl,
DWORD dwAceIndex,
LPVOID * pAce
)
LPVOID *pAce)
{
NTSTATUS Status;
@ -515,8 +490,7 @@ GetAce (
*/
DWORD
STDCALL
GetInheritanceSourceW (
LPWSTR pObjectName,
GetInheritanceSourceW(LPWSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
BOOL Container,
@ -525,8 +499,7 @@ GetInheritanceSourceW (
PACL pAcl,
PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL,
PGENERIC_MAPPING pGenericMapping,
PINHERITED_FROMW pInheritArray
)
PINHERITED_FROMW pInheritArray)
{
DWORD ErrorCode;
@ -555,8 +528,7 @@ GetInheritanceSourceW (
*/
DWORD
STDCALL
GetInheritanceSourceA (
LPSTR pObjectName,
GetInheritanceSourceA(LPSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
BOOL Container,
@ -565,8 +537,7 @@ GetInheritanceSourceA (
PACL pAcl,
PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL,
PGENERIC_MAPPING pGenericMapping,
PINHERITED_FROMA pInheritArray
)
PINHERITED_FROMA pInheritArray)
{
/* That's all this function does, at least up to w2k3... Even MS was too
lazy to implement it... */
@ -579,11 +550,9 @@ GetInheritanceSourceA (
*/
DWORD
STDCALL
FreeInheritedFromArray (
PINHERITED_FROMW pInheritArray,
FreeInheritedFromArray(PINHERITED_FROMW pInheritArray,
USHORT AceCnt,
PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL
)
PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL)
{
DWORD ErrorCode;
@ -605,8 +574,7 @@ FreeInheritedFromArray (
*/
DWORD
STDCALL
SetEntriesInAclW(
ULONG cCountOfExplicitEntries,
SetEntriesInAclW(ULONG cCountOfExplicitEntries,
PEXPLICIT_ACCESS_W pListOfExplicitEntries,
PACL OldAcl,
PACL *NewAcl)
@ -1013,8 +981,7 @@ RawTrusteeCopy:
*/
DWORD
STDCALL
SetEntriesInAclA(
ULONG cCountOfExplicitEntries,
SetEntriesInAclA(ULONG cCountOfExplicitEntries,
PEXPLICIT_ACCESS_A pListOfExplicitEntries,
PACL OldAcl,
PACL *NewAcl)
@ -1025,7 +992,6 @@ SetEntriesInAclA(
ErrorCode = InternalExplicitAccessAToW(cCountOfExplicitEntries,
pListOfExplicitEntries,
&ListOfExplicitEntriesW);
if (ErrorCode == ERROR_SUCCESS)
{
ErrorCode = SetEntriesInAclW(cCountOfExplicitEntries,
@ -1048,11 +1014,9 @@ SetEntriesInAclA(
*/
DWORD
STDCALL
GetExplicitEntriesFromAclW(
PACL pacl,
GetExplicitEntriesFromAclW(PACL pacl,
PULONG pcCountOfExplicitEntries,
PEXPLICIT_ACCESS_W* pListOfExplicitEntries
)
PEXPLICIT_ACCESS_W *pListOfExplicitEntries)
{
DWORD ErrorCode;

View file

@ -179,6 +179,7 @@ ObjectCloseAuditAlarmA (LPCSTR SubsystemName,
return TRUE;
}
/*
* @implemented
*/
@ -671,5 +672,4 @@ AccessCheckByTypeAndAuditAlarmA(IN LPCSTR SubsystemName,
return FALSE;
}
/* EOF */

View file

@ -12,7 +12,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(advapi);
/* Needed for LookupAccountNameW implementation from Wine */
typedef struct _AccountSid {
typedef struct _AccountSid
{
WELL_KNOWN_SID_TYPE type;
LPCWSTR account;
LPCWSTR domain;
@ -139,6 +140,7 @@ static PNTMARTA NtMarta = NULL;
return GetLastError(); \
}
static DWORD
LoadAndInitializeNtMarta(VOID)
{
@ -180,6 +182,7 @@ LoadAndInitializeNtMarta(VOID)
return ERROR_SUCCESS;
}
DWORD
CheckNtMartaPresent(VOID)
{
@ -221,7 +224,9 @@ CheckNtMartaPresent(VOID)
return ErrorCode;
}
VOID UnloadNtMarta(VOID)
VOID
UnloadNtMarta(VOID)
{
if (InterlockedExchangePointer(&NtMarta,
NULL) != NULL)
@ -230,29 +235,32 @@ VOID UnloadNtMarta(VOID)
}
}
/******************************************************************************/
/*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
AreAllAccessesGranted(DWORD GrantedAccess,
DWORD DesiredAccess)
{
return((BOOL)RtlAreAllAccessesGranted(GrantedAccess,
DesiredAccess));
return (BOOL)RtlAreAllAccessesGranted(GrantedAccess,
DesiredAccess);
}
/*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
AreAnyAccessesGranted(DWORD GrantedAccess,
DWORD DesiredAccess)
{
return((BOOL)RtlAreAnyAccessesGranted(GrantedAccess,
DesiredAccess));
return (BOOL)RtlAreAnyAccessesGranted(GrantedAccess,
DesiredAccess);
}
@ -278,7 +286,8 @@ AreAnyAccessesGranted(DWORD GrantedAccess,
*
* @implemented
*/
BOOL WINAPI
BOOL
WINAPI
GetFileSecurityA(LPCSTR lpFileName,
SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR pSecurityDescriptor,
@ -312,7 +321,8 @@ GetFileSecurityA(LPCSTR lpFileName,
/*
* @implemented
*/
BOOL WINAPI
BOOL
WINAPI
GetFileSecurityW(LPCWSTR lpFileName,
SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR pSecurityDescriptor,
@ -379,7 +389,6 @@ GetFileSecurityW(LPCWSTR lpFileName,
nLength,
lpnLengthNeeded);
NtClose(FileHandle);
if (!NT_SUCCESS(Status))
{
ERR("NtQuerySecurityObject() failed (Status %lx)\n", Status);
@ -394,7 +403,8 @@ GetFileSecurityW(LPCWSTR lpFileName,
/*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
GetKernelObjectSecurity(HANDLE Handle,
SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR pSecurityDescriptor,
@ -411,9 +421,10 @@ GetKernelObjectSecurity(HANDLE Handle,
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return(FALSE);
return FALSE;
}
return(TRUE);
return TRUE;
}
@ -423,7 +434,8 @@ GetKernelObjectSecurity(HANDLE Handle,
*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
SetFileSecurityA(LPCSTR lpFileName,
SECURITY_INFORMATION SecurityInformation,
PSECURITY_DESCRIPTOR pSecurityDescriptor)
@ -456,7 +468,8 @@ SetFileSecurityA (LPCSTR lpFileName,
*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
SetFileSecurityW(LPCWSTR lpFileName,
SECURITY_INFORMATION SecurityInformation,
PSECURITY_DESCRIPTOR pSecurityDescriptor)
@ -539,7 +552,8 @@ SetFileSecurityW (LPCWSTR lpFileName,
/*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
SetKernelObjectSecurity(HANDLE Handle,
SECURITY_INFORMATION SecurityInformation,
PSECURITY_DESCRIPTOR SecurityDescriptor)
@ -554,6 +568,7 @@ SetKernelObjectSecurity(HANDLE Handle,
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
}
@ -568,7 +583,6 @@ ImpersonateAnonymousToken(IN HANDLE ThreadHandle)
NTSTATUS Status;
Status = NtImpersonateAnonymousToken(ThreadHandle);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
@ -582,7 +596,8 @@ ImpersonateAnonymousToken(IN HANDLE ThreadHandle)
/*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
ImpersonateLoggedOnUser(HANDLE hToken)
{
SECURITY_QUALITY_OF_SERVICE Qos;
@ -665,7 +680,8 @@ ImpersonateLoggedOnUser(HANDLE hToken)
/*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
{
NTSTATUS Status;
@ -676,6 +692,7 @@ ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
}
@ -683,7 +700,8 @@ ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
/*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
RevertToSelf(VOID)
{
NTSTATUS Status;
@ -698,6 +716,7 @@ RevertToSelf(VOID)
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
}
@ -714,8 +733,10 @@ RevertToSelf(VOID)
*
* @implemented
*/
BOOL WINAPI
GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
BOOL
WINAPI
GetUserNameA(LPSTR lpszName,
LPDWORD lpSize)
{
UNICODE_STRING NameW;
ANSI_STRING NameA;
@ -750,6 +771,7 @@ GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
return Ret;
}
/******************************************************************************
* GetUserNameW [ADVAPI32.@]
*
@ -757,8 +779,10 @@ GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
*
* @implemented
*/
BOOL WINAPI
GetUserNameW ( LPWSTR lpszName, LPDWORD lpSize )
BOOL
WINAPI
GetUserNameW(LPWSTR lpszName,
LPDWORD lpSize )
{
HANDLE hToken = INVALID_HANDLE_VALUE;
DWORD tu_len = 0;
@ -862,7 +886,8 @@ GetUserNameW ( LPWSTR lpszName, LPDWORD lpSize )
*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
LookupAccountSidA(LPCSTR lpSystemName,
PSID lpSid,
LPSTR lpName,
@ -1003,8 +1028,7 @@ LookupAccountSidA (LPCSTR lpSystemName,
* @implemented
*/
BOOL WINAPI
LookupAccountSidW (
LPCWSTR pSystemName,
LookupAccountSidW(LPCWSTR pSystemName,
PSID pSid,
LPWSTR pAccountName,
LPDWORD pdwAccountName,
@ -1098,7 +1122,8 @@ LookupAccountSidW (
*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
LookupAccountNameA(LPCSTR SystemName,
LPCSTR AccountName,
PSID Sid,
@ -1116,15 +1141,28 @@ LookupAccountNameA (LPCSTR SystemName,
RtlCreateUnicodeStringFromAsciiz(&lpAccountW, AccountName);
if (ReferencedDomainName)
lpReferencedDomainNameW = HeapAlloc(GetProcessHeap(), 0, *hReferencedDomainNameLength * sizeof(WCHAR));
lpReferencedDomainNameW = HeapAlloc(GetProcessHeap(),
0,
*hReferencedDomainNameLength * sizeof(WCHAR));
ret = LookupAccountNameW(lpSystemW.Buffer, lpAccountW.Buffer, Sid, SidLength, lpReferencedDomainNameW,
hReferencedDomainNameLength, SidNameUse);
ret = LookupAccountNameW(lpSystemW.Buffer,
lpAccountW.Buffer,
Sid,
SidLength,
lpReferencedDomainNameW,
hReferencedDomainNameLength,
SidNameUse);
if (ret && lpReferencedDomainNameW)
{
WideCharToMultiByte(CP_ACP, 0, lpReferencedDomainNameW, *hReferencedDomainNameLength,
ReferencedDomainName, *hReferencedDomainNameLength, NULL, NULL);
WideCharToMultiByte(CP_ACP,
0,
lpReferencedDomainNameW,
*hReferencedDomainNameLength,
ReferencedDomainName,
*hReferencedDomainNameLength,
NULL,
NULL);
}
RtlFreeUnicodeString(&lpSystemW);
@ -1140,9 +1178,15 @@ LookupAccountNameA (LPCSTR SystemName,
*
* @unimplemented
*/
BOOL WINAPI LookupAccountNameW(LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSID Sid,
LPDWORD cbSid, LPWSTR ReferencedDomainName,
LPDWORD cchReferencedDomainName, PSID_NAME_USE peUse)
BOOL
WINAPI
LookupAccountNameW(LPCWSTR lpSystemName,
LPCWSTR lpAccountName,
PSID Sid,
LPDWORD cbSid,
LPWSTR ReferencedDomainName,
LPDWORD cchReferencedDomainName,
PSID_NAME_USE peUse)
{
/* Default implementation: Always return a default SID */
SID_IDENTIFIER_AUTHORITY identifierAuthority = {SECURITY_NT_AUTHORITY};
@ -1184,11 +1228,13 @@ BOOL WINAPI LookupAccountNameW(LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSID
if (Sid != NULL && (*cbSid >= GetLengthSid(pSid)))
CopySid(*cbSid, Sid, pSid);
if (*cbSid < GetLengthSid(pSid))
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
ret = FALSE;
}
*cbSid = GetLengthSid(pSid);
if (ReferencedDomainName != NULL && (*cchReferencedDomainName > wcslen(dm)))
@ -1213,7 +1259,8 @@ BOOL WINAPI LookupAccountNameW(LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSID
*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
LookupPrivilegeValueA(LPCSTR lpSystemName,
LPCSTR lpName,
PLUID lpLuid)
@ -1260,7 +1307,8 @@ LookupPrivilegeValueA (LPCSTR lpSystemName,
*
* @unimplemented
*/
BOOL STDCALL
BOOL
STDCALL
LookupPrivilegeValueW(LPCWSTR SystemName,
LPCWSTR PrivName,
PLUID Luid)
@ -1328,7 +1376,8 @@ LookupPrivilegeValueW (LPCWSTR SystemName,
*
* @unimplemented
*/
BOOL STDCALL
BOOL
STDCALL
LookupPrivilegeDisplayNameA(LPCSTR lpSystemName,
LPCSTR lpName,
LPSTR lpDisplayName,
@ -1346,7 +1395,8 @@ LookupPrivilegeDisplayNameA (LPCSTR lpSystemName,
*
* @unimplemented
*/
BOOL STDCALL
BOOL
STDCALL
LookupPrivilegeDisplayNameW(LPCWSTR lpSystemName,
LPCWSTR lpName,
LPWSTR lpDisplayName,
@ -1364,7 +1414,8 @@ LookupPrivilegeDisplayNameW (LPCWSTR lpSystemName,
*
* @unimplemented
*/
BOOL STDCALL
BOOL
STDCALL
LookupPrivilegeNameA(LPCSTR lpSystemName,
PLUID lpLuid,
LPSTR lpName,
@ -1381,7 +1432,8 @@ LookupPrivilegeNameA (LPCSTR lpSystemName,
*
* @unimplemented
*/
BOOL STDCALL
BOOL
STDCALL
LookupPrivilegeNameW(LPCWSTR lpSystemName,
PLUID lpLuid,
LPWSTR lpName,
@ -1574,7 +1626,8 @@ ProtectSacl:
*
* @implemented
*/
DWORD STDCALL
DWORD
STDCALL
GetNamedSecurityInfoW(LPWSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
@ -1624,7 +1677,8 @@ GetNamedSecurityInfoW(LPWSTR pObjectName,
*
* @implemented
*/
DWORD STDCALL
DWORD
STDCALL
GetNamedSecurityInfoA(LPSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
@ -1665,7 +1719,8 @@ GetNamedSecurityInfoA(LPSTR pObjectName,
*
* @implemented
*/
DWORD STDCALL
DWORD
STDCALL
SetNamedSecurityInfoW(LPWSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
@ -1712,7 +1767,8 @@ SetNamedSecurityInfoW(LPWSTR pObjectName,
*
* @implemented
*/
DWORD STDCALL
DWORD
STDCALL
SetNamedSecurityInfoA(LPSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
@ -1751,7 +1807,8 @@ SetNamedSecurityInfoA(LPSTR pObjectName,
*
* @implemented
*/
DWORD STDCALL
DWORD
STDCALL
GetSecurityInfo(HANDLE handle,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
@ -1847,8 +1904,9 @@ SetSecurityInfo(HANDLE handle,
/******************************************************************************
* GetSecurityInfoExW EXPORTED
*/
DWORD WINAPI GetSecurityInfoExA(
HANDLE hObject,
DWORD
WINAPI
GetSecurityInfoExA(HANDLE hObject,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
LPCSTR lpProvider,
@ -1856,8 +1914,7 @@ DWORD WINAPI GetSecurityInfoExA(
PACTRL_ACCESSA *ppAccessList,
PACTRL_AUDITA *ppAuditList,
LPSTR *lppOwner,
LPSTR *lppGroup
)
LPSTR *lppGroup)
{
FIXME("%s() not implemented!\n", __FUNCTION__);
return ERROR_BAD_PROVIDER;
@ -1867,8 +1924,9 @@ DWORD WINAPI GetSecurityInfoExA(
/******************************************************************************
* GetSecurityInfoExW EXPORTED
*/
DWORD WINAPI GetSecurityInfoExW(
HANDLE hObject,
DWORD
WINAPI
GetSecurityInfoExW(HANDLE hObject,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
LPCWSTR lpProvider,
@ -1876,8 +1934,7 @@ DWORD WINAPI GetSecurityInfoExW(
PACTRL_ACCESSW *ppAccessList,
PACTRL_AUDITW *ppAuditList,
LPWSTR *lppOwner,
LPWSTR *lppGroup
)
LPWSTR *lppGroup)
{
FIXME("%s() not implemented!\n", __FUNCTION__);
return ERROR_BAD_PROVIDER;
@ -1889,7 +1946,8 @@ DWORD WINAPI GetSecurityInfoExW(
*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
ImpersonateNamedPipeClient(HANDLE hNamedPipe)
{
IO_STATUS_BLOCK StatusBlock;
@ -1920,7 +1978,8 @@ ImpersonateNamedPipeClient(HANDLE hNamedPipe)
/*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
CreatePrivateObjectSecurity(PSECURITY_DESCRIPTOR ParentDescriptor,
PSECURITY_DESCRIPTOR CreatorDescriptor,
PSECURITY_DESCRIPTOR *NewDescriptor,
@ -1949,7 +2008,8 @@ CreatePrivateObjectSecurity(PSECURITY_DESCRIPTOR ParentDescriptor,
/*
* @unimplemented
*/
BOOL STDCALL
BOOL
STDCALL
CreatePrivateObjectSecurityEx(PSECURITY_DESCRIPTOR ParentDescriptor,
PSECURITY_DESCRIPTOR CreatorDescriptor,
PSECURITY_DESCRIPTOR* NewDescriptor,
@ -1967,7 +2027,8 @@ CreatePrivateObjectSecurityEx(PSECURITY_DESCRIPTOR ParentDescriptor,
/*
* @unimplemented
*/
BOOL STDCALL
BOOL
STDCALL
CreatePrivateObjectSecurityWithMultipleInheritance(PSECURITY_DESCRIPTOR ParentDescriptor,
PSECURITY_DESCRIPTOR CreatorDescriptor,
PSECURITY_DESCRIPTOR* NewDescriptor,
@ -1986,7 +2047,8 @@ CreatePrivateObjectSecurityWithMultipleInheritance(PSECURITY_DESCRIPTOR ParentDe
/*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
DestroyPrivateObjectSecurity(PSECURITY_DESCRIPTOR *ObjectDescriptor)
{
NTSTATUS Status;
@ -2005,7 +2067,8 @@ DestroyPrivateObjectSecurity(PSECURITY_DESCRIPTOR *ObjectDescriptor)
/*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
GetPrivateObjectSecurity(PSECURITY_DESCRIPTOR ObjectDescriptor,
SECURITY_INFORMATION SecurityInformation,
PSECURITY_DESCRIPTOR ResultantDescriptor,
@ -2032,7 +2095,8 @@ GetPrivateObjectSecurity(PSECURITY_DESCRIPTOR ObjectDescriptor,
/*
* @implemented
*/
BOOL STDCALL
BOOL
STDCALL
SetPrivateObjectSecurity(SECURITY_INFORMATION SecurityInformation,
PSECURITY_DESCRIPTOR ModificationDescriptor,
PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
@ -2059,7 +2123,8 @@ SetPrivateObjectSecurity(SECURITY_INFORMATION SecurityInformation,
/*
* @implemented
*/
DWORD STDCALL
DWORD
STDCALL
TreeResetNamedSecurityInfoW(LPWSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
@ -2191,7 +2256,8 @@ InternalfnProgressW(LPWSTR pObjectName,
/*
* @implemented
*/
DWORD STDCALL
DWORD
STDCALL
TreeResetNamedSecurityInfoA(LPSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,

View file

@ -21,11 +21,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(advapi);
*/
BOOL
STDCALL
GetSecurityDescriptorControl (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSECURITY_DESCRIPTOR_CONTROL pControl,
LPDWORD lpdwRevision
)
LPDWORD lpdwRevision)
{
NTSTATUS Status;
@ -47,12 +45,10 @@ GetSecurityDescriptorControl (
*/
BOOL
STDCALL
GetSecurityDescriptorDacl (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
LPBOOL lpbDaclPresent,
PACL *pDacl,
LPBOOL lpbDaclDefaulted
)
LPBOOL lpbDaclDefaulted)
{
BOOLEAN DaclPresent;
BOOLEAN DaclDefaulted;
@ -80,11 +76,9 @@ GetSecurityDescriptorDacl (
*/
BOOL
STDCALL
GetSecurityDescriptorGroup (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID *pGroup,
LPBOOL lpbGroupDefaulted
)
LPBOOL lpbGroupDefaulted)
{
BOOLEAN GroupDefaulted;
NTSTATUS Status;
@ -109,11 +103,9 @@ GetSecurityDescriptorGroup (
*/
BOOL
STDCALL
GetSecurityDescriptorOwner (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID *pOwner,
LPBOOL lpbOwnerDefaulted
)
LPBOOL lpbOwnerDefaulted)
{
BOOLEAN OwnerDefaulted;
NTSTATUS Status;
@ -138,8 +130,7 @@ GetSecurityDescriptorOwner (
*/
DWORD
STDCALL
GetSecurityDescriptorRMControl (
PSECURITY_DESCRIPTOR SecurityDescriptor,
GetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor,
PUCHAR RMControl)
{
if (!RtlGetSecurityDescriptorRMControl(SecurityDescriptor,
@ -155,12 +146,10 @@ GetSecurityDescriptorRMControl (
*/
BOOL
STDCALL
GetSecurityDescriptorSacl (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
LPBOOL lpbSaclPresent,
PACL *pSacl,
LPBOOL lpbSaclDefaulted
)
LPBOOL lpbSaclDefaulted)
{
BOOLEAN SaclPresent;
BOOLEAN SaclDefaulted;
@ -188,10 +177,8 @@ GetSecurityDescriptorSacl (
*/
BOOL
STDCALL
InitializeSecurityDescriptor (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
DWORD dwRevision
)
InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor,
DWORD dwRevision)
{
NTSTATUS Status;
@ -212,9 +199,7 @@ InitializeSecurityDescriptor (
*/
BOOL
STDCALL
IsValidSecurityDescriptor (
PSECURITY_DESCRIPTOR pSecurityDescriptor
)
IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor)
{
BOOLEAN Result;
@ -231,8 +216,7 @@ IsValidSecurityDescriptor (
*/
BOOL
STDCALL
MakeAbsoluteSD (
PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
MakeAbsoluteSD(PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
LPDWORD lpdwAbsoluteSecurityDescriptorSize,
PACL pDacl,
@ -242,8 +226,7 @@ MakeAbsoluteSD (
PSID pOwner,
LPDWORD lpdwOwnerSize,
PSID pPrimaryGroup,
LPDWORD lpdwPrimaryGroupSize
)
LPDWORD lpdwPrimaryGroupSize)
{
NTSTATUS Status;
@ -295,11 +278,9 @@ MakeAbsoluteSD2(IN OUT PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
*/
BOOL
STDCALL
MakeSelfRelativeSD (
PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
MakeSelfRelativeSD(PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
LPDWORD lpdwBufferLength
)
LPDWORD lpdwBufferLength)
{
NTSTATUS Status;
@ -321,8 +302,7 @@ MakeSelfRelativeSD (
*/
BOOL
STDCALL
SetSecurityDescriptorControl (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet)
{
@ -346,12 +326,10 @@ SetSecurityDescriptorControl (
*/
BOOL
STDCALL
SetSecurityDescriptorDacl (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
BOOL bDaclPresent,
PACL pDacl,
BOOL bDaclDefaulted
)
BOOL bDaclDefaulted)
{
NTSTATUS Status;
@ -374,11 +352,9 @@ SetSecurityDescriptorDacl (
*/
BOOL
STDCALL
SetSecurityDescriptorGroup (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID pGroup,
BOOL bGroupDefaulted
)
BOOL bGroupDefaulted)
{
NTSTATUS Status;
@ -400,11 +376,9 @@ SetSecurityDescriptorGroup (
*/
BOOL
STDCALL
SetSecurityDescriptorOwner (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID pOwner,
BOOL bOwnerDefaulted
)
BOOL bOwnerDefaulted)
{
NTSTATUS Status;
@ -426,8 +400,7 @@ SetSecurityDescriptorOwner (
*/
DWORD
STDCALL
SetSecurityDescriptorRMControl (
PSECURITY_DESCRIPTOR SecurityDescriptor,
SetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor,
PUCHAR RMControl)
{
RtlSetSecurityDescriptorRMControl(SecurityDescriptor,
@ -442,12 +415,10 @@ SetSecurityDescriptorRMControl (
*/
BOOL
STDCALL
SetSecurityDescriptorSacl (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
BOOL bSaclPresent,
PACL pSacl,
BOOL bSaclDefaulted
)
BOOL bSaclDefaulted)
{
NTSTATUS Status;
@ -574,10 +545,12 @@ BOOL WINAPI DecryptFileW(LPCWSTR lpFileName, DWORD dwReserved)
return TRUE;
}
/*
* @implemented
*/
BOOL WINAPI DecryptFileA(LPCSTR lpFileName, DWORD dwReserved)
BOOL WINAPI
DecryptFileA(LPCSTR lpFileName, DWORD dwReserved)
{
UNICODE_STRING FileName;
NTSTATUS Status;
@ -597,20 +570,24 @@ BOOL WINAPI DecryptFileA(LPCSTR lpFileName, DWORD dwReserved)
return ret;
}
/*
* @unimplemented
*/
BOOL WINAPI EncryptFileW(LPCWSTR lpFileName)
BOOL WINAPI
EncryptFileW(LPCWSTR lpFileName)
{
FIXME("%s() not implemented!\n", __FUNCTION__);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return TRUE;
}
/*
* @implemented
*/
BOOL WINAPI EncryptFileA(LPCSTR lpFileName)
BOOL WINAPI
EncryptFileA(LPCSTR lpFileName)
{
UNICODE_STRING FileName;
NTSTATUS Status;
@ -630,8 +607,12 @@ BOOL WINAPI EncryptFileA(LPCSTR lpFileName)
return ret;
}
BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW(
PSECURITY_DESCRIPTOR pSecurityDescriptor,
/*
* @unimplemented
*/
BOOL WINAPI
ConvertSecurityDescriptorToStringSecurityDescriptorW(PSECURITY_DESCRIPTOR pSecurityDescriptor,
DWORD dword,
SECURITY_INFORMATION SecurityInformation,
LPWSTR *lpwstr,
@ -642,8 +623,12 @@ BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW(
return FALSE;
}
BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorA(
PSECURITY_DESCRIPTOR pSecurityDescriptor,
/*
* @unimplemented
*/
BOOL WINAPI
ConvertSecurityDescriptorToStringSecurityDescriptorA(PSECURITY_DESCRIPTOR pSecurityDescriptor,
DWORD dword,
SECURITY_INFORMATION SecurityInformation,
LPSTR *lpstr,

View file

@ -609,6 +609,8 @@ CopySid (DWORD nDestinationSidLength,
return TRUE;
}
/******************************************************************************
* ConvertStringSecurityDescriptorToSecurityDescriptorW [ADVAPI32.@]
* @implemented
@ -945,11 +947,13 @@ IsValidSid (PSID pSid)
return (BOOL)RtlValidSid(pSid);
}
/*
* @implemented
*/
BOOL STDCALL
ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
ConvertSidToStringSidW(PSID Sid,
LPWSTR *StringSid)
{
NTSTATUS Status;
UNICODE_STRING UnicodeString;
@ -969,6 +973,7 @@ ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
{
Status = RtlConvertSidToUnicodeString(&UnicodeString, Sid, TRUE);
}
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
@ -1001,7 +1006,8 @@ ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
* @implemented
*/
BOOL STDCALL
ConvertSidToStringSidA(PSID Sid, LPSTR *StringSid)
ConvertSidToStringSidA(PSID Sid,
LPSTR *StringSid)
{
LPWSTR StringSidW;
int Len;
@ -1018,6 +1024,7 @@ ConvertSidToStringSidA(PSID Sid, LPSTR *StringSid)
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
*StringSid = LocalAlloc(LMEM_FIXED, Len);
if (NULL == *StringSid)
{
@ -1077,22 +1084,27 @@ CreateWellKnownSid(IN WELL_KNOWN_SID_TYPE WellKnownSidType,
int i;
TRACE("(%d, %s, %p, %p)\n", WellKnownSidType, debugstr_sid(DomainSid), pSid, cbSid);
if (DomainSid != NULL) {
if (DomainSid != NULL)
{
FIXME("Only local computer supported!\n");
SetLastError(ERROR_INVALID_PARAMETER); /* FIXME */
return FALSE;
}
if (cbSid == NULL || pSid == NULL) {
if (cbSid == NULL || pSid == NULL)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
for (i = 0; i < sizeof(WellKnownSids)/sizeof(WellKnownSids[0]); i++) {
if (WellKnownSids[i].Type == WellKnownSidType) {
for (i = 0; i < sizeof(WellKnownSids)/sizeof(WellKnownSids[0]); i++)
{
if (WellKnownSids[i].Type == WellKnownSidType)
{
DWORD length = GetSidLengthRequired(WellKnownSids[i].Sid.SubAuthorityCount);
if (*cbSid < length) {
if (*cbSid < length)
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
return FALSE;
}
@ -1119,9 +1131,13 @@ IsWellKnownSid(IN PSID pSid,
TRACE("(%s, %d)\n", debugstr_sid(pSid), WellKnownSidType);
for (i = 0; i < sizeof(WellKnownSids) / sizeof(WellKnownSids[0]); i++)
{
if (WellKnownSids[i].Type == WellKnownSidType)
{
if (EqualSid(pSid, (PSID)((ULONG_PTR)&WellKnownSids[i].Sid.Revision)))
return TRUE;
}
}
return FALSE;
}
@ -1131,8 +1147,7 @@ IsWellKnownSid(IN PSID pSid,
* @implemented
*/
BOOL STDCALL
ConvertStringSidToSidA(
IN LPCSTR StringSid,
ConvertStringSidToSidA(IN LPCSTR StringSid,
OUT PSID* sid)
{
BOOL bRetVal = FALSE;
@ -1150,10 +1165,12 @@ ConvertStringSidToSidA(
return bRetVal;
}
/******************************************************************************
* ComputeStringSidSize
*/
static DWORD ComputeStringSidSize(LPCWSTR StringSid)
static DWORD
ComputeStringSidSize(LPCWSTR StringSid)
{
DWORD size = sizeof(SID);
@ -1229,8 +1246,7 @@ static const RECORD SidTable[] =
* @implemented
*/
BOOL WINAPI
ConvertStringSidToSidW(
IN LPCWSTR StringSid,
ConvertStringSidToSidW(IN LPCWSTR StringSid,
OUT PSID* sid)
{
DWORD size;

View file

@ -131,7 +131,8 @@ BuildImpersonateExplicitAccessWithNameW(PEXPLICIT_ACCESS_W pExplicitAccess,
* BuildTrusteeWithSidA [ADVAPI32.@]
*/
VOID WINAPI
BuildTrusteeWithSidA(PTRUSTEE_A pTrustee, PSID pSid)
BuildTrusteeWithSidA(PTRUSTEE_A pTrustee,
PSID pSid)
{
TRACE("%p %p\n", pTrustee, pSid);
@ -147,7 +148,8 @@ BuildTrusteeWithSidA(PTRUSTEE_A pTrustee, PSID pSid)
* BuildTrusteeWithSidW [ADVAPI32.@]
*/
VOID WINAPI
BuildTrusteeWithSidW(PTRUSTEE_W pTrustee, PSID pSid)
BuildTrusteeWithSidW(PTRUSTEE_W pTrustee,
PSID pSid)
{
TRACE("%p %p\n", pTrustee, pSid);
@ -163,7 +165,8 @@ BuildTrusteeWithSidW(PTRUSTEE_W pTrustee, PSID pSid)
* BuildTrusteeWithNameA [ADVAPI32.@]
*/
VOID WINAPI
BuildTrusteeWithNameA(PTRUSTEE_A pTrustee, LPSTR name)
BuildTrusteeWithNameA(PTRUSTEE_A pTrustee,
LPSTR name)
{
TRACE("%p %s\n", pTrustee, name);
@ -179,7 +182,8 @@ BuildTrusteeWithNameA(PTRUSTEE_A pTrustee, LPSTR name)
* BuildTrusteeWithNameW [ADVAPI32.@]
*/
VOID WINAPI
BuildTrusteeWithNameW(PTRUSTEE_W pTrustee, LPWSTR name)
BuildTrusteeWithNameW(PTRUSTEE_W pTrustee,
LPWSTR name)
{
TRACE("%p %s\n", pTrustee, name);
@ -195,9 +199,12 @@ BuildTrusteeWithNameW(PTRUSTEE_W pTrustee, LPWSTR name)
* BuildTrusteeWithObjectsAndNameA [ADVAPI32.@]
*/
VOID WINAPI
BuildTrusteeWithObjectsAndNameA(PTRUSTEEA pTrustee, POBJECTS_AND_NAME_A pObjName,
SE_OBJECT_TYPE ObjectType, LPSTR ObjectTypeName,
LPSTR InheritedObjectTypeName, LPSTR Name)
BuildTrusteeWithObjectsAndNameA(PTRUSTEEA pTrustee,
POBJECTS_AND_NAME_A pObjName,
SE_OBJECT_TYPE ObjectType,
LPSTR ObjectTypeName,
LPSTR InheritedObjectTypeName,
LPSTR Name)
{
DWORD ObjectsPresent = 0;
@ -233,9 +240,12 @@ BuildTrusteeWithObjectsAndNameA(PTRUSTEEA pTrustee, POBJECTS_AND_NAME_A pObjName
* BuildTrusteeWithObjectsAndNameW [ADVAPI32.@]
*/
VOID WINAPI
BuildTrusteeWithObjectsAndNameW(PTRUSTEEW pTrustee, POBJECTS_AND_NAME_W pObjName,
SE_OBJECT_TYPE ObjectType, LPWSTR ObjectTypeName,
LPWSTR InheritedObjectTypeName, LPWSTR Name)
BuildTrusteeWithObjectsAndNameW(PTRUSTEEW pTrustee,
POBJECTS_AND_NAME_W pObjName,
SE_OBJECT_TYPE ObjectType,
LPWSTR ObjectTypeName,
LPWSTR InheritedObjectTypeName,
LPWSTR Name)
{
DWORD ObjectsPresent = 0;
@ -271,8 +281,11 @@ BuildTrusteeWithObjectsAndNameW(PTRUSTEEW pTrustee, POBJECTS_AND_NAME_W pObjName
* BuildTrusteeWithObjectsAndSidA [ADVAPI32.@]
*/
VOID WINAPI
BuildTrusteeWithObjectsAndSidA(PTRUSTEEA pTrustee, POBJECTS_AND_SID pObjSid,
GUID* pObjectGuid, GUID* pInheritedObjectGuid, PSID pSid)
BuildTrusteeWithObjectsAndSidA(PTRUSTEEA pTrustee,
POBJECTS_AND_SID pObjSid,
GUID *pObjectGuid,
GUID *pInheritedObjectGuid,
PSID pSid)
{
DWORD ObjectsPresent = 0;
@ -317,8 +330,11 @@ BuildTrusteeWithObjectsAndSidA(PTRUSTEEA pTrustee, POBJECTS_AND_SID pObjSid,
* BuildTrusteeWithObjectsAndSidW [ADVAPI32.@]
*/
VOID WINAPI
BuildTrusteeWithObjectsAndSidW(PTRUSTEEW pTrustee, POBJECTS_AND_SID pObjSid,
GUID* pObjectGuid, GUID* pInheritedObjectGuid, PSID pSid)
BuildTrusteeWithObjectsAndSidW(PTRUSTEEW pTrustee,
POBJECTS_AND_SID pObjSid,
GUID *pObjectGuid,
GUID *pInheritedObjectGuid,
PSID pSid)
{
DWORD ObjectsPresent = 0;

View file

@ -40,8 +40,7 @@ static RPC_UNICODE_STRING EmptyString = { 0, 0, L"" };
* BackupEventLogA [ADVAPI32.@]
*/
BOOL WINAPI
BackupEventLogA(
IN HANDLE hEventLog,
BackupEventLogA(IN HANDLE hEventLog,
IN LPCSTR lpBackupFileName)
{
PLOG_INFO pLog;
@ -60,16 +59,16 @@ BackupEventLogA(
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
Status = ElfrBackupELFA(
pLog->BindingHandle,
Status = ElfrBackupELFA(pLog->BindingHandle,
pLog->LogHandle,
&BackupFileName);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
}
@ -81,8 +80,7 @@ BackupEventLogA(
* lpBackupFileName []
*/
BOOL WINAPI
BackupEventLogW(
IN HANDLE hEventLog,
BackupEventLogW(IN HANDLE hEventLog,
IN LPCWSTR lpBackupFileName)
{
PLOG_INFO pLog;
@ -101,16 +99,16 @@ BackupEventLogW(
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
Status = ElfrBackupELFW(
pLog->BindingHandle,
Status = ElfrBackupELFW(pLog->BindingHandle,
pLog->LogHandle,
&BackupFileName);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
}
@ -119,8 +117,7 @@ BackupEventLogW(
* ClearEventLogA [ADVAPI32.@]
*/
BOOL WINAPI
ClearEventLogA(
IN HANDLE hEventLog,
ClearEventLogA(IN HANDLE hEventLog,
IN LPCSTR lpBackupFileName)
{
PLOG_INFO pLog;
@ -139,16 +136,16 @@ ClearEventLogA(
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
Status = ElfrClearELFA(
pLog->BindingHandle,
Status = ElfrClearELFA(pLog->BindingHandle,
pLog->LogHandle,
&BackupFileName);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
}
@ -157,8 +154,7 @@ ClearEventLogA(
* ClearEventLogW [ADVAPI32.@]
*/
BOOL WINAPI
ClearEventLogW(
IN HANDLE hEventLog,
ClearEventLogW(IN HANDLE hEventLog,
IN LPCWSTR lpBackupFileName)
{
PLOG_INFO pLog;
@ -177,16 +173,16 @@ ClearEventLogW(
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
Status = ElfrClearELFW(
pLog->BindingHandle,
Status = ElfrClearELFW(pLog->BindingHandle,
pLog->LogHandle,
&BackupFileName);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
}
@ -195,8 +191,7 @@ ClearEventLogW(
* CloseEventLog [ADVAPI32.@]
*/
BOOL WINAPI
CloseEventLog(
IN HANDLE hEventLog)
CloseEventLog(IN HANDLE hEventLog)
{
PLOG_INFO pLog;
NTSTATUS Status;
@ -217,8 +212,7 @@ CloseEventLog(
}
else
{
Status = ElfrCloseEL(
pLog->BindingHandle,
Status = ElfrCloseEL(pLog->BindingHandle,
&pLog->LogHandle);
if (!NT_SUCCESS(Status))
{
@ -243,8 +237,7 @@ CloseEventLog(
* RETURNS STD
*/
BOOL WINAPI
DeregisterEventSource(
IN HANDLE hEventLog)
DeregisterEventSource(IN HANDLE hEventLog)
{
PLOG_INFO pLog;
NTSTATUS Status;
@ -255,14 +248,14 @@ DeregisterEventSource(
if (!pLog)
return TRUE;
Status = ElfrDeregisterEventSource(
pLog->BindingHandle,
Status = ElfrDeregisterEventSource(pLog->BindingHandle,
&pLog->LogHandle);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
}
@ -275,8 +268,7 @@ DeregisterEventSource(
* NumberOfRecords []
*/
BOOL WINAPI
GetNumberOfEventLogRecords(
IN HANDLE hEventLog,
GetNumberOfEventLogRecords(IN HANDLE hEventLog,
OUT PDWORD NumberOfRecords)
{
PLOG_INFO pLog;
@ -291,8 +283,8 @@ GetNumberOfEventLogRecords(
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
Status = ElfrNumberOfRecords(
pLog->BindingHandle,
Status = ElfrNumberOfRecords(pLog->BindingHandle,
pLog->LogHandle,
&Records);
if (!NT_SUCCESS(Status))
@ -302,6 +294,7 @@ GetNumberOfEventLogRecords(
}
*NumberOfRecords = Records;
return TRUE;
}
@ -314,8 +307,7 @@ GetNumberOfEventLogRecords(
* OldestRecord []
*/
BOOL WINAPI
GetOldestEventLogRecord(
IN HANDLE hEventLog,
GetOldestEventLogRecord(IN HANDLE hEventLog,
OUT PDWORD OldestRecord)
{
PLOG_INFO pLog;
@ -330,8 +322,8 @@ GetOldestEventLogRecord(
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
Status = ElfrOldestRecord(
pLog->BindingHandle,
Status = ElfrOldestRecord(pLog->BindingHandle,
pLog->LogHandle,
&Oldest);
if (!NT_SUCCESS(Status))
@ -341,6 +333,7 @@ GetOldestEventLogRecord(
}
*OldestRecord = Oldest;
return TRUE;
}
@ -353,8 +346,7 @@ GetOldestEventLogRecord(
* hEvent []
*/
BOOL WINAPI
NotifyChangeEventLog(
IN HANDLE hEventLog,
NotifyChangeEventLog(IN HANDLE hEventLog,
IN HANDLE hEvent)
{
/* Use ElfrChangeNotify */
@ -368,8 +360,7 @@ NotifyChangeEventLog(
* OpenBackupEventLogA [ADVAPI32.@]
*/
HANDLE WINAPI
OpenBackupEventLogA(
IN LPCSTR lpUNCServerName,
OpenBackupEventLogA(IN LPCSTR lpUNCServerName,
IN LPCSTR lpFileName)
{
UNICODE_STRING UNCServerName;
@ -383,6 +374,7 @@ OpenBackupEventLogA(
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
if (!RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName))
{
RtlFreeUnicodeString(&UNCServerName);
@ -390,8 +382,7 @@ OpenBackupEventLogA(
return NULL;
}
Handle = OpenBackupEventLogW(
UNCServerName.Buffer,
Handle = OpenBackupEventLogW(UNCServerName.Buffer,
FileName.Buffer);
RtlFreeUnicodeString(&UNCServerName);
@ -409,8 +400,7 @@ OpenBackupEventLogA(
* lpFileName []
*/
HANDLE WINAPI
OpenBackupEventLogW(
IN LPCWSTR lpUNCServerName,
OpenBackupEventLogW(IN LPCWSTR lpUNCServerName,
IN LPCWSTR lpFileName)
{
PLOG_INFO pLog;
@ -429,6 +419,7 @@ OpenBackupEventLogW(
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
ZeroMemory(pLog, sizeof(LOG_INFO));
if (lpUNCServerName == NULL || *lpUNCServerName == 0)
@ -454,20 +445,19 @@ OpenBackupEventLogW(
}
}
Status = ElfrOpenBELW(
pLog->BindingHandle,
Status = ElfrOpenBELW(pLog->BindingHandle,
(LPWSTR)lpUNCServerName,
&FileName,
0,
0,
&pLog->LogHandle);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
HeapFree(GetProcessHeap(), 0, pLog);
return NULL;
}
return pLog;
}
@ -476,8 +466,7 @@ OpenBackupEventLogW(
* OpenEventLogA [ADVAPI32.@]
*/
HANDLE WINAPI
OpenEventLogA(
IN LPCSTR lpUNCServerName,
OpenEventLogA(IN LPCSTR lpUNCServerName,
IN LPCSTR lpSourceName)
{
UNICODE_STRING UNCServerName;
@ -489,6 +478,7 @@ OpenEventLogA(
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
if (!RtlCreateUnicodeStringFromAsciiz(&SourceName, lpSourceName))
{
RtlFreeUnicodeString(&UNCServerName);
@ -496,7 +486,8 @@ OpenEventLogA(
return NULL;
}
Handle = OpenEventLogW(UNCServerName.Buffer, SourceName.Buffer);
Handle = OpenEventLogW(UNCServerName.Buffer,
SourceName.Buffer);
RtlFreeUnicodeString(&UNCServerName);
RtlFreeUnicodeString(&SourceName);
@ -513,8 +504,7 @@ OpenEventLogA(
* lpSourceName []
*/
HANDLE WINAPI
OpenEventLogW(
IN LPCWSTR lpUNCServerName,
OpenEventLogW(IN LPCWSTR lpUNCServerName,
IN LPCWSTR lpSourceName)
{
PLOG_INFO pLog;
@ -533,6 +523,7 @@ OpenEventLogW(
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
ZeroMemory(pLog, sizeof(LOG_INFO));
if (lpUNCServerName == NULL || *lpUNCServerName == 0)
@ -558,21 +549,20 @@ OpenEventLogW(
}
}
Status = ElfrOpenELW(
pLog->BindingHandle,
Status = ElfrOpenELW(pLog->BindingHandle,
(LPWSTR)lpUNCServerName,
&SourceName,
&EmptyString,
0,
0,
&pLog->LogHandle);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
HeapFree(GetProcessHeap(), 0, pLog);
return NULL;
}
return pLog;
}
@ -581,8 +571,7 @@ OpenEventLogW(
* ReadEventLogA [ADVAPI32.@]
*/
BOOL WINAPI
ReadEventLogA(
IN HANDLE hEventLog,
ReadEventLogA(IN HANDLE hEventLog,
IN DWORD dwReadFlags,
IN DWORD dwRecordOffset,
OUT LPVOID lpBuffer,
@ -604,8 +593,8 @@ ReadEventLogA(
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
Status = ElfrReadELA(
pLog->BindingHandle,
Status = ElfrReadELA(pLog->BindingHandle,
pLog->LogHandle,
dwReadFlags,
dwRecordOffset,
@ -621,6 +610,7 @@ ReadEventLogA(
*pnBytesRead = (DWORD)bytesRead;
*pnMinNumberOfBytesNeeded = (DWORD)minNumberOfBytesNeeded;
return TRUE;
}
@ -638,8 +628,7 @@ ReadEventLogA(
* pnMinNumberOfBytesNeeded []
*/
BOOL WINAPI
ReadEventLogW(
IN HANDLE hEventLog,
ReadEventLogW(IN HANDLE hEventLog,
IN DWORD dwReadFlags,
IN DWORD dwRecordOffset,
OUT LPVOID lpBuffer,
@ -661,8 +650,8 @@ ReadEventLogW(
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
Status = ElfrReadELW(
pLog->BindingHandle,
Status = ElfrReadELW(pLog->BindingHandle,
pLog->LogHandle,
dwReadFlags,
dwRecordOffset,
@ -678,6 +667,7 @@ ReadEventLogW(
*pnBytesRead = (DWORD)bytesRead;
*pnMinNumberOfBytesNeeded = (DWORD)minNumberOfBytesNeeded;
return TRUE;
}
@ -686,8 +676,7 @@ ReadEventLogW(
* RegisterEventSourceA [ADVAPI32.@]
*/
HANDLE WINAPI
RegisterEventSourceA(
IN LPCSTR lpUNCServerName,
RegisterEventSourceA(IN LPCSTR lpUNCServerName,
IN LPCSTR lpSourceName)
{
UNICODE_STRING UNCServerName;
@ -701,6 +690,7 @@ RegisterEventSourceA(
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
if (!RtlCreateUnicodeStringFromAsciiz(&SourceName, lpSourceName))
{
RtlFreeUnicodeString(&UNCServerName);
@ -708,7 +698,8 @@ RegisterEventSourceA(
return NULL;
}
Handle = RegisterEventSourceW(UNCServerName.Buffer, SourceName.Buffer);
Handle = RegisterEventSourceW(UNCServerName.Buffer,
SourceName.Buffer);
RtlFreeUnicodeString(&UNCServerName);
RtlFreeUnicodeString(&SourceName);
@ -730,8 +721,7 @@ RegisterEventSourceA(
* Failure: NULL
*/
HANDLE WINAPI
RegisterEventSourceW(
IN LPCWSTR lpUNCServerName,
RegisterEventSourceW(IN LPCWSTR lpUNCServerName,
IN LPCWSTR lpSourceName)
{
PLOG_INFO pLog;
@ -750,6 +740,7 @@ RegisterEventSourceW(
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
ZeroMemory(pLog, sizeof(LOG_INFO));
if (lpUNCServerName == NULL || *lpUNCServerName == 0)
@ -775,21 +766,20 @@ RegisterEventSourceW(
}
}
Status = ElfrRegisterEventSourceW(
pLog->BindingHandle,
Status = ElfrRegisterEventSourceW(pLog->BindingHandle,
(LPWSTR)lpUNCServerName,
&SourceName,
&EmptyString,
0,
0,
&pLog->LogHandle);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
HeapFree(GetProcessHeap(), 0, pLog);
return NULL;
}
return pLog;
}
@ -798,8 +788,7 @@ RegisterEventSourceW(
* ReportEventA [ADVAPI32.@]
*/
BOOL WINAPI
ReportEventA(
IN HANDLE hEventLog,
ReportEventA(IN HANDLE hEventLog,
IN WORD wType,
IN WORD wCategory,
IN DWORD dwEventID,
@ -820,8 +809,7 @@ ReportEventA(
if (lpStrings == NULL)
return TRUE;
wideStrArray = HeapAlloc(
GetProcessHeap(),
wideStrArray = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY,
sizeof(LPCWSTR) * wNumStrings);
@ -834,8 +822,7 @@ ReportEventA(
if (i == wNumStrings)
{
ret = ReportEventW(
hEventLog,
ret = ReportEventW(hEventLog,
wType,
wCategory,
dwEventID,
@ -855,15 +842,13 @@ ReportEventA(
{
if (wideStrArray[i])
{
HeapFree(
GetProcessHeap(),
HeapFree(GetProcessHeap(),
0,
(PVOID)wideStrArray[i]);
}
}
HeapFree(
GetProcessHeap(),
HeapFree(GetProcessHeap(),
0,
wideStrArray);
@ -886,8 +871,7 @@ ReportEventA(
* lpRawData []
*/
BOOL WINAPI
ReportEventW(
IN HANDLE hEventLog,
ReportEventW(IN HANDLE hEventLog,
IN WORD wType,
IN WORD wCategory,
IN DWORD dwEventID,
@ -914,8 +898,7 @@ ReportEventW(
return FALSE;
}
Strings = HeapAlloc(
GetProcessHeap(),
Strings = HeapAlloc(GetProcessHeap(),
0,
wNumStrings * sizeof(UNICODE_STRING));
if (!Strings)
@ -923,11 +906,11 @@ ReportEventW(
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
for (i = 0; i < wNumStrings; i++)
RtlInitUnicodeString(&Strings[i], lpStrings[i]);
Status = ElfrReportEventW(
pLog->BindingHandle,
Status = ElfrReportEventW(pLog->BindingHandle,
pLog->LogHandle,
0, /* FIXME: Time */
wType,
@ -949,6 +932,7 @@ ReportEventW(
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
#else
int i;

View file

@ -66,13 +66,16 @@ AdjustTokenPrivileges (HANDLE TokenHandle,
SetLastError(ERROR_NOT_ALL_ASSIGNED);
return TRUE;
}
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
SetLastError(ERROR_SUCCESS); /* AdjustTokenPrivileges is documented to do this */
/* AdjustTokenPrivileges is documented to do this */
SetLastError(ERROR_SUCCESS);
return TRUE;
}
@ -230,7 +233,7 @@ SetThreadToken (IN PHANDLE ThreadHandle OPTIONAL,
NTSTATUS Status;
HANDLE hThread;
hThread = ((ThreadHandle != NULL) ? *ThreadHandle : NtCurrentThread());
hThread = (ThreadHandle != NULL) ? *ThreadHandle : NtCurrentThread();
Status = NtSetInformationThread(hThread,
ThreadImpersonationToken,
@ -476,7 +479,6 @@ CheckTokenMembership(IN HANDLE ExistingTokenHandle,
&PrivBufferSize,
&GrantedAccess,
&AccessStatus);
if (NT_SUCCESS(Status) && NT_SUCCESS(AccessStatus) && (GrantedAccess == 0x1))
{
*IsMember = TRUE;
@ -518,7 +520,6 @@ IsTokenRestricted(HANDLE TokenHandle)
/* determine the required buffer size and allocate enough memory to read the
list of restricted SIDs */
Status = NtQueryInformationToken(TokenHandle,
TokenRestrictedSids,
NULL,
@ -541,7 +542,6 @@ AllocAndReadRestrictedSids:
}
/* actually read the list of the restricted SIDs */
Status = NtQueryInformationToken(TokenHandle,
TokenRestrictedSids,
lpGroups,
@ -554,7 +554,6 @@ AllocAndReadRestrictedSids:
else if (Status == STATUS_BUFFER_TOO_SMALL)
{
/* looks like the token was modified in the meanwhile, let's just try again */
HeapFree(GetProcessHeap(),
0,
lpGroups);
@ -567,7 +566,6 @@ AllocAndReadRestrictedSids:
}
/* free allocated memory */
HeapFree(GetProcessHeap(),
0,
lpGroups);
@ -575,9 +573,9 @@ AllocAndReadRestrictedSids:
return Ret;
}
BOOL STDCALL
CreateRestrictedToken(
HANDLE TokenHandle,
CreateRestrictedToken(HANDLE TokenHandle,
DWORD Flags,
DWORD DisableSidCount,
PSID_AND_ATTRIBUTES pSidAndAttributes,
@ -585,13 +583,13 @@ CreateRestrictedToken(
PLUID_AND_ATTRIBUTES pLUIDAndAttributes,
DWORD RestrictedSidCount,
PSID_AND_ATTRIBUTES pSIDAndAttributes,
PHANDLE NewTokenHandle
)
PHANDLE NewTokenHandle)
{
UNIMPLEMENTED;
return FALSE;
}
/*
* @unimplemented
*/
@ -670,6 +668,7 @@ GetSiteSidFromToken(IN HANDLE TokenHandle)
return PSiteSid;
}
BOOL
WINAPI
CreateProcessWithTokenW(IN HANDLE hToken,