[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,22 +18,20 @@ 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;
Status = RtlQueryInformationAcl (pAcl,
Status = RtlQueryInformationAcl(pAcl,
pAclInformation,
nAclInformationLength,
dwAclInformationClass);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -46,20 +44,18 @@ GetAclInformation (
*/
BOOL
STDCALL
InitializeAcl (
PACL pAcl,
InitializeAcl(PACL pAcl,
DWORD nAclLength,
DWORD dwAclRevision
)
DWORD dwAclRevision)
{
NTSTATUS Status;
Status = RtlCreateAcl (pAcl,
Status = RtlCreateAcl(pAcl,
nAclLength,
dwAclRevision);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -72,9 +68,7 @@ InitializeAcl (
*/
BOOL
STDCALL
IsValidAcl (
PACL pAcl
)
IsValidAcl(PACL pAcl)
{
return RtlValidAcl (pAcl);
}
@ -85,22 +79,20 @@ IsValidAcl (
*/
BOOL
STDCALL
SetAclInformation (
PACL pAcl,
SetAclInformation(PACL pAcl,
LPVOID pAclInformation,
DWORD nAclInformationLength,
ACL_INFORMATION_CLASS dwAclInformationClass
)
ACL_INFORMATION_CLASS dwAclInformationClass)
{
NTSTATUS Status;
Status = RtlSetInformationAcl (pAcl,
Status = RtlSetInformationAcl(pAcl,
pAclInformation,
nAclInformationLength,
dwAclInformationClass);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -115,22 +107,20 @@ SetAclInformation (
*/
BOOL
STDCALL
AddAccessAllowedAce (
PACL pAcl,
AddAccessAllowedAce(PACL pAcl,
DWORD dwAceRevision,
DWORD AccessMask,
PSID pSid
)
PSID pSid)
{
NTSTATUS Status;
Status = RtlAddAccessAllowedAce (pAcl,
Status = RtlAddAccessAllowedAce(pAcl,
dwAceRevision,
AccessMask,
pSid);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -170,13 +160,12 @@ AddAccessAllowedAceEx(PACL pAcl,
*/
BOOL
STDCALL
AddAccessAllowedObjectAce(
PACL pAcl,
AddAccessAllowedObjectAce(PACL pAcl,
DWORD dwAceRevision,
DWORD AceFlags,
DWORD AccessMask,
GUID* ObjectTypeGuid,
GUID* InheritedObjectTypeGuid,
GUID *ObjectTypeGuid,
GUID *InheritedObjectTypeGuid,
PSID pSid)
{
NTSTATUS Status;
@ -203,22 +192,20 @@ AddAccessAllowedObjectAce(
*/
BOOL
STDCALL
AddAccessDeniedAce (
PACL pAcl,
AddAccessDeniedAce(PACL pAcl,
DWORD dwAceRevision,
DWORD AccessMask,
PSID pSid
)
PSID pSid)
{
NTSTATUS Status;
Status = RtlAddAccessDeniedAce (pAcl,
Status = RtlAddAccessDeniedAce(pAcl,
dwAceRevision,
AccessMask,
pSid);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -258,8 +245,7 @@ AddAccessDeniedAceEx(PACL pAcl,
*/
BOOL
STDCALL
AddAccessDeniedObjectAce(
PACL pAcl,
AddAccessDeniedObjectAce(PACL pAcl,
DWORD dwAceRevision,
DWORD AceFlags,
DWORD AccessMask,
@ -291,24 +277,22 @@ AddAccessDeniedObjectAce(
*/
BOOL
STDCALL
AddAce (
PACL pAcl,
AddAce(PACL pAcl,
DWORD dwAceRevision,
DWORD dwStartingAceIndex,
LPVOID pAceList,
DWORD nAceListLength
)
DWORD nAceListLength)
{
NTSTATUS Status;
Status = RtlAddAce (pAcl,
Status = RtlAddAce(pAcl,
dwAceRevision,
dwStartingAceIndex,
pAceList,
nAceListLength);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -321,18 +305,16 @@ AddAce (
*/
BOOL
STDCALL
AddAuditAccessAce (
PACL pAcl,
AddAuditAccessAce(PACL pAcl,
DWORD dwAceRevision,
DWORD dwAccessMask,
PSID pSid,
BOOL bAuditSuccess,
BOOL bAuditFailure
)
BOOL bAuditFailure)
{
NTSTATUS Status;
Status = RtlAddAuditAccessAce (pAcl,
Status = RtlAddAuditAccessAce(pAcl,
dwAceRevision,
dwAccessMask,
pSid,
@ -340,7 +322,7 @@ AddAuditAccessAce (
bAuditFailure);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -384,13 +366,12 @@ AddAuditAccessAceEx(PACL pAcl,
*/
BOOL
STDCALL
AddAuditAccessObjectAce(
PACL pAcl,
AddAuditAccessObjectAce(PACL pAcl,
DWORD dwAceRevision,
DWORD AceFlags,
DWORD AccessMask,
GUID* ObjectTypeGuid,
GUID* InheritedObjectTypeGuid,
GUID *ObjectTypeGuid,
GUID *InheritedObjectTypeGuid,
PSID pSid,
BOOL bAuditSuccess,
BOOL bAuditFailure)
@ -450,18 +431,16 @@ AddMandatoryAce(IN OUT PACL pAcl,
*/
BOOL
STDCALL
DeleteAce (
PACL pAcl,
DWORD dwAceIndex
)
DeleteAce(PACL pAcl,
DWORD dwAceIndex)
{
NTSTATUS Status;
Status = RtlDeleteAce (pAcl,
Status = RtlDeleteAce(pAcl,
dwAceIndex);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -474,12 +453,10 @@ DeleteAce (
*/
BOOL
STDCALL
FindFirstFreeAce (
PACL pAcl,
LPVOID * pAce
)
FindFirstFreeAce(PACL pAcl,
LPVOID *pAce)
{
return RtlFirstFreeAce (pAcl,
return RtlFirstFreeAce(pAcl,
(PACE*)pAce);
}
@ -489,20 +466,18 @@ FindFirstFreeAce (
*/
BOOL
STDCALL
GetAce (
PACL pAcl,
GetAce(PACL pAcl,
DWORD dwAceIndex,
LPVOID * pAce
)
LPVOID *pAce)
{
NTSTATUS Status;
Status = RtlGetAce (pAcl,
Status = RtlGetAce(pAcl,
dwAceIndex,
pAce);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -515,18 +490,16 @@ GetAce (
*/
DWORD
STDCALL
GetInheritanceSourceW (
LPWSTR pObjectName,
GetInheritanceSourceW(LPWSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
BOOL Container,
GUID** pObjectClassGuids OPTIONAL,
GUID **pObjectClassGuids OPTIONAL,
DWORD GuidCount,
PACL pAcl,
PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL,
PGENERIC_MAPPING pGenericMapping,
PINHERITED_FROMW pInheritArray
)
PINHERITED_FROMW pInheritArray)
{
DWORD ErrorCode;
@ -555,18 +528,16 @@ GetInheritanceSourceW (
*/
DWORD
STDCALL
GetInheritanceSourceA (
LPSTR pObjectName,
GetInheritanceSourceA(LPSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
BOOL Container,
GUID** pObjectClassGuids OPTIONAL,
GUID **pObjectClassGuids OPTIONAL,
DWORD GuidCount,
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,11 +574,10 @@ FreeInheritedFromArray (
*/
DWORD
STDCALL
SetEntriesInAclW(
ULONG cCountOfExplicitEntries,
SetEntriesInAclW(ULONG cCountOfExplicitEntries,
PEXPLICIT_ACCESS_W pListOfExplicitEntries,
PACL OldAcl,
PACL* NewAcl)
PACL *NewAcl)
{
DWORD ErrorCode;
@ -1013,11 +981,10 @@ RawTrusteeCopy:
*/
DWORD
STDCALL
SetEntriesInAclA(
ULONG cCountOfExplicitEntries,
SetEntriesInAclA(ULONG cCountOfExplicitEntries,
PEXPLICIT_ACCESS_A pListOfExplicitEntries,
PACL OldAcl,
PACL* NewAcl)
PACL *NewAcl)
{
PEXPLICIT_ACCESS_W ListOfExplicitEntriesW = NULL;
DWORD ErrorCode;
@ -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

@ -22,7 +22,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(advapi);
* @implemented
*/
BOOL STDCALL
AccessCheckAndAuditAlarmA (LPCSTR SubsystemName,
AccessCheckAndAuditAlarmA(LPCSTR SubsystemName,
LPVOID HandleId,
LPSTR ObjectTypeName,
LPSTR ObjectName,
@ -41,14 +41,14 @@ AccessCheckAndAuditAlarmA (LPCSTR SubsystemName,
BOOLEAN GenerateOnClose;
NTSTATUS Status;
RtlCreateUnicodeStringFromAsciiz (&SubsystemNameU,
RtlCreateUnicodeStringFromAsciiz(&SubsystemNameU,
(PCHAR)SubsystemName);
RtlCreateUnicodeStringFromAsciiz (&ObjectTypeNameU,
RtlCreateUnicodeStringFromAsciiz(&ObjectTypeNameU,
(PCHAR)ObjectTypeName);
RtlCreateUnicodeStringFromAsciiz (&ObjectNameU,
RtlCreateUnicodeStringFromAsciiz(&ObjectNameU,
(PCHAR)ObjectName);
Status = NtAccessCheckAndAuditAlarm (&SubsystemNameU,
Status = NtAccessCheckAndAuditAlarm(&SubsystemNameU,
HandleId,
&ObjectTypeNameU,
&ObjectNameU,
@ -59,22 +59,22 @@ AccessCheckAndAuditAlarmA (LPCSTR SubsystemName,
GrantedAccess,
&LocalAccessStatus,
&GenerateOnClose);
RtlFreeUnicodeString (&SubsystemNameU);
RtlFreeUnicodeString (&ObjectTypeNameU);
RtlFreeUnicodeString (&ObjectNameU);
RtlFreeUnicodeString(&SubsystemNameU);
RtlFreeUnicodeString(&ObjectTypeNameU);
RtlFreeUnicodeString(&ObjectNameU);
*pfGenerateOnClose = (BOOL)GenerateOnClose;
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
if (!NT_SUCCESS (LocalAccessStatus))
{
*AccessStatus = FALSE;
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -88,7 +88,7 @@ AccessCheckAndAuditAlarmA (LPCSTR SubsystemName,
* @implemented
*/
BOOL STDCALL
AccessCheckAndAuditAlarmW (LPCWSTR SubsystemName,
AccessCheckAndAuditAlarmW(LPCWSTR SubsystemName,
LPVOID HandleId,
LPWSTR ObjectTypeName,
LPWSTR ObjectName,
@ -107,14 +107,14 @@ AccessCheckAndAuditAlarmW (LPCWSTR SubsystemName,
BOOLEAN GenerateOnClose;
NTSTATUS Status;
RtlInitUnicodeString (&SubsystemNameU,
RtlInitUnicodeString(&SubsystemNameU,
(PWSTR)SubsystemName);
RtlInitUnicodeString (&ObjectTypeNameU,
RtlInitUnicodeString(&ObjectTypeNameU,
(PWSTR)ObjectTypeName);
RtlInitUnicodeString (&ObjectNameU,
RtlInitUnicodeString(&ObjectNameU,
(PWSTR)ObjectName);
Status = NtAccessCheckAndAuditAlarm (&SubsystemNameU,
Status = NtAccessCheckAndAuditAlarm(&SubsystemNameU,
HandleId,
&ObjectTypeNameU,
&ObjectNameU,
@ -128,16 +128,16 @@ AccessCheckAndAuditAlarmW (LPCWSTR SubsystemName,
*pfGenerateOnClose = (BOOL)GenerateOnClose;
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
if (!NT_SUCCESS (LocalAccessStatus))
if (!NT_SUCCESS(LocalAccessStatus))
{
*AccessStatus = FALSE;
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -151,54 +151,55 @@ AccessCheckAndAuditAlarmW (LPCWSTR SubsystemName,
* @implemented
*/
BOOL STDCALL
ObjectCloseAuditAlarmA (LPCSTR SubsystemName,
ObjectCloseAuditAlarmA(LPCSTR SubsystemName,
LPVOID HandleId,
BOOL GenerateOnClose)
{
UNICODE_STRING Name;
NTSTATUS Status;
Status = RtlCreateUnicodeStringFromAsciiz (&Name,
Status = RtlCreateUnicodeStringFromAsciiz(&Name,
(PCHAR)SubsystemName);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
Status = NtCloseObjectAuditAlarm (&Name,
Status = NtCloseObjectAuditAlarm(&Name,
HandleId,
GenerateOnClose);
RtlFreeUnicodeString(&Name);
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
}
/*
* @implemented
*/
BOOL STDCALL
ObjectCloseAuditAlarmW (LPCWSTR SubsystemName,
ObjectCloseAuditAlarmW(LPCWSTR SubsystemName,
LPVOID HandleId,
BOOL GenerateOnClose)
{
UNICODE_STRING Name;
NTSTATUS Status;
RtlInitUnicodeString (&Name,
RtlInitUnicodeString(&Name,
(PWSTR)SubsystemName);
Status = NtCloseObjectAuditAlarm (&Name,
Status = NtCloseObjectAuditAlarm(&Name,
HandleId,
GenerateOnClose);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -210,28 +211,28 @@ ObjectCloseAuditAlarmW (LPCWSTR SubsystemName,
* @implemented
*/
BOOL STDCALL
ObjectDeleteAuditAlarmA (LPCSTR SubsystemName,
ObjectDeleteAuditAlarmA(LPCSTR SubsystemName,
LPVOID HandleId,
BOOL GenerateOnClose)
{
UNICODE_STRING Name;
NTSTATUS Status;
Status = RtlCreateUnicodeStringFromAsciiz (&Name,
Status = RtlCreateUnicodeStringFromAsciiz(&Name,
(PCHAR)SubsystemName);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
Status = NtDeleteObjectAuditAlarm (&Name,
Status = NtDeleteObjectAuditAlarm(&Name,
HandleId,
GenerateOnClose);
RtlFreeUnicodeString(&Name);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -243,22 +244,22 @@ ObjectDeleteAuditAlarmA (LPCSTR SubsystemName,
* @implemented
*/
BOOL STDCALL
ObjectDeleteAuditAlarmW (LPCWSTR SubsystemName,
ObjectDeleteAuditAlarmW(LPCWSTR SubsystemName,
LPVOID HandleId,
BOOL GenerateOnClose)
{
UNICODE_STRING Name;
NTSTATUS Status;
RtlInitUnicodeString (&Name,
RtlInitUnicodeString(&Name,
(PWSTR)SubsystemName);
Status = NtDeleteObjectAuditAlarm (&Name,
Status = NtDeleteObjectAuditAlarm(&Name,
HandleId,
GenerateOnClose);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -270,7 +271,7 @@ ObjectDeleteAuditAlarmW (LPCWSTR SubsystemName,
* @implemented
*/
BOOL STDCALL
ObjectOpenAuditAlarmA (LPCSTR SubsystemName,
ObjectOpenAuditAlarmA(LPCSTR SubsystemName,
LPVOID HandleId,
LPSTR ObjectTypeName,
LPSTR ObjectName,
@ -288,14 +289,14 @@ ObjectOpenAuditAlarmA (LPCSTR SubsystemName,
UNICODE_STRING ObjectNameU;
NTSTATUS Status;
RtlCreateUnicodeStringFromAsciiz (&SubsystemNameU,
RtlCreateUnicodeStringFromAsciiz(&SubsystemNameU,
(PCHAR)SubsystemName);
RtlCreateUnicodeStringFromAsciiz (&ObjectTypeNameU,
RtlCreateUnicodeStringFromAsciiz(&ObjectTypeNameU,
(PCHAR)ObjectTypeName);
RtlCreateUnicodeStringFromAsciiz (&ObjectNameU,
RtlCreateUnicodeStringFromAsciiz(&ObjectNameU,
(PCHAR)ObjectName);
Status = NtOpenObjectAuditAlarm (&SubsystemNameU,
Status = NtOpenObjectAuditAlarm(&SubsystemNameU,
HandleId,
&ObjectTypeNameU,
&ObjectNameU,
@ -307,12 +308,12 @@ ObjectOpenAuditAlarmA (LPCSTR SubsystemName,
ObjectCreation,
AccessGranted,
(PBOOLEAN)GenerateOnClose);
RtlFreeUnicodeString (&SubsystemNameU);
RtlFreeUnicodeString (&ObjectTypeNameU);
RtlFreeUnicodeString (&ObjectNameU);
if (!NT_SUCCESS (Status))
RtlFreeUnicodeString(&SubsystemNameU);
RtlFreeUnicodeString(&ObjectTypeNameU);
RtlFreeUnicodeString(&ObjectNameU);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -324,7 +325,7 @@ ObjectOpenAuditAlarmA (LPCSTR SubsystemName,
* @implemented
*/
BOOL STDCALL
ObjectOpenAuditAlarmW (LPCWSTR SubsystemName,
ObjectOpenAuditAlarmW(LPCWSTR SubsystemName,
LPVOID HandleId,
LPWSTR ObjectTypeName,
LPWSTR ObjectName,
@ -342,14 +343,14 @@ ObjectOpenAuditAlarmW (LPCWSTR SubsystemName,
UNICODE_STRING ObjectNameU;
NTSTATUS Status;
RtlInitUnicodeString (&SubsystemNameU,
RtlInitUnicodeString(&SubsystemNameU,
(PWSTR)SubsystemName);
RtlInitUnicodeString (&ObjectTypeNameU,
RtlInitUnicodeString(&ObjectTypeNameU,
(PWSTR)ObjectTypeName);
RtlInitUnicodeString (&ObjectNameU,
RtlInitUnicodeString(&ObjectNameU,
(PWSTR)ObjectName);
Status = NtOpenObjectAuditAlarm (&SubsystemNameU,
Status = NtOpenObjectAuditAlarm(&SubsystemNameU,
HandleId,
&ObjectTypeNameU,
&ObjectNameU,
@ -361,9 +362,9 @@ ObjectOpenAuditAlarmW (LPCWSTR SubsystemName,
ObjectCreation,
AccessGranted,
(PBOOLEAN)GenerateOnClose);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -375,7 +376,7 @@ ObjectOpenAuditAlarmW (LPCWSTR SubsystemName,
* @implemented
*/
BOOL STDCALL
ObjectPrivilegeAuditAlarmA (LPCSTR SubsystemName,
ObjectPrivilegeAuditAlarmA(LPCSTR SubsystemName,
LPVOID HandleId,
HANDLE ClientToken,
DWORD DesiredAccess,
@ -385,19 +386,19 @@ ObjectPrivilegeAuditAlarmA (LPCSTR SubsystemName,
UNICODE_STRING SubsystemNameU;
NTSTATUS Status;
RtlCreateUnicodeStringFromAsciiz (&SubsystemNameU,
RtlCreateUnicodeStringFromAsciiz(&SubsystemNameU,
(PCHAR)SubsystemName);
Status = NtPrivilegeObjectAuditAlarm (&SubsystemNameU,
Status = NtPrivilegeObjectAuditAlarm(&SubsystemNameU,
HandleId,
ClientToken,
DesiredAccess,
Privileges,
AccessGranted);
RtlFreeUnicodeString (&SubsystemNameU);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -409,7 +410,7 @@ ObjectPrivilegeAuditAlarmA (LPCSTR SubsystemName,
* @implemented
*/
BOOL STDCALL
ObjectPrivilegeAuditAlarmW (LPCWSTR SubsystemName,
ObjectPrivilegeAuditAlarmW(LPCWSTR SubsystemName,
LPVOID HandleId,
HANDLE ClientToken,
DWORD DesiredAccess,
@ -419,18 +420,18 @@ ObjectPrivilegeAuditAlarmW (LPCWSTR SubsystemName,
UNICODE_STRING SubsystemNameU;
NTSTATUS Status;
RtlInitUnicodeString (&SubsystemNameU,
RtlInitUnicodeString(&SubsystemNameU,
(PWSTR)SubsystemName);
Status = NtPrivilegeObjectAuditAlarm (&SubsystemNameU,
Status = NtPrivilegeObjectAuditAlarm(&SubsystemNameU,
HandleId,
ClientToken,
DesiredAccess,
Privileges,
AccessGranted);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -442,7 +443,7 @@ ObjectPrivilegeAuditAlarmW (LPCWSTR SubsystemName,
* @implemented
*/
BOOL STDCALL
PrivilegedServiceAuditAlarmA (LPCSTR SubsystemName,
PrivilegedServiceAuditAlarmA(LPCSTR SubsystemName,
LPCSTR ServiceName,
HANDLE ClientToken,
PPRIVILEGE_SET Privileges,
@ -452,21 +453,21 @@ PrivilegedServiceAuditAlarmA (LPCSTR SubsystemName,
UNICODE_STRING ServiceNameU;
NTSTATUS Status;
RtlCreateUnicodeStringFromAsciiz (&SubsystemNameU,
RtlCreateUnicodeStringFromAsciiz(&SubsystemNameU,
(PCHAR)SubsystemName);
RtlCreateUnicodeStringFromAsciiz (&ServiceNameU,
RtlCreateUnicodeStringFromAsciiz(&ServiceNameU,
(PCHAR)ServiceName);
Status = NtPrivilegedServiceAuditAlarm (&SubsystemNameU,
Status = NtPrivilegedServiceAuditAlarm(&SubsystemNameU,
&ServiceNameU,
ClientToken,
Privileges,
AccessGranted);
RtlFreeUnicodeString (&SubsystemNameU);
RtlFreeUnicodeString (&ServiceNameU);
if (!NT_SUCCESS (Status))
RtlFreeUnicodeString(&SubsystemNameU);
RtlFreeUnicodeString(&ServiceNameU);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -478,7 +479,7 @@ PrivilegedServiceAuditAlarmA (LPCSTR SubsystemName,
* @implemented
*/
BOOL STDCALL
PrivilegedServiceAuditAlarmW (LPCWSTR SubsystemName,
PrivilegedServiceAuditAlarmW(LPCWSTR SubsystemName,
LPCWSTR ServiceName,
HANDLE ClientToken,
PPRIVILEGE_SET Privileges,
@ -488,19 +489,19 @@ PrivilegedServiceAuditAlarmW (LPCWSTR SubsystemName,
UNICODE_STRING ServiceNameU;
NTSTATUS Status;
RtlInitUnicodeString (&SubsystemNameU,
RtlInitUnicodeString(&SubsystemNameU,
(PWSTR)SubsystemName);
RtlInitUnicodeString (&ServiceNameU,
RtlInitUnicodeString(&ServiceNameU,
(PWSTR)ServiceName);
Status = NtPrivilegedServiceAuditAlarm (&SubsystemNameU,
Status = NtPrivilegedServiceAuditAlarm(&SubsystemNameU,
&ServiceNameU,
ClientToken,
Privileges,
AccessGranted);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -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,8 +434,9 @@ GetKernelObjectSecurity(HANDLE Handle,
*
* @implemented
*/
BOOL STDCALL
SetFileSecurityA (LPCSTR lpFileName,
BOOL
STDCALL
SetFileSecurityA(LPCSTR lpFileName,
SECURITY_INFORMATION SecurityInformation,
PSECURITY_DESCRIPTOR pSecurityDescriptor)
{
@ -456,8 +468,9 @@ SetFileSecurityA (LPCSTR lpFileName,
*
* @implemented
*/
BOOL STDCALL
SetFileSecurityW (LPCWSTR lpFileName,
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;
@ -594,14 +609,14 @@ ImpersonateLoggedOnUser(HANDLE hToken)
NTSTATUS Status;
/* Get the token type */
Status = NtQueryInformationToken (hToken,
Status = NtQueryInformationToken(hToken,
TokenType,
&Type,
sizeof(TOKEN_TYPE),
&ReturnLength);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -620,7 +635,7 @@ ImpersonateLoggedOnUser(HANDLE hToken)
ObjectAttributes.SecurityDescriptor = NULL;
ObjectAttributes.SecurityQualityOfService = &Qos;
Status = NtDuplicateToken (hToken,
Status = NtDuplicateToken(hToken,
TOKEN_IMPERSONATE | TOKEN_QUERY,
&ObjectAttributes,
FALSE,
@ -628,7 +643,7 @@ ImpersonateLoggedOnUser(HANDLE hToken)
&NewToken);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -642,19 +657,19 @@ ImpersonateLoggedOnUser(HANDLE hToken)
}
/* Impersonate the the current thread */
Status = NtSetInformationThread (NtCurrentThread (),
Status = NtSetInformationThread(NtCurrentThread(),
ThreadImpersonationToken,
&NewToken,
sizeof(HANDLE));
if (Duplicated == TRUE)
{
NtClose (NewToken);
NtClose(NewToken);
}
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -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,8 +886,9 @@ GetUserNameW ( LPWSTR lpszName, LPDWORD lpSize )
*
* @implemented
*/
BOOL STDCALL
LookupAccountSidA (LPCSTR lpSystemName,
BOOL
STDCALL
LookupAccountSidA(LPCSTR lpSystemName,
PSID lpSid,
LPSTR lpName,
LPDWORD cchName,
@ -1003,14 +1028,13 @@ LookupAccountSidA (LPCSTR lpSystemName,
* @implemented
*/
BOOL WINAPI
LookupAccountSidW (
LPCWSTR pSystemName,
LookupAccountSidW(LPCWSTR pSystemName,
PSID pSid,
LPWSTR pAccountName,
LPDWORD pdwAccountName,
LPWSTR pDomainName,
LPDWORD pdwDomainName,
PSID_NAME_USE peUse )
PSID_NAME_USE peUse)
{
LSA_UNICODE_STRING SystemName;
LSA_OBJECT_ATTRIBUTES ObjectAttributes = {0};
@ -1098,8 +1122,9 @@ LookupAccountSidW (
*
* @implemented
*/
BOOL STDCALL
LookupAccountNameA (LPCSTR SystemName,
BOOL
STDCALL
LookupAccountNameA(LPCSTR SystemName,
LPCSTR AccountName,
PSID Sid,
LPDWORD SidLength,
@ -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,8 +1259,9 @@ BOOL WINAPI LookupAccountNameW(LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSID
*
* @implemented
*/
BOOL STDCALL
LookupPrivilegeValueA (LPCSTR lpSystemName,
BOOL
STDCALL
LookupPrivilegeValueA(LPCSTR lpSystemName,
LPCSTR lpName,
PLUID lpLuid)
{
@ -1225,30 +1272,30 @@ LookupPrivilegeValueA (LPCSTR lpSystemName,
/* Remote system? */
if (lpSystemName != NULL)
{
RtlCreateUnicodeStringFromAsciiz (&SystemName,
RtlCreateUnicodeStringFromAsciiz(&SystemName,
(LPSTR)lpSystemName);
}
/* Check the privilege name is not NULL */
if (lpName == NULL)
{
SetLastError (ERROR_INVALID_PARAMETER);
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
RtlCreateUnicodeStringFromAsciiz (&Name,
RtlCreateUnicodeStringFromAsciiz(&Name,
(LPSTR)lpName);
Result = LookupPrivilegeValueW ((lpSystemName != NULL) ? SystemName.Buffer : NULL,
Result = LookupPrivilegeValueW((lpSystemName != NULL) ? SystemName.Buffer : NULL,
Name.Buffer,
lpLuid);
RtlFreeUnicodeString (&Name);
RtlFreeUnicodeString(&Name);
/* Remote system? */
if (lpSystemName != NULL)
{
RtlFreeUnicodeString (&SystemName);
RtlFreeUnicodeString(&SystemName);
}
return Result;
@ -1260,8 +1307,9 @@ LookupPrivilegeValueA (LPCSTR lpSystemName,
*
* @unimplemented
*/
BOOL STDCALL
LookupPrivilegeValueW (LPCWSTR SystemName,
BOOL
STDCALL
LookupPrivilegeValueW(LPCWSTR SystemName,
LPCWSTR PrivName,
PLUID Luid)
{
@ -1328,8 +1376,9 @@ LookupPrivilegeValueW (LPCWSTR SystemName,
*
* @unimplemented
*/
BOOL STDCALL
LookupPrivilegeDisplayNameA (LPCSTR lpSystemName,
BOOL
STDCALL
LookupPrivilegeDisplayNameA(LPCSTR lpSystemName,
LPCSTR lpName,
LPSTR lpDisplayName,
LPDWORD cbDisplayName,
@ -1346,8 +1395,9 @@ LookupPrivilegeDisplayNameA (LPCSTR lpSystemName,
*
* @unimplemented
*/
BOOL STDCALL
LookupPrivilegeDisplayNameW (LPCWSTR lpSystemName,
BOOL
STDCALL
LookupPrivilegeDisplayNameW(LPCWSTR lpSystemName,
LPCWSTR lpName,
LPWSTR lpDisplayName,
LPDWORD cbDisplayName,
@ -1364,8 +1414,9 @@ LookupPrivilegeDisplayNameW (LPCWSTR lpSystemName,
*
* @unimplemented
*/
BOOL STDCALL
LookupPrivilegeNameA (LPCSTR lpSystemName,
BOOL
STDCALL
LookupPrivilegeNameA(LPCSTR lpSystemName,
PLUID lpLuid,
LPSTR lpName,
LPDWORD cbName)
@ -1381,8 +1432,9 @@ LookupPrivilegeNameA (LPCSTR lpSystemName,
*
* @unimplemented
*/
BOOL STDCALL
LookupPrivilegeNameW (LPCWSTR lpSystemName,
BOOL
STDCALL
LookupPrivilegeNameW(LPCWSTR lpSystemName,
PLUID lpLuid,
LPWSTR lpName,
LPDWORD cbName)
@ -1395,10 +1447,10 @@ LookupPrivilegeNameW (LPCWSTR lpSystemName,
static DWORD
pGetSecurityInfoCheck(SECURITY_INFORMATION SecurityInfo,
PSID* ppsidOwner,
PSID* ppsidGroup,
PACL* ppDacl,
PACL* ppSacl,
PSID *ppsidOwner,
PSID *ppsidGroup,
PACL *ppDacl,
PACL *ppSacl,
PSECURITY_DESCRIPTOR* ppSecurityDescriptor)
{
if ((SecurityInfo & (OWNER_SECURITY_INFORMATION |
@ -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,15 +1807,16 @@ SetNamedSecurityInfoA(LPSTR pObjectName,
*
* @implemented
*/
DWORD STDCALL
DWORD
STDCALL
GetSecurityInfo(HANDLE handle,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
PSID* ppsidOwner,
PSID* ppsidGroup,
PACL* ppDacl,
PACL* ppSacl,
PSECURITY_DESCRIPTOR* ppSecurityDescriptor)
PSID *ppsidOwner,
PSID *ppsidGroup,
PACL *ppDacl,
PACL *ppSacl,
PSECURITY_DESCRIPTOR *ppSecurityDescriptor)
{
DWORD ErrorCode;
@ -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,20 +21,18 @@ 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;
Status = RtlGetControlSecurityDescriptor (pSecurityDescriptor,
Status = RtlGetControlSecurityDescriptor(pSecurityDescriptor,
pControl,
(PULONG)lpdwRevision);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -47,18 +45,16 @@ GetSecurityDescriptorControl (
*/
BOOL
STDCALL
GetSecurityDescriptorDacl (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
LPBOOL lpbDaclPresent,
PACL *pDacl,
LPBOOL lpbDaclDefaulted
)
LPBOOL lpbDaclDefaulted)
{
BOOLEAN DaclPresent;
BOOLEAN DaclDefaulted;
NTSTATUS Status;
Status = RtlGetDaclSecurityDescriptor (pSecurityDescriptor,
Status = RtlGetDaclSecurityDescriptor(pSecurityDescriptor,
&DaclPresent,
pDacl,
&DaclDefaulted);
@ -67,7 +63,7 @@ GetSecurityDescriptorDacl (
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -80,23 +76,21 @@ GetSecurityDescriptorDacl (
*/
BOOL
STDCALL
GetSecurityDescriptorGroup (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID *pGroup,
LPBOOL lpbGroupDefaulted
)
LPBOOL lpbGroupDefaulted)
{
BOOLEAN GroupDefaulted;
NTSTATUS Status;
Status = RtlGetGroupSecurityDescriptor (pSecurityDescriptor,
Status = RtlGetGroupSecurityDescriptor(pSecurityDescriptor,
pGroup,
&GroupDefaulted);
*lpbGroupDefaulted = (BOOL)GroupDefaulted;
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -109,23 +103,21 @@ GetSecurityDescriptorGroup (
*/
BOOL
STDCALL
GetSecurityDescriptorOwner (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID *pOwner,
LPBOOL lpbOwnerDefaulted
)
LPBOOL lpbOwnerDefaulted)
{
BOOLEAN OwnerDefaulted;
NTSTATUS Status;
Status = RtlGetOwnerSecurityDescriptor (pSecurityDescriptor,
Status = RtlGetOwnerSecurityDescriptor(pSecurityDescriptor,
pOwner,
&OwnerDefaulted);
*lpbOwnerDefaulted = (BOOL)OwnerDefaulted;
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -138,8 +130,7 @@ GetSecurityDescriptorOwner (
*/
DWORD
STDCALL
GetSecurityDescriptorRMControl (
PSECURITY_DESCRIPTOR SecurityDescriptor,
GetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor,
PUCHAR RMControl)
{
if (!RtlGetSecurityDescriptorRMControl(SecurityDescriptor,
@ -155,18 +146,16 @@ GetSecurityDescriptorRMControl (
*/
BOOL
STDCALL
GetSecurityDescriptorSacl (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
LPBOOL lpbSaclPresent,
PACL *pSacl,
LPBOOL lpbSaclDefaulted
)
LPBOOL lpbSaclDefaulted)
{
BOOLEAN SaclPresent;
BOOLEAN SaclDefaulted;
NTSTATUS Status;
Status = RtlGetSaclSecurityDescriptor (pSecurityDescriptor,
Status = RtlGetSaclSecurityDescriptor(pSecurityDescriptor,
&SaclPresent,
pSacl,
&SaclDefaulted);
@ -175,7 +164,7 @@ GetSecurityDescriptorSacl (
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -188,18 +177,16 @@ GetSecurityDescriptorSacl (
*/
BOOL
STDCALL
InitializeSecurityDescriptor (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
DWORD dwRevision
)
InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor,
DWORD dwRevision)
{
NTSTATUS Status;
Status = RtlCreateSecurityDescriptor (pSecurityDescriptor,
Status = RtlCreateSecurityDescriptor(pSecurityDescriptor,
dwRevision);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -212,15 +199,13 @@ InitializeSecurityDescriptor (
*/
BOOL
STDCALL
IsValidSecurityDescriptor (
PSECURITY_DESCRIPTOR pSecurityDescriptor
)
IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor)
{
BOOLEAN Result;
Result = RtlValidSecurityDescriptor (pSecurityDescriptor);
if (Result == FALSE)
SetLastError (RtlNtStatusToDosError (STATUS_INVALID_SECURITY_DESCR));
SetLastError(RtlNtStatusToDosError(STATUS_INVALID_SECURITY_DESCR));
return (BOOL)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;
@ -282,7 +265,7 @@ MakeAbsoluteSD2(IN OUT PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
lpdwBufferSize);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -295,20 +278,18 @@ 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;
Status = RtlAbsoluteToSelfRelativeSD (pAbsoluteSecurityDescriptor,
Status = RtlAbsoluteToSelfRelativeSD(pAbsoluteSecurityDescriptor,
pSelfRelativeSecurityDescriptor,
(PULONG)lpdwBufferLength);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -321,8 +302,7 @@ MakeSelfRelativeSD (
*/
BOOL
STDCALL
SetSecurityDescriptorControl (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet)
{
@ -333,7 +313,7 @@ SetSecurityDescriptorControl (
ControlBitsToSet);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -346,22 +326,20 @@ SetSecurityDescriptorControl (
*/
BOOL
STDCALL
SetSecurityDescriptorDacl (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
BOOL bDaclPresent,
PACL pDacl,
BOOL bDaclDefaulted
)
BOOL bDaclDefaulted)
{
NTSTATUS Status;
Status = RtlSetDaclSecurityDescriptor (pSecurityDescriptor,
Status = RtlSetDaclSecurityDescriptor(pSecurityDescriptor,
bDaclPresent,
pDacl,
bDaclDefaulted);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -374,20 +352,18 @@ SetSecurityDescriptorDacl (
*/
BOOL
STDCALL
SetSecurityDescriptorGroup (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID pGroup,
BOOL bGroupDefaulted
)
BOOL bGroupDefaulted)
{
NTSTATUS Status;
Status = RtlSetGroupSecurityDescriptor (pSecurityDescriptor,
Status = RtlSetGroupSecurityDescriptor(pSecurityDescriptor,
pGroup,
bGroupDefaulted);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -400,20 +376,18 @@ SetSecurityDescriptorGroup (
*/
BOOL
STDCALL
SetSecurityDescriptorOwner (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor,
PSID pOwner,
BOOL bOwnerDefaulted
)
BOOL bOwnerDefaulted)
{
NTSTATUS Status;
Status = RtlSetOwnerSecurityDescriptor (pSecurityDescriptor,
Status = RtlSetOwnerSecurityDescriptor(pSecurityDescriptor,
pOwner,
bOwnerDefaulted);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -426,8 +400,7 @@ SetSecurityDescriptorOwner (
*/
DWORD
STDCALL
SetSecurityDescriptorRMControl (
PSECURITY_DESCRIPTOR SecurityDescriptor,
SetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor,
PUCHAR RMControl)
{
RtlSetSecurityDescriptorRMControl(SecurityDescriptor,
@ -442,22 +415,20 @@ SetSecurityDescriptorRMControl (
*/
BOOL
STDCALL
SetSecurityDescriptorSacl (
PSECURITY_DESCRIPTOR pSecurityDescriptor,
SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
BOOL bSaclPresent,
PACL pSacl,
BOOL bSaclDefaulted
)
BOOL bSaclDefaulted)
{
NTSTATUS Status;
Status = RtlSetSaclSecurityDescriptor (pSecurityDescriptor,
Status = RtlSetSaclSecurityDescriptor(pSecurityDescriptor,
bSaclPresent,
pSacl,
bSaclDefaulted);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -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,11 +607,15 @@ 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,
LPWSTR *lpwstr,
PULONG pulong)
{
FIXME("%s() not implemented!\n", __FUNCTION__);
@ -642,11 +623,15 @@ 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,
LPSTR *lpstr,
PULONG pulong)
{
FIXME("%s() not implemented!\n", __FUNCTION__);

View file

@ -541,7 +541,7 @@ AllocateLocallyUniqueId(PLUID Luid)
Status = NtAllocateLocallyUniqueId (Luid);
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -553,7 +553,7 @@ AllocateLocallyUniqueId(PLUID Luid)
* @implemented
*/
BOOL STDCALL
AllocateAndInitializeSid (PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
BYTE nSubAuthorityCount,
DWORD dwSubAuthority0,
DWORD dwSubAuthority1,
@ -567,7 +567,7 @@ AllocateAndInitializeSid (PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
{
NTSTATUS Status;
Status = RtlAllocateAndInitializeSid (pIdentifierAuthority,
Status = RtlAllocateAndInitializeSid(pIdentifierAuthority,
nSubAuthorityCount,
dwSubAuthority0,
dwSubAuthority1,
@ -578,9 +578,9 @@ AllocateAndInitializeSid (PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
dwSubAuthority6,
dwSubAuthority7,
pSid);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -592,23 +592,25 @@ AllocateAndInitializeSid (PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
* @implemented
*/
BOOL STDCALL
CopySid (DWORD nDestinationSidLength,
CopySid(DWORD nDestinationSidLength,
PSID pDestinationSid,
PSID pSourceSid)
{
NTSTATUS Status;
Status = RtlCopySid (nDestinationSidLength,
Status = RtlCopySid(nDestinationSidLength,
pDestinationSid,
pSourceSid);
if (!NT_SUCCESS (Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
return TRUE;
}
/******************************************************************************
* ConvertStringSecurityDescriptorToSecurityDescriptorW [ADVAPI32.@]
* @implemented
@ -830,7 +832,7 @@ BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorA(
* @implemented
*/
BOOL STDCALL
EqualPrefixSid (PSID pSid1,
EqualPrefixSid(PSID pSid1,
PSID pSid2)
{
return RtlEqualPrefixSid (pSid1, pSid2);
@ -841,7 +843,7 @@ EqualPrefixSid (PSID pSid1,
* @implemented
*/
BOOL STDCALL
EqualSid (PSID pSid1,
EqualSid(PSID pSid1,
PSID pSid2)
{
return RtlEqualSid (pSid1, pSid2);
@ -856,9 +858,9 @@ EqualSid (PSID pSid1,
* even thou it's defined to return a PVOID...
*/
PVOID STDCALL
FreeSid (PSID pSid)
FreeSid(PSID pSid)
{
return RtlFreeSid (pSid);
return RtlFreeSid(pSid);
}
@ -866,9 +868,9 @@ FreeSid (PSID pSid)
* @implemented
*/
DWORD STDCALL
GetLengthSid (PSID pSid)
GetLengthSid(PSID pSid)
{
return (DWORD)RtlLengthSid (pSid);
return (DWORD)RtlLengthSid(pSid);
}
@ -876,9 +878,9 @@ GetLengthSid (PSID pSid)
* @implemented
*/
PSID_IDENTIFIER_AUTHORITY STDCALL
GetSidIdentifierAuthority (PSID pSid)
GetSidIdentifierAuthority(PSID pSid)
{
return RtlIdentifierAuthoritySid (pSid);
return RtlIdentifierAuthoritySid(pSid);
}
@ -886,9 +888,9 @@ GetSidIdentifierAuthority (PSID pSid)
* @implemented
*/
DWORD STDCALL
GetSidLengthRequired (UCHAR nSubAuthorityCount)
GetSidLengthRequired(UCHAR nSubAuthorityCount)
{
return (DWORD)RtlLengthRequiredSid (nSubAuthorityCount);
return (DWORD)RtlLengthRequiredSid(nSubAuthorityCount);
}
@ -896,10 +898,10 @@ GetSidLengthRequired (UCHAR nSubAuthorityCount)
* @implemented
*/
PDWORD STDCALL
GetSidSubAuthority (PSID pSid,
GetSidSubAuthority(PSID pSid,
DWORD nSubAuthority)
{
return (PDWORD)RtlSubAuthoritySid (pSid, nSubAuthority);
return (PDWORD)RtlSubAuthoritySid(pSid, nSubAuthority);
}
@ -907,9 +909,9 @@ GetSidSubAuthority (PSID pSid,
* @implemented
*/
PUCHAR STDCALL
GetSidSubAuthorityCount (PSID pSid)
GetSidSubAuthorityCount(PSID pSid)
{
return RtlSubAuthorityCountSid (pSid);
return RtlSubAuthorityCountSid(pSid);
}
@ -917,18 +919,18 @@ GetSidSubAuthorityCount (PSID pSid)
* @implemented
*/
BOOL STDCALL
InitializeSid (PSID Sid,
InitializeSid(PSID Sid,
PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
BYTE nSubAuthorityCount)
{
NTSTATUS Status;
Status = RtlInitializeSid (Sid,
Status = RtlInitializeSid(Sid,
pIdentifierAuthority,
nSubAuthorityCount);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -940,22 +942,24 @@ InitializeSid (PSID Sid,
* @implemented
*/
BOOL STDCALL
IsValidSid (PSID pSid)
IsValidSid(PSID pSid)
{
return (BOOL)RtlValidSid (pSid);
return (BOOL)RtlValidSid(pSid);
}
/*
* @implemented
*/
BOOL STDCALL
ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
ConvertSidToStringSidW(PSID Sid,
LPWSTR *StringSid)
{
NTSTATUS Status;
UNICODE_STRING UnicodeString;
WCHAR FixedBuffer[64];
if (! RtlValidSid(Sid))
if (!RtlValidSid(Sid))
{
SetLastError(ERROR_INVALID_SID);
return FALSE;
@ -969,7 +973,8 @@ ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
{
Status = RtlConvertSidToUnicodeString(&UnicodeString, Sid, TRUE);
}
if (! NT_SUCCESS(Status))
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
@ -1001,12 +1006,13 @@ ConvertSidToStringSidW(PSID Sid, LPWSTR *StringSid)
* @implemented
*/
BOOL STDCALL
ConvertSidToStringSidA(PSID Sid, LPSTR *StringSid)
ConvertSidToStringSidA(PSID Sid,
LPSTR *StringSid)
{
LPWSTR StringSidW;
int Len;
if (! ConvertSidToStringSidW(Sid, &StringSidW))
if (!ConvertSidToStringSidW(Sid, &StringSidW))
{
return FALSE;
}
@ -1018,6 +1024,7 @@ ConvertSidToStringSidA(PSID Sid, LPSTR *StringSid)
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
*StringSid = LocalAlloc(LMEM_FIXED, Len);
if (NULL == *StringSid)
{
@ -1026,7 +1033,7 @@ ConvertSidToStringSidA(PSID Sid, LPSTR *StringSid)
return FALSE;
}
if (! WideCharToMultiByte(CP_ACP, 0, StringSidW, -1, *StringSid, Len, NULL, NULL))
if (!WideCharToMultiByte(CP_ACP, 0, StringSidW, -1, *StringSid, Len, NULL, NULL))
{
LocalFree(StringSid);
LocalFree(StringSidW);
@ -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;
}
@ -1118,10 +1130,14 @@ IsWellKnownSid(IN PSID pSid,
int i;
TRACE("(%s, %d)\n", debugstr_sid(pSid), WellKnownSidType);
for (i = 0; i < sizeof(WellKnownSids)/sizeof(WellKnownSids[0]); i++)
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

@ -18,23 +18,23 @@
* @implemented
*/
BOOL STDCALL
PrivilegeCheck (HANDLE ClientToken,
PrivilegeCheck(HANDLE ClientToken,
PPRIVILEGE_SET RequiredPrivileges,
LPBOOL pfResult)
{
BOOLEAN Result;
NTSTATUS Status;
Status = NtPrivilegeCheck (ClientToken,
Status = NtPrivilegeCheck(ClientToken,
RequiredPrivileges,
&Result);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
*pfResult = (BOOL) Result;
*pfResult = (BOOL)Result;
return TRUE;
}

View file

@ -17,7 +17,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(advapi);
* @implemented
*/
BOOL STDCALL
AdjustTokenGroups (HANDLE TokenHandle,
AdjustTokenGroups(HANDLE TokenHandle,
BOOL ResetToDefault,
PTOKEN_GROUPS NewState,
DWORD BufferLength,
@ -26,15 +26,15 @@ AdjustTokenGroups (HANDLE TokenHandle,
{
NTSTATUS Status;
Status = NtAdjustGroupsToken (TokenHandle,
Status = NtAdjustGroupsToken(TokenHandle,
ResetToDefault,
NewState,
BufferLength,
PreviousState,
(PULONG)ReturnLength);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -46,7 +46,7 @@ AdjustTokenGroups (HANDLE TokenHandle,
* @implemented
*/
BOOL STDCALL
AdjustTokenPrivileges (HANDLE TokenHandle,
AdjustTokenPrivileges(HANDLE TokenHandle,
BOOL DisableAllPrivileges,
PTOKEN_PRIVILEGES NewState,
DWORD BufferLength,
@ -55,7 +55,7 @@ AdjustTokenPrivileges (HANDLE TokenHandle,
{
NTSTATUS Status;
Status = NtAdjustPrivilegesToken (TokenHandle,
Status = NtAdjustPrivilegesToken(TokenHandle,
DisableAllPrivileges,
NewState,
BufferLength,
@ -66,13 +66,16 @@ AdjustTokenPrivileges (HANDLE TokenHandle,
SetLastError(ERROR_NOT_ALL_ASSIGNED);
return TRUE;
}
if (! NT_SUCCESS(Status))
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;
}
@ -81,7 +84,7 @@ AdjustTokenPrivileges (HANDLE TokenHandle,
* @implemented
*/
BOOL STDCALL
GetTokenInformation (HANDLE TokenHandle,
GetTokenInformation(HANDLE TokenHandle,
TOKEN_INFORMATION_CLASS TokenInformationClass,
LPVOID TokenInformation,
DWORD TokenInformationLength,
@ -89,14 +92,14 @@ GetTokenInformation (HANDLE TokenHandle,
{
NTSTATUS Status;
Status = NtQueryInformationToken (TokenHandle,
Status = NtQueryInformationToken(TokenHandle,
TokenInformationClass,
TokenInformation,
TokenInformationLength,
(PULONG)ReturnLength);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -108,20 +111,20 @@ GetTokenInformation (HANDLE TokenHandle,
* @implemented
*/
BOOL STDCALL
SetTokenInformation (HANDLE TokenHandle,
SetTokenInformation(HANDLE TokenHandle,
TOKEN_INFORMATION_CLASS TokenInformationClass,
LPVOID TokenInformation,
DWORD TokenInformationLength)
{
NTSTATUS Status;
Status = NtSetInformationToken (TokenHandle,
Status = NtSetInformationToken(TokenHandle,
TokenInformationClass,
TokenInformation,
TokenInformationLength);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -133,7 +136,7 @@ SetTokenInformation (HANDLE TokenHandle,
* @implemented
*/
BOOL STDCALL
AccessCheck (PSECURITY_DESCRIPTOR pSecurityDescriptor,
AccessCheck(PSECURITY_DESCRIPTOR pSecurityDescriptor,
HANDLE ClientToken,
DWORD DesiredAccess,
PGENERIC_MAPPING GenericMapping,
@ -145,7 +148,7 @@ AccessCheck (PSECURITY_DESCRIPTOR pSecurityDescriptor,
NTSTATUS Status;
NTSTATUS AccessStat;
Status = NtAccessCheck (pSecurityDescriptor,
Status = NtAccessCheck(pSecurityDescriptor,
ClientToken,
DesiredAccess,
GenericMapping,
@ -153,15 +156,15 @@ AccessCheck (PSECURITY_DESCRIPTOR pSecurityDescriptor,
(PULONG)PrivilegeSetLength,
(PACCESS_MASK)GrantedAccess,
&AccessStat);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
if (!NT_SUCCESS (AccessStat))
if (!NT_SUCCESS(AccessStat))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
*AccessStatus = FALSE;
return TRUE;
}
@ -176,18 +179,18 @@ AccessCheck (PSECURITY_DESCRIPTOR pSecurityDescriptor,
* @implemented
*/
BOOL STDCALL
OpenProcessToken (HANDLE ProcessHandle,
OpenProcessToken(HANDLE ProcessHandle,
DWORD DesiredAccess,
PHANDLE TokenHandle)
{
NTSTATUS Status;
Status = NtOpenProcessToken (ProcessHandle,
Status = NtOpenProcessToken(ProcessHandle,
DesiredAccess,
TokenHandle);
if (!NT_SUCCESS (Status))
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -199,20 +202,20 @@ OpenProcessToken (HANDLE ProcessHandle,
* @implemented
*/
BOOL STDCALL
OpenThreadToken (HANDLE ThreadHandle,
OpenThreadToken(HANDLE ThreadHandle,
DWORD DesiredAccess,
BOOL OpenAsSelf,
PHANDLE TokenHandle)
{
NTSTATUS Status;
Status = NtOpenThreadToken (ThreadHandle,
Status = NtOpenThreadToken(ThreadHandle,
DesiredAccess,
OpenAsSelf,
TokenHandle);
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -224,21 +227,21 @@ OpenThreadToken (HANDLE ThreadHandle,
* @implemented
*/
BOOL STDCALL
SetThreadToken (IN PHANDLE ThreadHandle OPTIONAL,
SetThreadToken(IN PHANDLE ThreadHandle OPTIONAL,
IN HANDLE TokenHandle)
{
NTSTATUS Status;
HANDLE hThread;
hThread = ((ThreadHandle != NULL) ? *ThreadHandle : NtCurrentThread());
hThread = (ThreadHandle != NULL) ? *ThreadHandle : NtCurrentThread();
Status = NtSetInformationThread (hThread,
Status = NtSetInformationThread(hThread,
ThreadImpersonationToken,
&TokenHandle,
sizeof(HANDLE));
if (!NT_SUCCESS(Status))
{
SetLastError (RtlNtStatusToDosError (Status));
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
@ -250,7 +253,7 @@ SetThreadToken (IN PHANDLE ThreadHandle OPTIONAL,
* @implemented
*/
BOOL STDCALL
DuplicateTokenEx (IN HANDLE ExistingTokenHandle,
DuplicateTokenEx(IN HANDLE ExistingTokenHandle,
IN DWORD dwDesiredAccess,
IN LPSECURITY_ATTRIBUTES lpTokenAttributes OPTIONAL,
IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
@ -285,7 +288,7 @@ DuplicateTokenEx (IN HANDLE ExistingTokenHandle,
ObjectAttributes.SecurityQualityOfService = &Sqos;
Status = NtDuplicateToken (ExistingTokenHandle,
Status = NtDuplicateToken(ExistingTokenHandle,
dwDesiredAccess,
&ObjectAttributes,
FALSE,
@ -305,11 +308,11 @@ DuplicateTokenEx (IN HANDLE ExistingTokenHandle,
* @implemented
*/
BOOL STDCALL
DuplicateToken (IN HANDLE ExistingTokenHandle,
DuplicateToken(IN HANDLE ExistingTokenHandle,
IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
OUT PHANDLE DuplicateTokenHandle)
{
return DuplicateTokenEx (ExistingTokenHandle,
return DuplicateTokenEx(ExistingTokenHandle,
TOKEN_IMPERSONATE | TOKEN_QUERY,
NULL,
ImpersonationLevel,
@ -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,