*/
BOOL
STDCALL
-GetAclInformation (
- PACL pAcl,
- LPVOID pAclInformation,
- DWORD nAclInformationLength,
- ACL_INFORMATION_CLASS dwAclInformationClass
- )
+GetAclInformation(PACL pAcl,
+ LPVOID pAclInformation,
+ DWORD nAclInformationLength,
+ ACL_INFORMATION_CLASS dwAclInformationClass)
{
- NTSTATUS Status;
-
- Status = RtlQueryInformationAcl (pAcl,
- pAclInformation,
- nAclInformationLength,
- dwAclInformationClass);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
-
- return TRUE;
+ NTSTATUS Status;
+
+ Status = RtlQueryInformationAcl(pAcl,
+ pAclInformation,
+ nAclInformationLength,
+ dwAclInformationClass);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
}
*/
BOOL
STDCALL
-InitializeAcl (
- PACL pAcl,
- DWORD nAclLength,
- DWORD dwAclRevision
- )
+InitializeAcl(PACL pAcl,
+ DWORD nAclLength,
+ DWORD dwAclRevision)
{
- NTSTATUS Status;
-
- Status = RtlCreateAcl (pAcl,
- nAclLength,
- dwAclRevision);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
-
- return TRUE;
+ NTSTATUS Status;
+
+ Status = RtlCreateAcl(pAcl,
+ nAclLength,
+ dwAclRevision);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
}
*/
BOOL
STDCALL
-IsValidAcl (
- PACL pAcl
- )
+IsValidAcl(PACL pAcl)
{
- return RtlValidAcl (pAcl);
+ return RtlValidAcl (pAcl);
}
*/
BOOL
STDCALL
-SetAclInformation (
- PACL pAcl,
- LPVOID pAclInformation,
- DWORD nAclInformationLength,
- ACL_INFORMATION_CLASS dwAclInformationClass
- )
+SetAclInformation(PACL pAcl,
+ LPVOID pAclInformation,
+ DWORD nAclInformationLength,
+ ACL_INFORMATION_CLASS dwAclInformationClass)
{
- NTSTATUS Status;
-
- Status = RtlSetInformationAcl (pAcl,
- pAclInformation,
- nAclInformationLength,
- dwAclInformationClass);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
-
- return TRUE;
+ NTSTATUS Status;
+
+ Status = RtlSetInformationAcl(pAcl,
+ pAclInformation,
+ nAclInformationLength,
+ dwAclInformationClass);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
}
*/
BOOL
STDCALL
-AddAccessAllowedAce (
- PACL pAcl,
- DWORD dwAceRevision,
- DWORD AccessMask,
- PSID pSid
- )
+AddAccessAllowedAce(PACL pAcl,
+ DWORD dwAceRevision,
+ DWORD AccessMask,
+ PSID pSid)
{
- NTSTATUS Status;
-
- Status = RtlAddAccessAllowedAce (pAcl,
- dwAceRevision,
- AccessMask,
- pSid);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
-
- return TRUE;
+ NTSTATUS Status;
+
+ Status = RtlAddAccessAllowedAce(pAcl,
+ dwAceRevision,
+ AccessMask,
+ pSid);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
}
*/
BOOL STDCALL
AddAccessAllowedAceEx(PACL pAcl,
- DWORD dwAceRevision,
- DWORD AceFlags,
- DWORD AccessMask,
- PSID pSid)
+ DWORD dwAceRevision,
+ DWORD AceFlags,
+ DWORD AccessMask,
+ PSID pSid)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlAddAccessAllowedAceEx(pAcl,
- dwAceRevision,
- AceFlags,
- AccessMask,
- pSid);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
+ Status = RtlAddAccessAllowedAceEx(pAcl,
+ dwAceRevision,
+ AceFlags,
+ AccessMask,
+ pSid);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
BOOL
STDCALL
-AddAccessAllowedObjectAce(
- PACL pAcl,
- DWORD dwAceRevision,
- DWORD AceFlags,
- DWORD AccessMask,
- GUID* ObjectTypeGuid,
- GUID* InheritedObjectTypeGuid,
- PSID pSid)
+AddAccessAllowedObjectAce(PACL pAcl,
+ DWORD dwAceRevision,
+ DWORD AceFlags,
+ DWORD AccessMask,
+ GUID *ObjectTypeGuid,
+ GUID *InheritedObjectTypeGuid,
+ PSID pSid)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlAddAccessAllowedObjectAce(pAcl,
- dwAceRevision,
- AceFlags,
- AccessMask,
- ObjectTypeGuid,
- InheritedObjectTypeGuid,
- pSid);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
+ Status = RtlAddAccessAllowedObjectAce(pAcl,
+ dwAceRevision,
+ AceFlags,
+ AccessMask,
+ ObjectTypeGuid,
+ InheritedObjectTypeGuid,
+ pSid);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
}
*/
BOOL
STDCALL
-AddAccessDeniedAce (
- PACL pAcl,
- DWORD dwAceRevision,
- DWORD AccessMask,
- PSID pSid
- )
+AddAccessDeniedAce(PACL pAcl,
+ DWORD dwAceRevision,
+ DWORD AccessMask,
+ PSID pSid)
{
- NTSTATUS Status;
-
- Status = RtlAddAccessDeniedAce (pAcl,
- dwAceRevision,
- AccessMask,
- pSid);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
-
- return TRUE;
+ NTSTATUS Status;
+
+ Status = RtlAddAccessDeniedAce(pAcl,
+ dwAceRevision,
+ AccessMask,
+ pSid);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
}
*/
BOOL STDCALL
AddAccessDeniedAceEx(PACL pAcl,
- DWORD dwAceRevision,
- DWORD AceFlags,
- DWORD AccessMask,
- PSID pSid)
+ DWORD dwAceRevision,
+ DWORD AceFlags,
+ DWORD AccessMask,
+ PSID pSid)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlAddAccessDeniedAceEx(pAcl,
- dwAceRevision,
- AceFlags,
- AccessMask,
- pSid);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
+ Status = RtlAddAccessDeniedAceEx(pAcl,
+ dwAceRevision,
+ AceFlags,
+ AccessMask,
+ pSid);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
BOOL
STDCALL
-AddAccessDeniedObjectAce(
- PACL pAcl,
- DWORD dwAceRevision,
- DWORD AceFlags,
- DWORD AccessMask,
- GUID* ObjectTypeGuid,
- GUID* InheritedObjectTypeGuid,
- PSID pSid)
+AddAccessDeniedObjectAce(PACL pAcl,
+ DWORD dwAceRevision,
+ DWORD AceFlags,
+ DWORD AccessMask,
+ GUID* ObjectTypeGuid,
+ GUID* InheritedObjectTypeGuid,
+ PSID pSid)
{
- NTSTATUS Status;
-
- Status = RtlAddAccessDeniedObjectAce(pAcl,
- dwAceRevision,
- AceFlags,
- AccessMask,
- ObjectTypeGuid,
- InheritedObjectTypeGuid,
- pSid);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
+ NTSTATUS Status;
+
+ Status = RtlAddAccessDeniedObjectAce(pAcl,
+ dwAceRevision,
+ AceFlags,
+ AccessMask,
+ ObjectTypeGuid,
+ InheritedObjectTypeGuid,
+ pSid);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
}
*/
BOOL
STDCALL
-AddAce (
- PACL pAcl,
- DWORD dwAceRevision,
- DWORD dwStartingAceIndex,
- LPVOID pAceList,
- DWORD nAceListLength
- )
+AddAce(PACL pAcl,
+ DWORD dwAceRevision,
+ DWORD dwStartingAceIndex,
+ LPVOID pAceList,
+ DWORD nAceListLength)
{
- NTSTATUS Status;
-
- Status = RtlAddAce (pAcl,
- dwAceRevision,
- dwStartingAceIndex,
- pAceList,
- nAceListLength);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
-
- return TRUE;
+ NTSTATUS Status;
+
+ Status = RtlAddAce(pAcl,
+ dwAceRevision,
+ dwStartingAceIndex,
+ pAceList,
+ nAceListLength);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
}
*/
BOOL
STDCALL
-AddAuditAccessAce (
- PACL pAcl,
- DWORD dwAceRevision,
- DWORD dwAccessMask,
- PSID pSid,
- BOOL bAuditSuccess,
- BOOL bAuditFailure
- )
+AddAuditAccessAce(PACL pAcl,
+ DWORD dwAceRevision,
+ DWORD dwAccessMask,
+ PSID pSid,
+ BOOL bAuditSuccess,
+ BOOL bAuditFailure)
{
- NTSTATUS Status;
-
- Status = RtlAddAuditAccessAce (pAcl,
- dwAceRevision,
- dwAccessMask,
- pSid,
- bAuditSuccess,
- bAuditFailure);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
-
- return TRUE;
+ NTSTATUS Status;
+
+ Status = RtlAddAuditAccessAce(pAcl,
+ dwAceRevision,
+ dwAccessMask,
+ pSid,
+ bAuditSuccess,
+ bAuditFailure);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
}
*/
BOOL STDCALL
AddAuditAccessAceEx(PACL pAcl,
- DWORD dwAceRevision,
- DWORD AceFlags,
- DWORD dwAccessMask,
- PSID pSid,
- BOOL bAuditSuccess,
- BOOL bAuditFailure)
+ DWORD dwAceRevision,
+ DWORD AceFlags,
+ DWORD dwAccessMask,
+ PSID pSid,
+ BOOL bAuditSuccess,
+ BOOL bAuditFailure)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlAddAuditAccessAceEx(pAcl,
- dwAceRevision,
- AceFlags,
- dwAccessMask,
- pSid,
- bAuditSuccess,
- bAuditFailure);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
+ Status = RtlAddAuditAccessAceEx(pAcl,
+ dwAceRevision,
+ AceFlags,
+ dwAccessMask,
+ pSid,
+ bAuditSuccess,
+ bAuditFailure);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
BOOL
STDCALL
-AddAuditAccessObjectAce(
- PACL pAcl,
- DWORD dwAceRevision,
- DWORD AceFlags,
- DWORD AccessMask,
- GUID* ObjectTypeGuid,
- GUID* InheritedObjectTypeGuid,
- PSID pSid,
- BOOL bAuditSuccess,
- BOOL bAuditFailure)
+AddAuditAccessObjectAce(PACL pAcl,
+ DWORD dwAceRevision,
+ DWORD AceFlags,
+ DWORD AccessMask,
+ GUID *ObjectTypeGuid,
+ GUID *InheritedObjectTypeGuid,
+ PSID pSid,
+ BOOL bAuditSuccess,
+ BOOL bAuditFailure)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlAddAuditAccessObjectAce(pAcl,
- dwAceRevision,
- AceFlags,
- AccessMask,
- ObjectTypeGuid,
- InheritedObjectTypeGuid,
- pSid,
- bAuditSuccess,
- bAuditFailure);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
-
- return TRUE;
+ Status = RtlAddAuditAccessObjectAce(pAcl,
+ dwAceRevision,
+ AceFlags,
+ AccessMask,
+ ObjectTypeGuid,
+ InheritedObjectTypeGuid,
+ pSid,
+ bAuditSuccess,
+ bAuditFailure);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
}
*/
BOOL
STDCALL
-DeleteAce (
- PACL pAcl,
- DWORD dwAceIndex
- )
+DeleteAce(PACL pAcl,
+ DWORD dwAceIndex)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlDeleteAce (pAcl,
- dwAceIndex);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ Status = RtlDeleteAce(pAcl,
+ dwAceIndex);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
BOOL
STDCALL
-FindFirstFreeAce (
- PACL pAcl,
- LPVOID * pAce
- )
+FindFirstFreeAce(PACL pAcl,
+ LPVOID *pAce)
{
- return RtlFirstFreeAce (pAcl,
- (PACE*)pAce);
+ return RtlFirstFreeAce(pAcl,
+ (PACE*)pAce);
}
*/
BOOL
STDCALL
-GetAce (
- PACL pAcl,
- DWORD dwAceIndex,
- LPVOID * pAce
- )
+GetAce(PACL pAcl,
+ DWORD dwAceIndex,
+ LPVOID *pAce)
{
- NTSTATUS Status;
-
- Status = RtlGetAce (pAcl,
- dwAceIndex,
- pAce);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
-
- return TRUE;
+ NTSTATUS Status;
+
+ Status = RtlGetAce(pAcl,
+ dwAceIndex,
+ pAce);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
}
*/
DWORD
STDCALL
-GetInheritanceSourceW (
- LPWSTR pObjectName,
- SE_OBJECT_TYPE ObjectType,
- SECURITY_INFORMATION SecurityInfo,
- BOOL Container,
- GUID** pObjectClassGuids OPTIONAL,
- DWORD GuidCount,
- PACL pAcl,
- PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL,
- PGENERIC_MAPPING pGenericMapping,
- PINHERITED_FROMW pInheritArray
- )
+GetInheritanceSourceW(LPWSTR pObjectName,
+ SE_OBJECT_TYPE ObjectType,
+ SECURITY_INFORMATION SecurityInfo,
+ BOOL Container,
+ GUID **pObjectClassGuids OPTIONAL,
+ DWORD GuidCount,
+ PACL pAcl,
+ PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL,
+ PGENERIC_MAPPING pGenericMapping,
+ PINHERITED_FROMW pInheritArray)
{
DWORD ErrorCode;
*/
DWORD
STDCALL
-GetInheritanceSourceA (
- LPSTR pObjectName,
- SE_OBJECT_TYPE ObjectType,
- SECURITY_INFORMATION SecurityInfo,
- BOOL Container,
- GUID** pObjectClassGuids OPTIONAL,
- DWORD GuidCount,
- PACL pAcl,
- PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL,
- PGENERIC_MAPPING pGenericMapping,
- PINHERITED_FROMA pInheritArray
- )
+GetInheritanceSourceA(LPSTR pObjectName,
+ SE_OBJECT_TYPE ObjectType,
+ SECURITY_INFORMATION SecurityInfo,
+ BOOL Container,
+ GUID **pObjectClassGuids OPTIONAL,
+ DWORD GuidCount,
+ PACL pAcl,
+ PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL,
+ PGENERIC_MAPPING pGenericMapping,
+ PINHERITED_FROMA pInheritArray)
{
/* That's all this function does, at least up to w2k3... Even MS was too
lazy to implement it... */
*/
DWORD
STDCALL
-FreeInheritedFromArray (
- PINHERITED_FROMW pInheritArray,
- USHORT AceCnt,
- PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL
- )
+FreeInheritedFromArray(PINHERITED_FROMW pInheritArray,
+ USHORT AceCnt,
+ PFN_OBJECT_MGR_FUNCTS pfnArray OPTIONAL)
{
DWORD ErrorCode;
*/
DWORD
STDCALL
-SetEntriesInAclW(
- ULONG cCountOfExplicitEntries,
- PEXPLICIT_ACCESS_W pListOfExplicitEntries,
- PACL OldAcl,
- PACL* NewAcl)
+SetEntriesInAclW(ULONG cCountOfExplicitEntries,
+ PEXPLICIT_ACCESS_W pListOfExplicitEntries,
+ PACL OldAcl,
+ PACL *NewAcl)
{
DWORD ErrorCode;
*/
DWORD
STDCALL
-SetEntriesInAclA(
- ULONG cCountOfExplicitEntries,
- PEXPLICIT_ACCESS_A pListOfExplicitEntries,
- PACL OldAcl,
- PACL* NewAcl)
+SetEntriesInAclA(ULONG cCountOfExplicitEntries,
+ PEXPLICIT_ACCESS_A pListOfExplicitEntries,
+ PACL OldAcl,
+ PACL *NewAcl)
{
PEXPLICIT_ACCESS_W ListOfExplicitEntriesW = NULL;
DWORD ErrorCode;
ErrorCode = InternalExplicitAccessAToW(cCountOfExplicitEntries,
pListOfExplicitEntries,
&ListOfExplicitEntriesW);
-
if (ErrorCode == ERROR_SUCCESS)
{
ErrorCode = SetEntriesInAclW(cCountOfExplicitEntries,
*/
DWORD
STDCALL
-GetExplicitEntriesFromAclW(
- PACL pacl,
- PULONG pcCountOfExplicitEntries,
- PEXPLICIT_ACCESS_W* pListOfExplicitEntries
- )
+GetExplicitEntriesFromAclW(PACL pacl,
+ PULONG pcCountOfExplicitEntries,
+ PEXPLICIT_ACCESS_W *pListOfExplicitEntries)
{
DWORD ErrorCode;
IN PTRUSTEE_W pTrustee,
OUT PACCESS_MASK pAccessRights)
{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- return ERROR_CALL_NOT_IMPLEMENTED;
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ return ERROR_CALL_NOT_IMPLEMENTED;
}
OUT PACCESS_MASK pSuccessfulAuditedRights,
OUT PACCESS_MASK pFailedAuditRights)
{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- return ERROR_CALL_NOT_IMPLEMENTED;
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ return ERROR_CALL_NOT_IMPLEMENTED;
}
* @implemented
*/
BOOL STDCALL
-AccessCheckAndAuditAlarmA (LPCSTR SubsystemName,
- LPVOID HandleId,
- LPSTR ObjectTypeName,
- LPSTR ObjectName,
- PSECURITY_DESCRIPTOR SecurityDescriptor,
- DWORD DesiredAccess,
- PGENERIC_MAPPING GenericMapping,
- BOOL ObjectCreation,
- LPDWORD GrantedAccess,
- LPBOOL AccessStatus,
- LPBOOL pfGenerateOnClose)
+AccessCheckAndAuditAlarmA(LPCSTR SubsystemName,
+ LPVOID HandleId,
+ LPSTR ObjectTypeName,
+ LPSTR ObjectName,
+ PSECURITY_DESCRIPTOR SecurityDescriptor,
+ DWORD DesiredAccess,
+ PGENERIC_MAPPING GenericMapping,
+ BOOL ObjectCreation,
+ LPDWORD GrantedAccess,
+ LPBOOL AccessStatus,
+ LPBOOL pfGenerateOnClose)
{
- UNICODE_STRING SubsystemNameU;
- UNICODE_STRING ObjectTypeNameU;
- UNICODE_STRING ObjectNameU;
- NTSTATUS LocalAccessStatus;
- BOOLEAN GenerateOnClose;
- NTSTATUS Status;
-
- RtlCreateUnicodeStringFromAsciiz (&SubsystemNameU,
- (PCHAR)SubsystemName);
- RtlCreateUnicodeStringFromAsciiz (&ObjectTypeNameU,
- (PCHAR)ObjectTypeName);
- RtlCreateUnicodeStringFromAsciiz (&ObjectNameU,
- (PCHAR)ObjectName);
-
- Status = NtAccessCheckAndAuditAlarm (&SubsystemNameU,
- HandleId,
- &ObjectTypeNameU,
- &ObjectNameU,
- SecurityDescriptor,
- DesiredAccess,
- GenericMapping,
- ObjectCreation,
- GrantedAccess,
- &LocalAccessStatus,
- &GenerateOnClose);
- RtlFreeUnicodeString (&SubsystemNameU);
- RtlFreeUnicodeString (&ObjectTypeNameU);
- RtlFreeUnicodeString (&ObjectNameU);
-
- *pfGenerateOnClose = (BOOL)GenerateOnClose;
-
- if (!NT_SUCCESS (Status))
+ UNICODE_STRING SubsystemNameU;
+ UNICODE_STRING ObjectTypeNameU;
+ UNICODE_STRING ObjectNameU;
+ NTSTATUS LocalAccessStatus;
+ BOOLEAN GenerateOnClose;
+ NTSTATUS Status;
+
+ RtlCreateUnicodeStringFromAsciiz(&SubsystemNameU,
+ (PCHAR)SubsystemName);
+ RtlCreateUnicodeStringFromAsciiz(&ObjectTypeNameU,
+ (PCHAR)ObjectTypeName);
+ RtlCreateUnicodeStringFromAsciiz(&ObjectNameU,
+ (PCHAR)ObjectName);
+
+ Status = NtAccessCheckAndAuditAlarm(&SubsystemNameU,
+ HandleId,
+ &ObjectTypeNameU,
+ &ObjectNameU,
+ SecurityDescriptor,
+ DesiredAccess,
+ GenericMapping,
+ ObjectCreation,
+ GrantedAccess,
+ &LocalAccessStatus,
+ &GenerateOnClose);
+ RtlFreeUnicodeString(&SubsystemNameU);
+ RtlFreeUnicodeString(&ObjectTypeNameU);
+ RtlFreeUnicodeString(&ObjectNameU);
+
+ *pfGenerateOnClose = (BOOL)GenerateOnClose;
+
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- if (!NT_SUCCESS (LocalAccessStatus))
+ if (!NT_SUCCESS (LocalAccessStatus))
{
- *AccessStatus = FALSE;
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ *AccessStatus = FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- *AccessStatus = TRUE;
+ *AccessStatus = TRUE;
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-AccessCheckAndAuditAlarmW (LPCWSTR SubsystemName,
- LPVOID HandleId,
- LPWSTR ObjectTypeName,
- LPWSTR ObjectName,
- PSECURITY_DESCRIPTOR SecurityDescriptor,
- DWORD DesiredAccess,
- PGENERIC_MAPPING GenericMapping,
- BOOL ObjectCreation,
- LPDWORD GrantedAccess,
- LPBOOL AccessStatus,
- LPBOOL pfGenerateOnClose)
+AccessCheckAndAuditAlarmW(LPCWSTR SubsystemName,
+ LPVOID HandleId,
+ LPWSTR ObjectTypeName,
+ LPWSTR ObjectName,
+ PSECURITY_DESCRIPTOR SecurityDescriptor,
+ DWORD DesiredAccess,
+ PGENERIC_MAPPING GenericMapping,
+ BOOL ObjectCreation,
+ LPDWORD GrantedAccess,
+ LPBOOL AccessStatus,
+ LPBOOL pfGenerateOnClose)
{
- UNICODE_STRING SubsystemNameU;
- UNICODE_STRING ObjectTypeNameU;
- UNICODE_STRING ObjectNameU;
- NTSTATUS LocalAccessStatus;
- BOOLEAN GenerateOnClose;
- NTSTATUS Status;
-
- RtlInitUnicodeString (&SubsystemNameU,
- (PWSTR)SubsystemName);
- RtlInitUnicodeString (&ObjectTypeNameU,
- (PWSTR)ObjectTypeName);
- RtlInitUnicodeString (&ObjectNameU,
- (PWSTR)ObjectName);
-
- Status = NtAccessCheckAndAuditAlarm (&SubsystemNameU,
- HandleId,
- &ObjectTypeNameU,
- &ObjectNameU,
- SecurityDescriptor,
- DesiredAccess,
- GenericMapping,
- ObjectCreation,
- GrantedAccess,
- &LocalAccessStatus,
- &GenerateOnClose);
-
- *pfGenerateOnClose = (BOOL)GenerateOnClose;
-
- if (!NT_SUCCESS (Status))
+ UNICODE_STRING SubsystemNameU;
+ UNICODE_STRING ObjectTypeNameU;
+ UNICODE_STRING ObjectNameU;
+ NTSTATUS LocalAccessStatus;
+ BOOLEAN GenerateOnClose;
+ NTSTATUS Status;
+
+ RtlInitUnicodeString(&SubsystemNameU,
+ (PWSTR)SubsystemName);
+ RtlInitUnicodeString(&ObjectTypeNameU,
+ (PWSTR)ObjectTypeName);
+ RtlInitUnicodeString(&ObjectNameU,
+ (PWSTR)ObjectName);
+
+ Status = NtAccessCheckAndAuditAlarm(&SubsystemNameU,
+ HandleId,
+ &ObjectTypeNameU,
+ &ObjectNameU,
+ SecurityDescriptor,
+ DesiredAccess,
+ GenericMapping,
+ ObjectCreation,
+ GrantedAccess,
+ &LocalAccessStatus,
+ &GenerateOnClose);
+
+ *pfGenerateOnClose = (BOOL)GenerateOnClose;
+
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- if (!NT_SUCCESS (LocalAccessStatus))
+ if (!NT_SUCCESS(LocalAccessStatus))
{
- *AccessStatus = FALSE;
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ *AccessStatus = FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- *AccessStatus = TRUE;
+ *AccessStatus = TRUE;
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-ObjectCloseAuditAlarmA (LPCSTR SubsystemName,
- LPVOID HandleId,
- BOOL GenerateOnClose)
+ObjectCloseAuditAlarmA(LPCSTR SubsystemName,
+ LPVOID HandleId,
+ BOOL GenerateOnClose)
{
- UNICODE_STRING Name;
- NTSTATUS Status;
+ UNICODE_STRING Name;
+ NTSTATUS Status;
- Status = RtlCreateUnicodeStringFromAsciiz (&Name,
- (PCHAR)SubsystemName);
- if (!NT_SUCCESS (Status))
+ Status = RtlCreateUnicodeStringFromAsciiz(&Name,
+ (PCHAR)SubsystemName);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- Status = NtCloseObjectAuditAlarm (&Name,
- HandleId,
- GenerateOnClose);
- RtlFreeUnicodeString(&Name);
- if (!NT_SUCCESS (Status))
+ Status = NtCloseObjectAuditAlarm(&Name,
+ HandleId,
+ GenerateOnClose);
+ RtlFreeUnicodeString(&Name);
+ if (!NT_SUCCESS (Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
+
/*
* @implemented
*/
BOOL STDCALL
-ObjectCloseAuditAlarmW (LPCWSTR SubsystemName,
- LPVOID HandleId,
- BOOL GenerateOnClose)
+ObjectCloseAuditAlarmW(LPCWSTR SubsystemName,
+ LPVOID HandleId,
+ BOOL GenerateOnClose)
{
- UNICODE_STRING Name;
- NTSTATUS Status;
+ UNICODE_STRING Name;
+ NTSTATUS Status;
- RtlInitUnicodeString (&Name,
- (PWSTR)SubsystemName);
+ RtlInitUnicodeString(&Name,
+ (PWSTR)SubsystemName);
- Status = NtCloseObjectAuditAlarm (&Name,
- HandleId,
- GenerateOnClose);
- if (!NT_SUCCESS (Status))
+ Status = NtCloseObjectAuditAlarm(&Name,
+ HandleId,
+ GenerateOnClose);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-ObjectDeleteAuditAlarmA (LPCSTR SubsystemName,
- LPVOID HandleId,
- BOOL GenerateOnClose)
+ObjectDeleteAuditAlarmA(LPCSTR SubsystemName,
+ LPVOID HandleId,
+ BOOL GenerateOnClose)
{
- UNICODE_STRING Name;
- NTSTATUS Status;
+ UNICODE_STRING Name;
+ NTSTATUS Status;
- Status = RtlCreateUnicodeStringFromAsciiz (&Name,
- (PCHAR)SubsystemName);
- if (!NT_SUCCESS (Status))
+ Status = RtlCreateUnicodeStringFromAsciiz(&Name,
+ (PCHAR)SubsystemName);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- Status = NtDeleteObjectAuditAlarm (&Name,
- HandleId,
- GenerateOnClose);
- RtlFreeUnicodeString(&Name);
- if (!NT_SUCCESS (Status))
+ Status = NtDeleteObjectAuditAlarm(&Name,
+ HandleId,
+ GenerateOnClose);
+ RtlFreeUnicodeString(&Name);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-ObjectDeleteAuditAlarmW (LPCWSTR SubsystemName,
- LPVOID HandleId,
- BOOL GenerateOnClose)
+ObjectDeleteAuditAlarmW(LPCWSTR SubsystemName,
+ LPVOID HandleId,
+ BOOL GenerateOnClose)
{
- UNICODE_STRING Name;
- NTSTATUS Status;
+ UNICODE_STRING Name;
+ NTSTATUS Status;
- RtlInitUnicodeString (&Name,
- (PWSTR)SubsystemName);
+ RtlInitUnicodeString(&Name,
+ (PWSTR)SubsystemName);
- Status = NtDeleteObjectAuditAlarm (&Name,
- HandleId,
- GenerateOnClose);
- if (!NT_SUCCESS (Status))
+ Status = NtDeleteObjectAuditAlarm(&Name,
+ HandleId,
+ GenerateOnClose);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-ObjectOpenAuditAlarmA (LPCSTR SubsystemName,
- LPVOID HandleId,
- LPSTR ObjectTypeName,
- LPSTR ObjectName,
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- HANDLE ClientToken,
- DWORD DesiredAccess,
- DWORD GrantedAccess,
- PPRIVILEGE_SET Privileges,
- BOOL ObjectCreation,
- BOOL AccessGranted,
- LPBOOL GenerateOnClose)
+ObjectOpenAuditAlarmA(LPCSTR SubsystemName,
+ LPVOID HandleId,
+ LPSTR ObjectTypeName,
+ LPSTR ObjectName,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ HANDLE ClientToken,
+ DWORD DesiredAccess,
+ DWORD GrantedAccess,
+ PPRIVILEGE_SET Privileges,
+ BOOL ObjectCreation,
+ BOOL AccessGranted,
+ LPBOOL GenerateOnClose)
{
- UNICODE_STRING SubsystemNameU;
- UNICODE_STRING ObjectTypeNameU;
- UNICODE_STRING ObjectNameU;
- NTSTATUS Status;
-
- RtlCreateUnicodeStringFromAsciiz (&SubsystemNameU,
- (PCHAR)SubsystemName);
- RtlCreateUnicodeStringFromAsciiz (&ObjectTypeNameU,
- (PCHAR)ObjectTypeName);
- RtlCreateUnicodeStringFromAsciiz (&ObjectNameU,
- (PCHAR)ObjectName);
-
- Status = NtOpenObjectAuditAlarm (&SubsystemNameU,
- HandleId,
- &ObjectTypeNameU,
- &ObjectNameU,
- pSecurityDescriptor,
- ClientToken,
- DesiredAccess,
- GrantedAccess,
- Privileges,
- ObjectCreation,
- AccessGranted,
- (PBOOLEAN)GenerateOnClose);
- RtlFreeUnicodeString (&SubsystemNameU);
- RtlFreeUnicodeString (&ObjectTypeNameU);
- RtlFreeUnicodeString (&ObjectNameU);
- if (!NT_SUCCESS (Status))
+ UNICODE_STRING SubsystemNameU;
+ UNICODE_STRING ObjectTypeNameU;
+ UNICODE_STRING ObjectNameU;
+ NTSTATUS Status;
+
+ RtlCreateUnicodeStringFromAsciiz(&SubsystemNameU,
+ (PCHAR)SubsystemName);
+ RtlCreateUnicodeStringFromAsciiz(&ObjectTypeNameU,
+ (PCHAR)ObjectTypeName);
+ RtlCreateUnicodeStringFromAsciiz(&ObjectNameU,
+ (PCHAR)ObjectName);
+
+ Status = NtOpenObjectAuditAlarm(&SubsystemNameU,
+ HandleId,
+ &ObjectTypeNameU,
+ &ObjectNameU,
+ pSecurityDescriptor,
+ ClientToken,
+ DesiredAccess,
+ GrantedAccess,
+ Privileges,
+ ObjectCreation,
+ AccessGranted,
+ (PBOOLEAN)GenerateOnClose);
+ RtlFreeUnicodeString(&SubsystemNameU);
+ RtlFreeUnicodeString(&ObjectTypeNameU);
+ RtlFreeUnicodeString(&ObjectNameU);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-ObjectOpenAuditAlarmW (LPCWSTR SubsystemName,
- LPVOID HandleId,
- LPWSTR ObjectTypeName,
- LPWSTR ObjectName,
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- HANDLE ClientToken,
- DWORD DesiredAccess,
- DWORD GrantedAccess,
- PPRIVILEGE_SET Privileges,
- BOOL ObjectCreation,
- BOOL AccessGranted,
- LPBOOL GenerateOnClose)
+ObjectOpenAuditAlarmW(LPCWSTR SubsystemName,
+ LPVOID HandleId,
+ LPWSTR ObjectTypeName,
+ LPWSTR ObjectName,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ HANDLE ClientToken,
+ DWORD DesiredAccess,
+ DWORD GrantedAccess,
+ PPRIVILEGE_SET Privileges,
+ BOOL ObjectCreation,
+ BOOL AccessGranted,
+ LPBOOL GenerateOnClose)
{
- UNICODE_STRING SubsystemNameU;
- UNICODE_STRING ObjectTypeNameU;
- UNICODE_STRING ObjectNameU;
- NTSTATUS Status;
-
- RtlInitUnicodeString (&SubsystemNameU,
- (PWSTR)SubsystemName);
- RtlInitUnicodeString (&ObjectTypeNameU,
- (PWSTR)ObjectTypeName);
- RtlInitUnicodeString (&ObjectNameU,
- (PWSTR)ObjectName);
-
- Status = NtOpenObjectAuditAlarm (&SubsystemNameU,
- HandleId,
- &ObjectTypeNameU,
- &ObjectNameU,
- pSecurityDescriptor,
- ClientToken,
- DesiredAccess,
- GrantedAccess,
- Privileges,
- ObjectCreation,
- AccessGranted,
- (PBOOLEAN)GenerateOnClose);
- if (!NT_SUCCESS (Status))
+ UNICODE_STRING SubsystemNameU;
+ UNICODE_STRING ObjectTypeNameU;
+ UNICODE_STRING ObjectNameU;
+ NTSTATUS Status;
+
+ RtlInitUnicodeString(&SubsystemNameU,
+ (PWSTR)SubsystemName);
+ RtlInitUnicodeString(&ObjectTypeNameU,
+ (PWSTR)ObjectTypeName);
+ RtlInitUnicodeString(&ObjectNameU,
+ (PWSTR)ObjectName);
+
+ Status = NtOpenObjectAuditAlarm(&SubsystemNameU,
+ HandleId,
+ &ObjectTypeNameU,
+ &ObjectNameU,
+ pSecurityDescriptor,
+ ClientToken,
+ DesiredAccess,
+ GrantedAccess,
+ Privileges,
+ ObjectCreation,
+ AccessGranted,
+ (PBOOLEAN)GenerateOnClose);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-ObjectPrivilegeAuditAlarmA (LPCSTR SubsystemName,
- LPVOID HandleId,
- HANDLE ClientToken,
- DWORD DesiredAccess,
- PPRIVILEGE_SET Privileges,
- BOOL AccessGranted)
+ObjectPrivilegeAuditAlarmA(LPCSTR SubsystemName,
+ LPVOID HandleId,
+ HANDLE ClientToken,
+ DWORD DesiredAccess,
+ PPRIVILEGE_SET Privileges,
+ BOOL AccessGranted)
{
- UNICODE_STRING SubsystemNameU;
- NTSTATUS Status;
-
- RtlCreateUnicodeStringFromAsciiz (&SubsystemNameU,
- (PCHAR)SubsystemName);
-
- Status = NtPrivilegeObjectAuditAlarm (&SubsystemNameU,
- HandleId,
- ClientToken,
- DesiredAccess,
- Privileges,
- AccessGranted);
- RtlFreeUnicodeString (&SubsystemNameU);
- if (!NT_SUCCESS (Status))
+ UNICODE_STRING SubsystemNameU;
+ NTSTATUS Status;
+
+ RtlCreateUnicodeStringFromAsciiz(&SubsystemNameU,
+ (PCHAR)SubsystemName);
+
+ Status = NtPrivilegeObjectAuditAlarm(&SubsystemNameU,
+ HandleId,
+ ClientToken,
+ DesiredAccess,
+ Privileges,
+ AccessGranted);
+ RtlFreeUnicodeString (&SubsystemNameU);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-ObjectPrivilegeAuditAlarmW (LPCWSTR SubsystemName,
- LPVOID HandleId,
- HANDLE ClientToken,
- DWORD DesiredAccess,
- PPRIVILEGE_SET Privileges,
- BOOL AccessGranted)
+ObjectPrivilegeAuditAlarmW(LPCWSTR SubsystemName,
+ LPVOID HandleId,
+ HANDLE ClientToken,
+ DWORD DesiredAccess,
+ PPRIVILEGE_SET Privileges,
+ BOOL AccessGranted)
{
- UNICODE_STRING SubsystemNameU;
- NTSTATUS Status;
-
- RtlInitUnicodeString (&SubsystemNameU,
- (PWSTR)SubsystemName);
-
- Status = NtPrivilegeObjectAuditAlarm (&SubsystemNameU,
- HandleId,
- ClientToken,
- DesiredAccess,
- Privileges,
- AccessGranted);
- if (!NT_SUCCESS (Status))
+ UNICODE_STRING SubsystemNameU;
+ NTSTATUS Status;
+
+ RtlInitUnicodeString(&SubsystemNameU,
+ (PWSTR)SubsystemName);
+
+ Status = NtPrivilegeObjectAuditAlarm(&SubsystemNameU,
+ HandleId,
+ ClientToken,
+ DesiredAccess,
+ Privileges,
+ AccessGranted);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-PrivilegedServiceAuditAlarmA (LPCSTR SubsystemName,
- LPCSTR ServiceName,
- HANDLE ClientToken,
- PPRIVILEGE_SET Privileges,
- BOOL AccessGranted)
+PrivilegedServiceAuditAlarmA(LPCSTR SubsystemName,
+ LPCSTR ServiceName,
+ HANDLE ClientToken,
+ PPRIVILEGE_SET Privileges,
+ BOOL AccessGranted)
{
- UNICODE_STRING SubsystemNameU;
- UNICODE_STRING ServiceNameU;
- NTSTATUS Status;
-
- RtlCreateUnicodeStringFromAsciiz (&SubsystemNameU,
- (PCHAR)SubsystemName);
- RtlCreateUnicodeStringFromAsciiz (&ServiceNameU,
- (PCHAR)ServiceName);
-
- Status = NtPrivilegedServiceAuditAlarm (&SubsystemNameU,
- &ServiceNameU,
- ClientToken,
- Privileges,
- AccessGranted);
- RtlFreeUnicodeString (&SubsystemNameU);
- RtlFreeUnicodeString (&ServiceNameU);
- if (!NT_SUCCESS (Status))
+ UNICODE_STRING SubsystemNameU;
+ UNICODE_STRING ServiceNameU;
+ NTSTATUS Status;
+
+ RtlCreateUnicodeStringFromAsciiz(&SubsystemNameU,
+ (PCHAR)SubsystemName);
+ RtlCreateUnicodeStringFromAsciiz(&ServiceNameU,
+ (PCHAR)ServiceName);
+
+ Status = NtPrivilegedServiceAuditAlarm(&SubsystemNameU,
+ &ServiceNameU,
+ ClientToken,
+ Privileges,
+ AccessGranted);
+ RtlFreeUnicodeString(&SubsystemNameU);
+ RtlFreeUnicodeString(&ServiceNameU);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-PrivilegedServiceAuditAlarmW (LPCWSTR SubsystemName,
- LPCWSTR ServiceName,
- HANDLE ClientToken,
- PPRIVILEGE_SET Privileges,
- BOOL AccessGranted)
+PrivilegedServiceAuditAlarmW(LPCWSTR SubsystemName,
+ LPCWSTR ServiceName,
+ HANDLE ClientToken,
+ PPRIVILEGE_SET Privileges,
+ BOOL AccessGranted)
{
- UNICODE_STRING SubsystemNameU;
- UNICODE_STRING ServiceNameU;
- NTSTATUS Status;
-
- RtlInitUnicodeString (&SubsystemNameU,
- (PWSTR)SubsystemName);
- RtlInitUnicodeString (&ServiceNameU,
- (PWSTR)ServiceName);
-
- Status = NtPrivilegedServiceAuditAlarm (&SubsystemNameU,
- &ServiceNameU,
- ClientToken,
- Privileges,
- AccessGranted);
- if (!NT_SUCCESS (Status))
+ UNICODE_STRING SubsystemNameU;
+ UNICODE_STRING ServiceNameU;
+ NTSTATUS Status;
+
+ RtlInitUnicodeString(&SubsystemNameU,
+ (PWSTR)SubsystemName);
+ RtlInitUnicodeString(&ServiceNameU,
+ (PWSTR)ServiceName);
+
+ Status = NtPrivilegedServiceAuditAlarm(&SubsystemNameU,
+ &ServiceNameU,
+ ClientToken,
+ Privileges,
+ AccessGranted);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
OUT LPDWORD AccessStatusList,
OUT LPBOOL pfGenerateOnClose)
{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
}
OUT LPDWORD AccessStatusList,
OUT LPBOOL pfGenerateOnClose)
{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
}
OUT LPDWORD AccessStatusList,
OUT LPBOOL pfGenerateOnClose)
{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
}
OUT LPDWORD AccessStatusList,
OUT LPBOOL pfGenerateOnClose)
{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
}
OUT LPBOOL AccessStatus,
OUT LPBOOL pfGenerateOnClose)
{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
}
OUT LPBOOL AccessStatus,
OUT LPBOOL pfGenerateOnClose)
{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
}
-
/* EOF */
/* Needed for LookupAccountNameW implementation from Wine */
-typedef struct _AccountSid {
+typedef struct _AccountSid
+{
WELL_KNOWN_SID_TYPE type;
LPCWSTR account;
LPCWSTR domain;
return GetLastError(); \
}
+
static DWORD
LoadAndInitializeNtMarta(VOID)
{
return ERROR_SUCCESS;
}
+
DWORD
CheckNtMartaPresent(VOID)
{
return ErrorCode;
}
-VOID UnloadNtMarta(VOID)
+
+VOID
+UnloadNtMarta(VOID)
{
if (InterlockedExchangePointer(&NtMarta,
NULL) != NULL)
}
}
+
/******************************************************************************/
/*
* @implemented
*/
-BOOL STDCALL
+BOOL
+STDCALL
AreAllAccessesGranted(DWORD GrantedAccess,
- DWORD DesiredAccess)
+ DWORD DesiredAccess)
{
- return((BOOL)RtlAreAllAccessesGranted(GrantedAccess,
- DesiredAccess));
+ return (BOOL)RtlAreAllAccessesGranted(GrantedAccess,
+ DesiredAccess);
}
/*
* @implemented
*/
-BOOL STDCALL
+BOOL
+STDCALL
AreAnyAccessesGranted(DWORD GrantedAccess,
- DWORD DesiredAccess)
+ DWORD DesiredAccess)
{
- return((BOOL)RtlAreAnyAccessesGranted(GrantedAccess,
- DesiredAccess));
+ return (BOOL)RtlAreAnyAccessesGranted(GrantedAccess,
+ DesiredAccess);
}
*
* @implemented
*/
-BOOL WINAPI
+BOOL
+WINAPI
GetFileSecurityA(LPCSTR lpFileName,
- SECURITY_INFORMATION RequestedInformation,
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- DWORD nLength,
- LPDWORD lpnLengthNeeded)
+ SECURITY_INFORMATION RequestedInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ DWORD nLength,
+ LPDWORD lpnLengthNeeded)
{
- UNICODE_STRING FileName;
- NTSTATUS Status;
- BOOL bResult;
+ UNICODE_STRING FileName;
+ NTSTATUS Status;
+ BOOL bResult;
- Status = RtlCreateUnicodeStringFromAsciiz(&FileName,
- (LPSTR)lpFileName);
- if (!NT_SUCCESS(Status))
+ Status = RtlCreateUnicodeStringFromAsciiz(&FileName,
+ (LPSTR)lpFileName);
+ if (!NT_SUCCESS(Status))
{
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- bResult = GetFileSecurityW(FileName.Buffer,
- RequestedInformation,
- pSecurityDescriptor,
- nLength,
- lpnLengthNeeded);
+ bResult = GetFileSecurityW(FileName.Buffer,
+ RequestedInformation,
+ pSecurityDescriptor,
+ nLength,
+ lpnLengthNeeded);
- RtlFreeUnicodeString(&FileName);
+ RtlFreeUnicodeString(&FileName);
- return bResult;
+ return bResult;
}
/*
* @implemented
*/
-BOOL WINAPI
+BOOL
+WINAPI
GetFileSecurityW(LPCWSTR lpFileName,
- SECURITY_INFORMATION RequestedInformation,
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- DWORD nLength,
- LPDWORD lpnLengthNeeded)
+ SECURITY_INFORMATION RequestedInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ DWORD nLength,
+ LPDWORD lpnLengthNeeded)
{
- OBJECT_ATTRIBUTES ObjectAttributes;
- IO_STATUS_BLOCK StatusBlock;
- UNICODE_STRING FileName;
- ULONG AccessMask = 0;
- HANDLE FileHandle;
- NTSTATUS Status;
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ IO_STATUS_BLOCK StatusBlock;
+ UNICODE_STRING FileName;
+ ULONG AccessMask = 0;
+ HANDLE FileHandle;
+ NTSTATUS Status;
- TRACE("GetFileSecurityW() called\n");
+ TRACE("GetFileSecurityW() called\n");
- if (RequestedInformation &
- (OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION))
+ if (RequestedInformation &
+ (OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION))
{
- AccessMask |= READ_CONTROL;
+ AccessMask |= READ_CONTROL;
}
- if (RequestedInformation & SACL_SECURITY_INFORMATION)
+ if (RequestedInformation & SACL_SECURITY_INFORMATION)
{
- AccessMask |= ACCESS_SYSTEM_SECURITY;
+ AccessMask |= ACCESS_SYSTEM_SECURITY;
}
- if (!RtlDosPathNameToNtPathName_U(lpFileName,
- &FileName,
- NULL,
- NULL))
+ if (!RtlDosPathNameToNtPathName_U(lpFileName,
+ &FileName,
+ NULL,
+ NULL))
{
- ERR("Invalid path\n");
- SetLastError(ERROR_INVALID_NAME);
- return FALSE;
+ ERR("Invalid path\n");
+ SetLastError(ERROR_INVALID_NAME);
+ return FALSE;
}
- InitializeObjectAttributes(&ObjectAttributes,
- &FileName,
- OBJ_CASE_INSENSITIVE,
- NULL,
- NULL);
+ InitializeObjectAttributes(&ObjectAttributes,
+ &FileName,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL);
- Status = NtOpenFile(&FileHandle,
- AccessMask,
- &ObjectAttributes,
- &StatusBlock,
- FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
- 0);
+ Status = NtOpenFile(&FileHandle,
+ AccessMask,
+ &ObjectAttributes,
+ &StatusBlock,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ 0);
- RtlFreeHeap(RtlGetProcessHeap(),
- 0,
- FileName.Buffer);
+ RtlFreeHeap(RtlGetProcessHeap(),
+ 0,
+ FileName.Buffer);
- if (!NT_SUCCESS(Status))
+ if (!NT_SUCCESS(Status))
{
- ERR("NtOpenFile() failed (Status %lx)\n", Status);
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
+ ERR("NtOpenFile() failed (Status %lx)\n", Status);
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- Status = NtQuerySecurityObject(FileHandle,
- RequestedInformation,
- pSecurityDescriptor,
- nLength,
- lpnLengthNeeded);
- NtClose(FileHandle);
-
- if (!NT_SUCCESS(Status))
+ Status = NtQuerySecurityObject(FileHandle,
+ RequestedInformation,
+ pSecurityDescriptor,
+ nLength,
+ lpnLengthNeeded);
+ NtClose(FileHandle);
+ if (!NT_SUCCESS(Status))
{
- ERR("NtQuerySecurityObject() failed (Status %lx)\n", Status);
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
+ ERR("NtQuerySecurityObject() failed (Status %lx)\n", Status);
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
/*
* @implemented
*/
-BOOL STDCALL
+BOOL
+STDCALL
GetKernelObjectSecurity(HANDLE Handle,
- SECURITY_INFORMATION RequestedInformation,
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- DWORD nLength,
- LPDWORD lpnLengthNeeded)
+ SECURITY_INFORMATION RequestedInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ DWORD nLength,
+ LPDWORD lpnLengthNeeded)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = NtQuerySecurityObject(Handle,
- RequestedInformation,
- pSecurityDescriptor,
- nLength,
- lpnLengthNeeded);
- if (!NT_SUCCESS(Status))
+ Status = NtQuerySecurityObject(Handle,
+ RequestedInformation,
+ pSecurityDescriptor,
+ nLength,
+ lpnLengthNeeded);
+ if (!NT_SUCCESS(Status))
{
- SetLastError(RtlNtStatusToDosError(Status));
- return(FALSE);
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return(TRUE);
+
+ return TRUE;
}
*
* @implemented
*/
-BOOL STDCALL
-SetFileSecurityA (LPCSTR lpFileName,
- SECURITY_INFORMATION SecurityInformation,
- PSECURITY_DESCRIPTOR pSecurityDescriptor)
+BOOL
+STDCALL
+SetFileSecurityA(LPCSTR lpFileName,
+ SECURITY_INFORMATION SecurityInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor)
{
- UNICODE_STRING FileName;
- NTSTATUS Status;
- BOOL bResult;
+ UNICODE_STRING FileName;
+ NTSTATUS Status;
+ BOOL bResult;
- Status = RtlCreateUnicodeStringFromAsciiz(&FileName,
- (LPSTR)lpFileName);
- if (!NT_SUCCESS(Status))
+ Status = RtlCreateUnicodeStringFromAsciiz(&FileName,
+ (LPSTR)lpFileName);
+ if (!NT_SUCCESS(Status))
{
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- bResult = SetFileSecurityW(FileName.Buffer,
- SecurityInformation,
- pSecurityDescriptor);
+ bResult = SetFileSecurityW(FileName.Buffer,
+ SecurityInformation,
+ pSecurityDescriptor);
- RtlFreeUnicodeString(&FileName);
+ RtlFreeUnicodeString(&FileName);
- return bResult;
+ return bResult;
}
*
* @implemented
*/
-BOOL STDCALL
-SetFileSecurityW (LPCWSTR lpFileName,
- SECURITY_INFORMATION SecurityInformation,
- PSECURITY_DESCRIPTOR pSecurityDescriptor)
+BOOL
+STDCALL
+SetFileSecurityW(LPCWSTR lpFileName,
+ SECURITY_INFORMATION SecurityInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor)
{
- OBJECT_ATTRIBUTES ObjectAttributes;
- IO_STATUS_BLOCK StatusBlock;
- UNICODE_STRING FileName;
- ULONG AccessMask = 0;
- HANDLE FileHandle;
- NTSTATUS Status;
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ IO_STATUS_BLOCK StatusBlock;
+ UNICODE_STRING FileName;
+ ULONG AccessMask = 0;
+ HANDLE FileHandle;
+ NTSTATUS Status;
- TRACE("SetFileSecurityW() called\n");
+ TRACE("SetFileSecurityW() called\n");
- if (SecurityInformation &
- (OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION))
+ if (SecurityInformation &
+ (OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION))
{
- AccessMask |= WRITE_OWNER;
+ AccessMask |= WRITE_OWNER;
}
- if (SecurityInformation & DACL_SECURITY_INFORMATION)
+ if (SecurityInformation & DACL_SECURITY_INFORMATION)
{
- AccessMask |= WRITE_DAC;
+ AccessMask |= WRITE_DAC;
}
- if (SecurityInformation & SACL_SECURITY_INFORMATION)
+ if (SecurityInformation & SACL_SECURITY_INFORMATION)
{
- AccessMask |= ACCESS_SYSTEM_SECURITY;
+ AccessMask |= ACCESS_SYSTEM_SECURITY;
}
- if (!RtlDosPathNameToNtPathName_U(lpFileName,
- &FileName,
- NULL,
- NULL))
+ if (!RtlDosPathNameToNtPathName_U(lpFileName,
+ &FileName,
+ NULL,
+ NULL))
{
- ERR("Invalid path\n");
- SetLastError(ERROR_INVALID_NAME);
- return FALSE;
+ ERR("Invalid path\n");
+ SetLastError(ERROR_INVALID_NAME);
+ return FALSE;
}
- InitializeObjectAttributes(&ObjectAttributes,
- &FileName,
- OBJ_CASE_INSENSITIVE,
- NULL,
- NULL);
+ InitializeObjectAttributes(&ObjectAttributes,
+ &FileName,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL);
- Status = NtOpenFile(&FileHandle,
- AccessMask,
- &ObjectAttributes,
- &StatusBlock,
- FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
- 0);
+ Status = NtOpenFile(&FileHandle,
+ AccessMask,
+ &ObjectAttributes,
+ &StatusBlock,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ 0);
- RtlFreeHeap(RtlGetProcessHeap(),
- 0,
- FileName.Buffer);
+ RtlFreeHeap(RtlGetProcessHeap(),
+ 0,
+ FileName.Buffer);
- if (!NT_SUCCESS(Status))
+ if (!NT_SUCCESS(Status))
{
- ERR("NtOpenFile() failed (Status %lx)\n", Status);
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
+ ERR("NtOpenFile() failed (Status %lx)\n", Status);
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- Status = NtSetSecurityObject(FileHandle,
- SecurityInformation,
- pSecurityDescriptor);
- NtClose(FileHandle);
+ Status = NtSetSecurityObject(FileHandle,
+ SecurityInformation,
+ pSecurityDescriptor);
+ NtClose(FileHandle);
- if (!NT_SUCCESS(Status))
+ if (!NT_SUCCESS(Status))
{
- ERR("NtSetSecurityObject() failed (Status %lx)\n", Status);
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
+ ERR("NtSetSecurityObject() failed (Status %lx)\n", Status);
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
/*
* @implemented
*/
-BOOL STDCALL
+BOOL
+STDCALL
SetKernelObjectSecurity(HANDLE Handle,
- SECURITY_INFORMATION SecurityInformation,
- PSECURITY_DESCRIPTOR SecurityDescriptor)
+ SECURITY_INFORMATION SecurityInformation,
+ PSECURITY_DESCRIPTOR SecurityDescriptor)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = NtSetSecurityObject(Handle,
- SecurityInformation,
- SecurityDescriptor);
- if (!NT_SUCCESS(Status))
+ Status = NtSetSecurityObject(Handle,
+ SecurityInformation,
+ SecurityDescriptor);
+ if (!NT_SUCCESS(Status))
{
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+
+ return TRUE;
}
NTSTATUS Status;
Status = NtImpersonateAnonymousToken(ThreadHandle);
-
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
/*
* @implemented
*/
-BOOL STDCALL
+BOOL
+STDCALL
ImpersonateLoggedOnUser(HANDLE hToken)
{
- SECURITY_QUALITY_OF_SERVICE Qos;
- OBJECT_ATTRIBUTES ObjectAttributes;
- HANDLE NewToken;
- TOKEN_TYPE Type;
- ULONG ReturnLength;
- BOOL Duplicated;
- NTSTATUS Status;
-
- /* Get the token type */
- Status = NtQueryInformationToken (hToken,
- TokenType,
- &Type,
- sizeof(TOKEN_TYPE),
- &ReturnLength);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SECURITY_QUALITY_OF_SERVICE Qos;
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ HANDLE NewToken;
+ TOKEN_TYPE Type;
+ ULONG ReturnLength;
+ BOOL Duplicated;
+ NTSTATUS Status;
+
+ /* Get the token type */
+ Status = NtQueryInformationToken(hToken,
+ TokenType,
+ &Type,
+ sizeof(TOKEN_TYPE),
+ &ReturnLength);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- if (Type == TokenPrimary)
- {
- /* Create a duplicate impersonation token */
- Qos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
- Qos.ImpersonationLevel = SecurityImpersonation;
- Qos.ContextTrackingMode = SECURITY_DYNAMIC_TRACKING;
- Qos.EffectiveOnly = FALSE;
-
- ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
- ObjectAttributes.RootDirectory = NULL;
- ObjectAttributes.ObjectName = NULL;
- ObjectAttributes.Attributes = 0;
- ObjectAttributes.SecurityDescriptor = NULL;
- ObjectAttributes.SecurityQualityOfService = &Qos;
-
- Status = NtDuplicateToken (hToken,
- TOKEN_IMPERSONATE | TOKEN_QUERY,
- &ObjectAttributes,
- FALSE,
- TokenImpersonation,
- &NewToken);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ if (Type == TokenPrimary)
+ {
+ /* Create a duplicate impersonation token */
+ Qos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
+ Qos.ImpersonationLevel = SecurityImpersonation;
+ Qos.ContextTrackingMode = SECURITY_DYNAMIC_TRACKING;
+ Qos.EffectiveOnly = FALSE;
+
+ ObjectAttributes.Length = sizeof(OBJECT_ATTRIBUTES);
+ ObjectAttributes.RootDirectory = NULL;
+ ObjectAttributes.ObjectName = NULL;
+ ObjectAttributes.Attributes = 0;
+ ObjectAttributes.SecurityDescriptor = NULL;
+ ObjectAttributes.SecurityQualityOfService = &Qos;
+
+ Status = NtDuplicateToken(hToken,
+ TOKEN_IMPERSONATE | TOKEN_QUERY,
+ &ObjectAttributes,
+ FALSE,
+ TokenImpersonation,
+ &NewToken);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- Duplicated = TRUE;
+ Duplicated = TRUE;
}
- else
+ else
{
- /* User the original impersonation token */
- NewToken = hToken;
- Duplicated = FALSE;
+ /* User the original impersonation token */
+ NewToken = hToken;
+ Duplicated = FALSE;
}
- /* Impersonate the the current thread */
- Status = NtSetInformationThread (NtCurrentThread (),
- ThreadImpersonationToken,
- &NewToken,
- sizeof(HANDLE));
+ /* Impersonate the the current thread */
+ Status = NtSetInformationThread(NtCurrentThread(),
+ ThreadImpersonationToken,
+ &NewToken,
+ sizeof(HANDLE));
- if (Duplicated == TRUE)
+ if (Duplicated == TRUE)
{
- NtClose (NewToken);
+ NtClose(NewToken);
}
- if (!NT_SUCCESS(Status))
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
/*
* @implemented
*/
-BOOL STDCALL
+BOOL
+STDCALL
ImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlImpersonateSelf(ImpersonationLevel);
- if (!NT_SUCCESS(Status))
+ Status = RtlImpersonateSelf(ImpersonationLevel);
+ if (!NT_SUCCESS(Status))
{
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+
+ return TRUE;
}
/*
* @implemented
*/
-BOOL STDCALL
+BOOL
+STDCALL
RevertToSelf(VOID)
{
- NTSTATUS Status;
- HANDLE Token = NULL;
+ NTSTATUS Status;
+ HANDLE Token = NULL;
- Status = NtSetInformationThread(NtCurrentThread(),
- ThreadImpersonationToken,
- &Token,
- sizeof(HANDLE));
- if (!NT_SUCCESS(Status))
+ Status = NtSetInformationThread(NtCurrentThread(),
+ ThreadImpersonationToken,
+ &Token,
+ sizeof(HANDLE));
+ if (!NT_SUCCESS(Status))
{
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+
+ return TRUE;
}
*
* @implemented
*/
-BOOL WINAPI
-GetUserNameA( LPSTR lpszName, LPDWORD lpSize )
+BOOL
+WINAPI
+GetUserNameA(LPSTR lpszName,
+ LPDWORD lpSize)
{
- UNICODE_STRING NameW;
- ANSI_STRING NameA;
- BOOL Ret;
+ UNICODE_STRING NameW;
+ ANSI_STRING NameA;
+ BOOL Ret;
- /* apparently Win doesn't check whether lpSize is valid at all! */
+ /* apparently Win doesn't check whether lpSize is valid at all! */
- NameW.MaximumLength = (*lpSize) * sizeof(WCHAR);
- NameW.Buffer = LocalAlloc(LMEM_FIXED, NameW.MaximumLength);
- if(NameW.Buffer == NULL)
- {
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return FALSE;
- }
+ NameW.MaximumLength = (*lpSize) * sizeof(WCHAR);
+ NameW.Buffer = LocalAlloc(LMEM_FIXED, NameW.MaximumLength);
+ if(NameW.Buffer == NULL)
+ {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ return FALSE;
+ }
- NameA.Length = 0;
- NameA.MaximumLength = ((*lpSize) < 0xFFFF ? (USHORT)(*lpSize) : 0xFFFF);
- NameA.Buffer = lpszName;
+ NameA.Length = 0;
+ NameA.MaximumLength = ((*lpSize) < 0xFFFF ? (USHORT)(*lpSize) : 0xFFFF);
+ NameA.Buffer = lpszName;
- Ret = GetUserNameW(NameW.Buffer,
- lpSize);
- if(Ret)
- {
- NameW.Length = (*lpSize - 1) * sizeof(WCHAR);
- RtlUnicodeStringToAnsiString(&NameA, &NameW, FALSE);
+ Ret = GetUserNameW(NameW.Buffer,
+ lpSize);
+ if(Ret)
+ {
+ NameW.Length = (*lpSize - 1) * sizeof(WCHAR);
+ RtlUnicodeStringToAnsiString(&NameA, &NameW, FALSE);
- *lpSize = NameA.Length + 1;
- }
+ *lpSize = NameA.Length + 1;
+ }
- LocalFree(NameW.Buffer);
+ LocalFree(NameW.Buffer);
- return Ret;
+ return Ret;
}
+
/******************************************************************************
* GetUserNameW [ADVAPI32.@]
*
*
* @implemented
*/
-BOOL WINAPI
-GetUserNameW ( LPWSTR lpszName, LPDWORD lpSize )
+BOOL
+WINAPI
+GetUserNameW(LPWSTR lpszName,
+ LPDWORD lpSize )
{
HANDLE hToken = INVALID_HANDLE_VALUE;
DWORD tu_len = 0;
*
* @implemented
*/
-BOOL STDCALL
-LookupAccountSidA (LPCSTR lpSystemName,
- PSID lpSid,
- LPSTR lpName,
- LPDWORD cchName,
- LPSTR lpReferencedDomainName,
- LPDWORD cchReferencedDomainName,
- PSID_NAME_USE peUse)
+BOOL
+STDCALL
+LookupAccountSidA(LPCSTR lpSystemName,
+ PSID lpSid,
+ LPSTR lpName,
+ LPDWORD cchName,
+ LPSTR lpReferencedDomainName,
+ LPDWORD cchReferencedDomainName,
+ PSID_NAME_USE peUse)
{
UNICODE_STRING NameW, ReferencedDomainNameW, SystemNameW;
DWORD szName, szReferencedDomainName;
* @implemented
*/
BOOL WINAPI
-LookupAccountSidW (
- LPCWSTR pSystemName,
- PSID pSid,
- LPWSTR pAccountName,
- LPDWORD pdwAccountName,
- LPWSTR pDomainName,
- LPDWORD pdwDomainName,
- PSID_NAME_USE peUse )
+LookupAccountSidW(LPCWSTR pSystemName,
+ PSID pSid,
+ LPWSTR pAccountName,
+ LPDWORD pdwAccountName,
+ LPWSTR pDomainName,
+ LPDWORD pdwDomainName,
+ PSID_NAME_USE peUse)
{
LSA_UNICODE_STRING SystemName;
LSA_OBJECT_ATTRIBUTES ObjectAttributes = {0};
*
* @implemented
*/
-BOOL STDCALL
-LookupAccountNameA (LPCSTR SystemName,
- LPCSTR AccountName,
- PSID Sid,
- LPDWORD SidLength,
- LPSTR ReferencedDomainName,
- LPDWORD hReferencedDomainNameLength,
- PSID_NAME_USE SidNameUse)
+BOOL
+STDCALL
+LookupAccountNameA(LPCSTR SystemName,
+ LPCSTR AccountName,
+ PSID Sid,
+ LPDWORD SidLength,
+ LPSTR ReferencedDomainName,
+ LPDWORD hReferencedDomainNameLength,
+ PSID_NAME_USE SidNameUse)
{
BOOL ret;
UNICODE_STRING lpSystemW;
RtlCreateUnicodeStringFromAsciiz(&lpAccountW, AccountName);
if (ReferencedDomainName)
- lpReferencedDomainNameW = HeapAlloc(GetProcessHeap(), 0, *hReferencedDomainNameLength * sizeof(WCHAR));
-
- ret = LookupAccountNameW(lpSystemW.Buffer, lpAccountW.Buffer, Sid, SidLength, lpReferencedDomainNameW,
- hReferencedDomainNameLength, SidNameUse);
+ lpReferencedDomainNameW = HeapAlloc(GetProcessHeap(),
+ 0,
+ *hReferencedDomainNameLength * sizeof(WCHAR));
+
+ 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);
*
* @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};
&pSid);
if (!ret)
- return FALSE;
+ return FALSE;
if (!RtlValidSid(pSid))
{
- FreeSid(pSid);
- return FALSE;
+ FreeSid(pSid);
+ return FALSE;
}
if (Sid != NULL && (*cbSid >= GetLengthSid(pSid)))
- CopySid(*cbSid, Sid, pSid);
+ CopySid(*cbSid, Sid, pSid);
+
if (*cbSid < GetLengthSid(pSid))
{
- SetLastError(ERROR_INSUFFICIENT_BUFFER);
- ret = FALSE;
+ SetLastError(ERROR_INSUFFICIENT_BUFFER);
+ ret = FALSE;
}
+
*cbSid = GetLengthSid(pSid);
-
+
if (ReferencedDomainName != NULL && (*cchReferencedDomainName > wcslen(dm)))
- wcscpy(ReferencedDomainName, dm);
+ wcscpy(ReferencedDomainName, dm);
if (*cchReferencedDomainName <= wcslen(dm))
{
- SetLastError(ERROR_INSUFFICIENT_BUFFER);
- ret = FALSE;
+ SetLastError(ERROR_INSUFFICIENT_BUFFER);
+ ret = FALSE;
}
*cchReferencedDomainName = wcslen(dm)+1;
*
* @implemented
*/
-BOOL STDCALL
-LookupPrivilegeValueA (LPCSTR lpSystemName,
- LPCSTR lpName,
- PLUID lpLuid)
+BOOL
+STDCALL
+LookupPrivilegeValueA(LPCSTR lpSystemName,
+ LPCSTR lpName,
+ PLUID lpLuid)
{
- UNICODE_STRING SystemName;
- UNICODE_STRING Name;
- BOOL Result;
+ UNICODE_STRING SystemName;
+ UNICODE_STRING Name;
+ BOOL Result;
- /* Remote system? */
- if (lpSystemName != NULL)
+ /* Remote system? */
+ if (lpSystemName != NULL)
{
- RtlCreateUnicodeStringFromAsciiz (&SystemName,
- (LPSTR)lpSystemName);
+ RtlCreateUnicodeStringFromAsciiz(&SystemName,
+ (LPSTR)lpSystemName);
}
- /* Check the privilege name is not NULL */
- if (lpName == NULL)
+ /* Check the privilege name is not NULL */
+ if (lpName == NULL)
{
- SetLastError (ERROR_INVALID_PARAMETER);
- return FALSE;
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return FALSE;
}
- RtlCreateUnicodeStringFromAsciiz (&Name,
- (LPSTR)lpName);
+ RtlCreateUnicodeStringFromAsciiz(&Name,
+ (LPSTR)lpName);
- Result = LookupPrivilegeValueW ((lpSystemName != NULL) ? SystemName.Buffer : NULL,
- Name.Buffer,
- lpLuid);
+ Result = LookupPrivilegeValueW((lpSystemName != NULL) ? SystemName.Buffer : NULL,
+ Name.Buffer,
+ lpLuid);
- RtlFreeUnicodeString (&Name);
+ RtlFreeUnicodeString(&Name);
- /* Remote system? */
- if (lpSystemName != NULL)
+ /* Remote system? */
+ if (lpSystemName != NULL)
{
- RtlFreeUnicodeString (&SystemName);
+ RtlFreeUnicodeString(&SystemName);
}
- return Result;
+ return Result;
}
*
* @unimplemented
*/
-BOOL STDCALL
-LookupPrivilegeValueW (LPCWSTR SystemName,
- LPCWSTR PrivName,
- PLUID Luid)
+BOOL
+STDCALL
+LookupPrivilegeValueW(LPCWSTR SystemName,
+ LPCWSTR PrivName,
+ PLUID Luid)
{
static const WCHAR * const DefaultPrivNames[] =
{
*
* @unimplemented
*/
-BOOL STDCALL
-LookupPrivilegeDisplayNameA (LPCSTR lpSystemName,
- LPCSTR lpName,
- LPSTR lpDisplayName,
- LPDWORD cbDisplayName,
- LPDWORD lpLanguageId)
+BOOL
+STDCALL
+LookupPrivilegeDisplayNameA(LPCSTR lpSystemName,
+ LPCSTR lpName,
+ LPSTR lpDisplayName,
+ LPDWORD cbDisplayName,
+ LPDWORD lpLanguageId)
{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
}
*
* @unimplemented
*/
-BOOL STDCALL
-LookupPrivilegeDisplayNameW (LPCWSTR lpSystemName,
- LPCWSTR lpName,
- LPWSTR lpDisplayName,
- LPDWORD cbDisplayName,
- LPDWORD lpLanguageId)
+BOOL
+STDCALL
+LookupPrivilegeDisplayNameW(LPCWSTR lpSystemName,
+ LPCWSTR lpName,
+ LPWSTR lpDisplayName,
+ LPDWORD cbDisplayName,
+ LPDWORD lpLanguageId)
{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
}
*
* @unimplemented
*/
-BOOL STDCALL
-LookupPrivilegeNameA (LPCSTR lpSystemName,
- PLUID lpLuid,
- LPSTR lpName,
- LPDWORD cbName)
+BOOL
+STDCALL
+LookupPrivilegeNameA(LPCSTR lpSystemName,
+ PLUID lpLuid,
+ LPSTR lpName,
+ LPDWORD cbName)
{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
}
*
* @unimplemented
*/
-BOOL STDCALL
-LookupPrivilegeNameW (LPCWSTR lpSystemName,
- PLUID lpLuid,
- LPWSTR lpName,
- LPDWORD cbName)
+BOOL
+STDCALL
+LookupPrivilegeNameW(LPCWSTR lpSystemName,
+ PLUID lpLuid,
+ LPWSTR lpName,
+ LPDWORD cbName)
{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ SetLastError (ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
}
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 |
*
* @implemented
*/
-DWORD STDCALL
+DWORD
+STDCALL
GetNamedSecurityInfoW(LPWSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
*
* @implemented
*/
-DWORD STDCALL
+DWORD
+STDCALL
GetNamedSecurityInfoA(LPSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
*
* @implemented
*/
-DWORD STDCALL
+DWORD
+STDCALL
SetNamedSecurityInfoW(LPWSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
*
* @implemented
*/
-DWORD STDCALL
+DWORD
+STDCALL
SetNamedSecurityInfoA(LPSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
*
* @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;
/******************************************************************************
* GetSecurityInfoExW EXPORTED
*/
-DWORD WINAPI GetSecurityInfoExA(
- HANDLE hObject,
- SE_OBJECT_TYPE ObjectType,
- SECURITY_INFORMATION SecurityInfo,
- LPCSTR lpProvider,
- LPCSTR lpProperty,
- PACTRL_ACCESSA *ppAccessList,
- PACTRL_AUDITA *ppAuditList,
- LPSTR *lppOwner,
- LPSTR *lppGroup
- )
+DWORD
+WINAPI
+GetSecurityInfoExA(HANDLE hObject,
+ SE_OBJECT_TYPE ObjectType,
+ SECURITY_INFORMATION SecurityInfo,
+ LPCSTR lpProvider,
+ LPCSTR lpProperty,
+ PACTRL_ACCESSA *ppAccessList,
+ PACTRL_AUDITA *ppAuditList,
+ LPSTR *lppOwner,
+ LPSTR *lppGroup)
{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- return ERROR_BAD_PROVIDER;
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ return ERROR_BAD_PROVIDER;
}
/******************************************************************************
* GetSecurityInfoExW EXPORTED
*/
-DWORD WINAPI GetSecurityInfoExW(
- HANDLE hObject,
- SE_OBJECT_TYPE ObjectType,
- SECURITY_INFORMATION SecurityInfo,
- LPCWSTR lpProvider,
- LPCWSTR lpProperty,
- PACTRL_ACCESSW *ppAccessList,
- PACTRL_AUDITW *ppAuditList,
- LPWSTR *lppOwner,
- LPWSTR *lppGroup
- )
+DWORD
+WINAPI
+GetSecurityInfoExW(HANDLE hObject,
+ SE_OBJECT_TYPE ObjectType,
+ SECURITY_INFORMATION SecurityInfo,
+ LPCWSTR lpProvider,
+ LPCWSTR lpProperty,
+ PACTRL_ACCESSW *ppAccessList,
+ PACTRL_AUDITW *ppAuditList,
+ LPWSTR *lppOwner,
+ LPWSTR *lppGroup)
{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- return ERROR_BAD_PROVIDER;
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ return ERROR_BAD_PROVIDER;
}
*
* @implemented
*/
-BOOL STDCALL
+BOOL
+STDCALL
ImpersonateNamedPipeClient(HANDLE hNamedPipe)
{
- IO_STATUS_BLOCK StatusBlock;
- NTSTATUS Status;
-
- TRACE("ImpersonateNamedPipeClient() called\n");
-
- Status = NtFsControlFile(hNamedPipe,
- NULL,
- NULL,
- NULL,
- &StatusBlock,
- FSCTL_PIPE_IMPERSONATE,
- NULL,
- 0,
- NULL,
- 0);
- if (!NT_SUCCESS(Status))
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
+ IO_STATUS_BLOCK StatusBlock;
+ NTSTATUS Status;
- return TRUE;
+ TRACE("ImpersonateNamedPipeClient() called\n");
+
+ Status = NtFsControlFile(hNamedPipe,
+ NULL,
+ NULL,
+ NULL,
+ &StatusBlock,
+ FSCTL_PIPE_IMPERSONATE,
+ NULL,
+ 0,
+ NULL,
+ 0);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+
+ return TRUE;
}
/*
* @implemented
*/
-BOOL STDCALL
+BOOL
+STDCALL
CreatePrivateObjectSecurity(PSECURITY_DESCRIPTOR ParentDescriptor,
PSECURITY_DESCRIPTOR CreatorDescriptor,
PSECURITY_DESCRIPTOR *NewDescriptor,
/*
* @unimplemented
*/
-BOOL STDCALL
+BOOL
+STDCALL
CreatePrivateObjectSecurityEx(PSECURITY_DESCRIPTOR ParentDescriptor,
PSECURITY_DESCRIPTOR CreatorDescriptor,
PSECURITY_DESCRIPTOR* NewDescriptor,
/*
* @unimplemented
*/
-BOOL STDCALL
+BOOL
+STDCALL
CreatePrivateObjectSecurityWithMultipleInheritance(PSECURITY_DESCRIPTOR ParentDescriptor,
PSECURITY_DESCRIPTOR CreatorDescriptor,
PSECURITY_DESCRIPTOR* NewDescriptor,
/*
* @implemented
*/
-BOOL STDCALL
+BOOL
+STDCALL
DestroyPrivateObjectSecurity(PSECURITY_DESCRIPTOR *ObjectDescriptor)
{
NTSTATUS Status;
/*
* @implemented
*/
-BOOL STDCALL
+BOOL
+STDCALL
GetPrivateObjectSecurity(PSECURITY_DESCRIPTOR ObjectDescriptor,
SECURITY_INFORMATION SecurityInformation,
PSECURITY_DESCRIPTOR ResultantDescriptor,
/*
* @implemented
*/
-BOOL STDCALL
+BOOL
+STDCALL
SetPrivateObjectSecurity(SECURITY_INFORMATION SecurityInformation,
PSECURITY_DESCRIPTOR ModificationDescriptor,
PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
/*
* @implemented
*/
-DWORD STDCALL
+DWORD
+STDCALL
TreeResetNamedSecurityInfoW(LPWSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
/*
* @implemented
*/
-DWORD STDCALL
+DWORD
+STDCALL
TreeResetNamedSecurityInfoA(LPSTR pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
*/
BOOL
STDCALL
-GetSecurityDescriptorControl (
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- PSECURITY_DESCRIPTOR_CONTROL pControl,
- LPDWORD lpdwRevision
- )
+GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ PSECURITY_DESCRIPTOR_CONTROL pControl,
+ LPDWORD lpdwRevision)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlGetControlSecurityDescriptor (pSecurityDescriptor,
- pControl,
- (PULONG)lpdwRevision);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ Status = RtlGetControlSecurityDescriptor(pSecurityDescriptor,
+ pControl,
+ (PULONG)lpdwRevision);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
BOOL
STDCALL
-GetSecurityDescriptorDacl (
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- LPBOOL lpbDaclPresent,
- PACL *pDacl,
- LPBOOL lpbDaclDefaulted
- )
+GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ LPBOOL lpbDaclPresent,
+ PACL *pDacl,
+ LPBOOL lpbDaclDefaulted)
{
- BOOLEAN DaclPresent;
- BOOLEAN DaclDefaulted;
- NTSTATUS Status;
+ BOOLEAN DaclPresent;
+ BOOLEAN DaclDefaulted;
+ NTSTATUS Status;
- Status = RtlGetDaclSecurityDescriptor (pSecurityDescriptor,
- &DaclPresent,
- pDacl,
- &DaclDefaulted);
- *lpbDaclPresent = (BOOL)DaclPresent;
- *lpbDaclDefaulted = (BOOL)DaclDefaulted;
+ Status = RtlGetDaclSecurityDescriptor(pSecurityDescriptor,
+ &DaclPresent,
+ pDacl,
+ &DaclDefaulted);
+ *lpbDaclPresent = (BOOL)DaclPresent;
+ *lpbDaclDefaulted = (BOOL)DaclDefaulted;
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
BOOL
STDCALL
-GetSecurityDescriptorGroup (
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- PSID *pGroup,
- LPBOOL lpbGroupDefaulted
- )
+GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ PSID *pGroup,
+ LPBOOL lpbGroupDefaulted)
{
- BOOLEAN GroupDefaulted;
- NTSTATUS Status;
+ BOOLEAN GroupDefaulted;
+ NTSTATUS Status;
- Status = RtlGetGroupSecurityDescriptor (pSecurityDescriptor,
- pGroup,
- &GroupDefaulted);
- *lpbGroupDefaulted = (BOOL)GroupDefaulted;
+ Status = RtlGetGroupSecurityDescriptor(pSecurityDescriptor,
+ pGroup,
+ &GroupDefaulted);
+ *lpbGroupDefaulted = (BOOL)GroupDefaulted;
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
BOOL
STDCALL
-GetSecurityDescriptorOwner (
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- PSID *pOwner,
- LPBOOL lpbOwnerDefaulted
- )
+GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ PSID *pOwner,
+ LPBOOL lpbOwnerDefaulted)
{
- BOOLEAN OwnerDefaulted;
- NTSTATUS Status;
+ BOOLEAN OwnerDefaulted;
+ NTSTATUS Status;
- Status = RtlGetOwnerSecurityDescriptor (pSecurityDescriptor,
- pOwner,
- &OwnerDefaulted);
- *lpbOwnerDefaulted = (BOOL)OwnerDefaulted;
+ Status = RtlGetOwnerSecurityDescriptor(pSecurityDescriptor,
+ pOwner,
+ &OwnerDefaulted);
+ *lpbOwnerDefaulted = (BOOL)OwnerDefaulted;
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
DWORD
STDCALL
-GetSecurityDescriptorRMControl (
- PSECURITY_DESCRIPTOR SecurityDescriptor,
- PUCHAR RMControl)
+GetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor,
+ PUCHAR RMControl)
{
- if (!RtlGetSecurityDescriptorRMControl(SecurityDescriptor,
- RMControl))
- return ERROR_INVALID_DATA;
+ if (!RtlGetSecurityDescriptorRMControl(SecurityDescriptor,
+ RMControl))
+ return ERROR_INVALID_DATA;
- return ERROR_SUCCESS;
+ return ERROR_SUCCESS;
}
*/
BOOL
STDCALL
-GetSecurityDescriptorSacl (
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- LPBOOL lpbSaclPresent,
- PACL *pSacl,
- LPBOOL lpbSaclDefaulted
- )
+GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ LPBOOL lpbSaclPresent,
+ PACL *pSacl,
+ LPBOOL lpbSaclDefaulted)
{
- BOOLEAN SaclPresent;
- BOOLEAN SaclDefaulted;
- NTSTATUS Status;
+ BOOLEAN SaclPresent;
+ BOOLEAN SaclDefaulted;
+ NTSTATUS Status;
- Status = RtlGetSaclSecurityDescriptor (pSecurityDescriptor,
- &SaclPresent,
- pSacl,
- &SaclDefaulted);
- *lpbSaclPresent = (BOOL)SaclPresent;
- *lpbSaclDefaulted = (BOOL)SaclDefaulted;
+ Status = RtlGetSaclSecurityDescriptor(pSecurityDescriptor,
+ &SaclPresent,
+ pSacl,
+ &SaclDefaulted);
+ *lpbSaclPresent = (BOOL)SaclPresent;
+ *lpbSaclDefaulted = (BOOL)SaclDefaulted;
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
BOOL
STDCALL
-InitializeSecurityDescriptor (
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- DWORD dwRevision
- )
+InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ DWORD dwRevision)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlCreateSecurityDescriptor (pSecurityDescriptor,
- dwRevision);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ Status = RtlCreateSecurityDescriptor(pSecurityDescriptor,
+ dwRevision);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
BOOL
STDCALL
-IsValidSecurityDescriptor (
- PSECURITY_DESCRIPTOR pSecurityDescriptor
- )
+IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor)
{
- BOOLEAN Result;
+ BOOLEAN Result;
- Result = RtlValidSecurityDescriptor (pSecurityDescriptor);
- if (Result == FALSE)
- SetLastError (RtlNtStatusToDosError (STATUS_INVALID_SECURITY_DESCR));
+ Result = RtlValidSecurityDescriptor (pSecurityDescriptor);
+ if (Result == FALSE)
+ SetLastError(RtlNtStatusToDosError(STATUS_INVALID_SECURITY_DESCR));
- return (BOOL)Result;
+ return (BOOL)Result;
}
*/
BOOL
STDCALL
-MakeAbsoluteSD (
- PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
- PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
- LPDWORD lpdwAbsoluteSecurityDescriptorSize,
- PACL pDacl,
- LPDWORD lpdwDaclSize,
- PACL pSacl,
- LPDWORD lpdwSaclSize,
- PSID pOwner,
- LPDWORD lpdwOwnerSize,
- PSID pPrimaryGroup,
- LPDWORD lpdwPrimaryGroupSize
- )
+MakeAbsoluteSD(PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
+ PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
+ LPDWORD lpdwAbsoluteSecurityDescriptorSize,
+ PACL pDacl,
+ LPDWORD lpdwDaclSize,
+ PACL pSacl,
+ LPDWORD lpdwSaclSize,
+ PSID pOwner,
+ LPDWORD lpdwOwnerSize,
+ PSID pPrimaryGroup,
+ LPDWORD lpdwPrimaryGroupSize)
{
NTSTATUS Status;
Status = RtlSelfRelativeToAbsoluteSD2(pSelfRelativeSecurityDescriptor,
lpdwBufferSize);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
BOOL
STDCALL
-MakeSelfRelativeSD (
- PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
- PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
- LPDWORD lpdwBufferLength
- )
+MakeSelfRelativeSD(PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
+ PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
+ LPDWORD lpdwBufferLength)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlAbsoluteToSelfRelativeSD (pAbsoluteSecurityDescriptor,
- pSelfRelativeSecurityDescriptor,
- (PULONG)lpdwBufferLength);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ Status = RtlAbsoluteToSelfRelativeSD(pAbsoluteSecurityDescriptor,
+ pSelfRelativeSecurityDescriptor,
+ (PULONG)lpdwBufferLength);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
BOOL
STDCALL
-SetSecurityDescriptorControl (
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
- SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet)
+SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
+ SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlSetControlSecurityDescriptor(pSecurityDescriptor,
- ControlBitsOfInterest,
- ControlBitsToSet);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ Status = RtlSetControlSecurityDescriptor(pSecurityDescriptor,
+ ControlBitsOfInterest,
+ ControlBitsToSet);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
BOOL
STDCALL
-SetSecurityDescriptorDacl (
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- BOOL bDaclPresent,
- PACL pDacl,
- BOOL bDaclDefaulted
- )
+SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ BOOL bDaclPresent,
+ PACL pDacl,
+ BOOL bDaclDefaulted)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlSetDaclSecurityDescriptor (pSecurityDescriptor,
- bDaclPresent,
- pDacl,
- bDaclDefaulted);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ Status = RtlSetDaclSecurityDescriptor(pSecurityDescriptor,
+ bDaclPresent,
+ pDacl,
+ bDaclDefaulted);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
BOOL
STDCALL
-SetSecurityDescriptorGroup (
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- PSID pGroup,
- BOOL bGroupDefaulted
- )
+SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ PSID pGroup,
+ BOOL bGroupDefaulted)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlSetGroupSecurityDescriptor (pSecurityDescriptor,
- pGroup,
- bGroupDefaulted);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ Status = RtlSetGroupSecurityDescriptor(pSecurityDescriptor,
+ pGroup,
+ bGroupDefaulted);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
BOOL
STDCALL
-SetSecurityDescriptorOwner (
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- PSID pOwner,
- BOOL bOwnerDefaulted
- )
+SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ PSID pOwner,
+ BOOL bOwnerDefaulted)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlSetOwnerSecurityDescriptor (pSecurityDescriptor,
- pOwner,
- bOwnerDefaulted);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ Status = RtlSetOwnerSecurityDescriptor(pSecurityDescriptor,
+ pOwner,
+ bOwnerDefaulted);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
*/
DWORD
STDCALL
-SetSecurityDescriptorRMControl (
- PSECURITY_DESCRIPTOR SecurityDescriptor,
- PUCHAR RMControl)
+SetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor,
+ PUCHAR RMControl)
{
- RtlSetSecurityDescriptorRMControl(SecurityDescriptor,
- RMControl);
+ RtlSetSecurityDescriptorRMControl(SecurityDescriptor,
+ RMControl);
- return ERROR_SUCCESS;
+ return ERROR_SUCCESS;
}
*/
BOOL
STDCALL
-SetSecurityDescriptorSacl (
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- BOOL bSaclPresent,
- PACL pSacl,
- BOOL bSaclDefaulted
- )
+SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ BOOL bSaclPresent,
+ PACL pSacl,
+ BOOL bSaclDefaulted)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlSetSaclSecurityDescriptor (pSecurityDescriptor,
- bSaclPresent,
- pSacl,
- bSaclDefaulted);
- if (!NT_SUCCESS(Status))
- {
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
- }
+ Status = RtlSetSaclSecurityDescriptor(pSecurityDescriptor,
+ bSaclPresent,
+ pSacl,
+ bSaclDefaulted);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
- return TRUE;
+ return TRUE;
}
return TRUE;
}
+
/*
* @implemented
*/
-BOOL WINAPI DecryptFileA(LPCSTR lpFileName, DWORD dwReserved)
+BOOL WINAPI
+DecryptFileA(LPCSTR lpFileName, DWORD dwReserved)
{
UNICODE_STRING FileName;
NTSTATUS Status;
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;
return ret;
}
-BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW(
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- DWORD dword,
- SECURITY_INFORMATION SecurityInformation,
- LPWSTR* lpwstr,
- PULONG pulong)
+
+/*
+ * @unimplemented
+ */
+BOOL WINAPI
+ConvertSecurityDescriptorToStringSecurityDescriptorW(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ DWORD dword,
+ SECURITY_INFORMATION SecurityInformation,
+ LPWSTR *lpwstr,
+ PULONG pulong)
{
FIXME("%s() not implemented!\n", __FUNCTION__);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
-BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorA(
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- DWORD dword,
- SECURITY_INFORMATION SecurityInformation,
- LPSTR* lpstr,
- PULONG pulong)
+
+/*
+ * @unimplemented
+ */
+BOOL WINAPI
+ConvertSecurityDescriptorToStringSecurityDescriptorA(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ DWORD dword,
+ SECURITY_INFORMATION SecurityInformation,
+ LPSTR *lpstr,
+ PULONG pulong)
{
FIXME("%s() not implemented!\n", __FUNCTION__);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
BOOL STDCALL
AllocateLocallyUniqueId(PLUID Luid)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = NtAllocateLocallyUniqueId (Luid);
- if (!NT_SUCCESS (Status))
+ Status = NtAllocateLocallyUniqueId (Luid);
+ if (!NT_SUCCESS (Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-AllocateAndInitializeSid (PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
- BYTE nSubAuthorityCount,
- DWORD dwSubAuthority0,
- DWORD dwSubAuthority1,
- DWORD dwSubAuthority2,
- DWORD dwSubAuthority3,
- DWORD dwSubAuthority4,
- DWORD dwSubAuthority5,
- DWORD dwSubAuthority6,
- DWORD dwSubAuthority7,
- PSID *pSid)
+AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
+ BYTE nSubAuthorityCount,
+ DWORD dwSubAuthority0,
+ DWORD dwSubAuthority1,
+ DWORD dwSubAuthority2,
+ DWORD dwSubAuthority3,
+ DWORD dwSubAuthority4,
+ DWORD dwSubAuthority5,
+ DWORD dwSubAuthority6,
+ DWORD dwSubAuthority7,
+ PSID *pSid)
{
- NTSTATUS Status;
-
- Status = RtlAllocateAndInitializeSid (pIdentifierAuthority,
- nSubAuthorityCount,
- dwSubAuthority0,
- dwSubAuthority1,
- dwSubAuthority2,
- dwSubAuthority3,
- dwSubAuthority4,
- dwSubAuthority5,
- dwSubAuthority6,
- dwSubAuthority7,
- pSid);
- if (!NT_SUCCESS (Status))
+ NTSTATUS Status;
+
+ Status = RtlAllocateAndInitializeSid(pIdentifierAuthority,
+ nSubAuthorityCount,
+ dwSubAuthority0,
+ dwSubAuthority1,
+ dwSubAuthority2,
+ dwSubAuthority3,
+ dwSubAuthority4,
+ dwSubAuthority5,
+ dwSubAuthority6,
+ dwSubAuthority7,
+ pSid);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-CopySid (DWORD nDestinationSidLength,
- PSID pDestinationSid,
- PSID pSourceSid)
+CopySid(DWORD nDestinationSidLength,
+ PSID pDestinationSid,
+ PSID pSourceSid)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlCopySid (nDestinationSidLength,
- pDestinationSid,
- pSourceSid);
- if (!NT_SUCCESS (Status))
+ Status = RtlCopySid(nDestinationSidLength,
+ pDestinationSid,
+ pSourceSid);
+ if (!NT_SUCCESS (Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
return TRUE;
}
+
+
/******************************************************************************
* ConvertStringSecurityDescriptorToSecurityDescriptorW [ADVAPI32.@]
* @implemented
* @implemented
*/
BOOL STDCALL
-EqualPrefixSid (PSID pSid1,
- PSID pSid2)
+EqualPrefixSid(PSID pSid1,
+ PSID pSid2)
{
- return RtlEqualPrefixSid (pSid1, pSid2);
+ return RtlEqualPrefixSid (pSid1, pSid2);
}
* @implemented
*/
BOOL STDCALL
-EqualSid (PSID pSid1,
- PSID pSid2)
+EqualSid(PSID pSid1,
+ PSID pSid2)
{
- return RtlEqualSid (pSid1, pSid2);
+ return RtlEqualSid (pSid1, pSid2);
}
* even thou it's defined to return a PVOID...
*/
PVOID STDCALL
-FreeSid (PSID pSid)
+FreeSid(PSID pSid)
{
- return RtlFreeSid (pSid);
+ return RtlFreeSid(pSid);
}
* @implemented
*/
DWORD STDCALL
-GetLengthSid (PSID pSid)
+GetLengthSid(PSID pSid)
{
- return (DWORD)RtlLengthSid (pSid);
+ return (DWORD)RtlLengthSid(pSid);
}
* @implemented
*/
PSID_IDENTIFIER_AUTHORITY STDCALL
-GetSidIdentifierAuthority (PSID pSid)
+GetSidIdentifierAuthority(PSID pSid)
{
- return RtlIdentifierAuthoritySid (pSid);
+ return RtlIdentifierAuthoritySid(pSid);
}
* @implemented
*/
DWORD STDCALL
-GetSidLengthRequired (UCHAR nSubAuthorityCount)
+GetSidLengthRequired(UCHAR nSubAuthorityCount)
{
- return (DWORD)RtlLengthRequiredSid (nSubAuthorityCount);
+ return (DWORD)RtlLengthRequiredSid(nSubAuthorityCount);
}
* @implemented
*/
PDWORD STDCALL
-GetSidSubAuthority (PSID pSid,
- DWORD nSubAuthority)
+GetSidSubAuthority(PSID pSid,
+ DWORD nSubAuthority)
{
- return (PDWORD)RtlSubAuthoritySid (pSid, nSubAuthority);
+ return (PDWORD)RtlSubAuthoritySid(pSid, nSubAuthority);
}
* @implemented
*/
PUCHAR STDCALL
-GetSidSubAuthorityCount (PSID pSid)
+GetSidSubAuthorityCount(PSID pSid)
{
- return RtlSubAuthorityCountSid (pSid);
+ return RtlSubAuthorityCountSid(pSid);
}
* @implemented
*/
BOOL STDCALL
-InitializeSid (PSID Sid,
- PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
- BYTE nSubAuthorityCount)
+InitializeSid(PSID Sid,
+ PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
+ BYTE nSubAuthorityCount)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = RtlInitializeSid (Sid,
- pIdentifierAuthority,
- nSubAuthorityCount);
- if (!NT_SUCCESS (Status))
+ Status = RtlInitializeSid(Sid,
+ pIdentifierAuthority,
+ nSubAuthorityCount);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @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];
+ NTSTATUS Status;
+ UNICODE_STRING UnicodeString;
+ WCHAR FixedBuffer[64];
- if (! RtlValidSid(Sid))
+ if (!RtlValidSid(Sid))
{
- SetLastError(ERROR_INVALID_SID);
- return FALSE;
+ SetLastError(ERROR_INVALID_SID);
+ return FALSE;
}
- UnicodeString.Length = 0;
- UnicodeString.MaximumLength = sizeof(FixedBuffer);
- UnicodeString.Buffer = FixedBuffer;
- Status = RtlConvertSidToUnicodeString(&UnicodeString, Sid, FALSE);
- if (STATUS_BUFFER_TOO_SMALL == Status)
+ UnicodeString.Length = 0;
+ UnicodeString.MaximumLength = sizeof(FixedBuffer);
+ UnicodeString.Buffer = FixedBuffer;
+ Status = RtlConvertSidToUnicodeString(&UnicodeString, Sid, FALSE);
+ if (STATUS_BUFFER_TOO_SMALL == Status)
{
- Status = RtlConvertSidToUnicodeString(&UnicodeString, Sid, TRUE);
+ Status = RtlConvertSidToUnicodeString(&UnicodeString, Sid, TRUE);
}
- if (! NT_SUCCESS(Status))
+
+ if (!NT_SUCCESS(Status))
{
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- *StringSid = LocalAlloc(LMEM_FIXED, UnicodeString.Length + sizeof(WCHAR));
- if (NULL == *StringSid)
+ *StringSid = LocalAlloc(LMEM_FIXED, UnicodeString.Length + sizeof(WCHAR));
+ if (NULL == *StringSid)
{
- if (UnicodeString.Buffer != FixedBuffer)
+ if (UnicodeString.Buffer != FixedBuffer)
{
- RtlFreeUnicodeString(&UnicodeString);
+ RtlFreeUnicodeString(&UnicodeString);
}
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
- MoveMemory(*StringSid, UnicodeString.Buffer, UnicodeString.Length);
- ZeroMemory((PCHAR) *StringSid + UnicodeString.Length, sizeof(WCHAR));
- if (UnicodeString.Buffer != FixedBuffer)
+ MoveMemory(*StringSid, UnicodeString.Buffer, UnicodeString.Length);
+ ZeroMemory((PCHAR) *StringSid + UnicodeString.Length, sizeof(WCHAR));
+ if (UnicodeString.Buffer != FixedBuffer)
{
- RtlFreeUnicodeString(&UnicodeString);
+ RtlFreeUnicodeString(&UnicodeString);
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-ConvertSidToStringSidA(PSID Sid, LPSTR *StringSid)
+ConvertSidToStringSidA(PSID Sid,
+ LPSTR *StringSid)
{
- LPWSTR StringSidW;
- int Len;
+ LPWSTR StringSidW;
+ int Len;
- if (! ConvertSidToStringSidW(Sid, &StringSidW))
+ if (!ConvertSidToStringSidW(Sid, &StringSidW))
{
- return FALSE;
+ return FALSE;
}
- Len = WideCharToMultiByte(CP_ACP, 0, StringSidW, -1, NULL, 0, NULL, NULL);
- if (Len <= 0)
+ Len = WideCharToMultiByte(CP_ACP, 0, StringSidW, -1, NULL, 0, NULL, NULL);
+ if (Len <= 0)
{
- LocalFree(StringSidW);
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return FALSE;
+ LocalFree(StringSidW);
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ return FALSE;
}
- *StringSid = LocalAlloc(LMEM_FIXED, Len);
- if (NULL == *StringSid)
+
+ *StringSid = LocalAlloc(LMEM_FIXED, Len);
+ if (NULL == *StringSid)
{
- LocalFree(StringSidW);
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return FALSE;
+ LocalFree(StringSidW);
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ 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);
- return FALSE;
+ LocalFree(StringSid);
+ LocalFree(StringSidW);
+ return FALSE;
}
- LocalFree(StringSidW);
+ LocalFree(StringSidW);
- return TRUE;
+ return TRUE;
}
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;
}
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;
}
* @implemented
*/
BOOL STDCALL
-ConvertStringSidToSidA(
- IN LPCSTR StringSid,
- OUT PSID* sid)
+ConvertStringSidToSidA(IN LPCSTR StringSid,
+ OUT PSID* sid)
{
BOOL bRetVal = FALSE;
return bRetVal;
}
+
/******************************************************************************
* ComputeStringSidSize
*/
-static DWORD ComputeStringSidSize(LPCWSTR StringSid)
+static DWORD
+ComputeStringSidSize(LPCWSTR StringSid)
{
DWORD size = sizeof(SID);
* @implemented
*/
BOOL WINAPI
-ConvertStringSidToSidW(
- IN LPCWSTR StringSid,
- OUT PSID* sid)
+ConvertStringSidToSidW(IN LPCWSTR StringSid,
+ OUT PSID* sid)
{
- DWORD size;
- DWORD i, cBytes, identAuth, csubauth;
- BOOL ret;
- SID* pisid;
+ DWORD size;
+ DWORD i, cBytes, identAuth, csubauth;
+ BOOL ret;
+ SID* pisid;
- TRACE("%s %p\n", debugstr_w(StringSid), sid);
+ TRACE("%s %p\n", debugstr_w(StringSid), sid);
if (!StringSid)
{
BuildImpersonateTrusteeA(PTRUSTEE_A pTrustee,
PTRUSTEE_A pImpersonateTrustee)
{
- pTrustee->pMultipleTrustee = pImpersonateTrustee;
- pTrustee->MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
+ pTrustee->pMultipleTrustee = pImpersonateTrustee;
+ pTrustee->MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
}
BuildImpersonateTrusteeW(PTRUSTEE_W pTrustee,
PTRUSTEE_W pImpersonateTrustee)
{
- pTrustee->pMultipleTrustee = pImpersonateTrustee;
- pTrustee->MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
+ pTrustee->pMultipleTrustee = pImpersonateTrustee;
+ pTrustee->MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE;
}
* BuildTrusteeWithSidA [ADVAPI32.@]
*/
VOID WINAPI
-BuildTrusteeWithSidA(PTRUSTEE_A pTrustee, PSID pSid)
+BuildTrusteeWithSidA(PTRUSTEE_A pTrustee,
+ PSID pSid)
{
TRACE("%p %p\n", pTrustee, pSid);
* BuildTrusteeWithSidW [ADVAPI32.@]
*/
VOID WINAPI
-BuildTrusteeWithSidW(PTRUSTEE_W pTrustee, PSID pSid)
+BuildTrusteeWithSidW(PTRUSTEE_W pTrustee,
+ PSID pSid)
{
TRACE("%p %p\n", pTrustee, pSid);
* BuildTrusteeWithNameA [ADVAPI32.@]
*/
VOID WINAPI
-BuildTrusteeWithNameA(PTRUSTEE_A pTrustee, LPSTR name)
+BuildTrusteeWithNameA(PTRUSTEE_A pTrustee,
+ LPSTR name)
{
TRACE("%p %s\n", pTrustee, name);
* BuildTrusteeWithNameW [ADVAPI32.@]
*/
VOID WINAPI
-BuildTrusteeWithNameW(PTRUSTEE_W pTrustee, LPWSTR name)
+BuildTrusteeWithNameW(PTRUSTEE_W pTrustee,
+ LPWSTR name)
{
TRACE("%p %s\n", pTrustee, 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;
* 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;
* 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;
* 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;
PTRUSTEEA WINAPI
GetMultipleTrusteeA(PTRUSTEE_A pTrustee)
{
- return pTrustee->pMultipleTrustee;
+ return pTrustee->pMultipleTrustee;
}
PTRUSTEEW WINAPI
GetMultipleTrusteeW(PTRUSTEE_W pTrustee)
{
- return pTrustee->pMultipleTrustee;
+ return pTrustee->pMultipleTrustee;
}
MULTIPLE_TRUSTEE_OPERATION WINAPI
GetMultipleTrusteeOperationA(PTRUSTEE_A pTrustee)
{
- return pTrustee->MultipleTrusteeOperation;
+ return pTrustee->MultipleTrusteeOperation;
}
MULTIPLE_TRUSTEE_OPERATION WINAPI
GetMultipleTrusteeOperationW(PTRUSTEE_W pTrustee)
{
- return pTrustee->MultipleTrusteeOperation;
+ return pTrustee->MultipleTrusteeOperation;
}
TRUSTEE_FORM WINAPI
GetTrusteeFormA(PTRUSTEE_A pTrustee)
{
- return pTrustee->TrusteeForm;
+ return pTrustee->TrusteeForm;
}
TRUSTEE_FORM WINAPI
GetTrusteeFormW(PTRUSTEE_W pTrustee)
{
- return pTrustee->TrusteeForm;
+ return pTrustee->TrusteeForm;
}
TRUSTEE_TYPE WINAPI
GetTrusteeTypeA(PTRUSTEE_A pTrustee)
{
- return pTrustee->TrusteeType;
+ return pTrustee->TrusteeType;
}
TRUSTEE_TYPE WINAPI
GetTrusteeTypeW(PTRUSTEE_W pTrustee)
{
- return pTrustee->TrusteeType;
+ return pTrustee->TrusteeType;
}
/* EOF */
* BackupEventLogA [ADVAPI32.@]
*/
BOOL WINAPI
-BackupEventLogA(
- IN HANDLE hEventLog,
- IN LPCSTR lpBackupFileName)
+BackupEventLogA(IN HANDLE hEventLog,
+ IN LPCSTR lpBackupFileName)
{
PLOG_INFO pLog;
NTSTATUS Status;
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
- Status = ElfrBackupELFA(
- pLog->BindingHandle,
- pLog->LogHandle,
- &BackupFileName);
+ Status = ElfrBackupELFA(pLog->BindingHandle,
+ pLog->LogHandle,
+ &BackupFileName);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
+
return TRUE;
}
* lpBackupFileName []
*/
BOOL WINAPI
-BackupEventLogW(
- IN HANDLE hEventLog,
- IN LPCWSTR lpBackupFileName)
+BackupEventLogW(IN HANDLE hEventLog,
+ IN LPCWSTR lpBackupFileName)
{
PLOG_INFO pLog;
NTSTATUS Status;
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
- Status = ElfrBackupELFW(
- pLog->BindingHandle,
- pLog->LogHandle,
- &BackupFileName);
+ Status = ElfrBackupELFW(pLog->BindingHandle,
+ pLog->LogHandle,
+ &BackupFileName);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
+
return TRUE;
}
* ClearEventLogA [ADVAPI32.@]
*/
BOOL WINAPI
-ClearEventLogA(
- IN HANDLE hEventLog,
- IN LPCSTR lpBackupFileName)
+ClearEventLogA(IN HANDLE hEventLog,
+ IN LPCSTR lpBackupFileName)
{
PLOG_INFO pLog;
NTSTATUS Status;
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
- Status = ElfrClearELFA(
- pLog->BindingHandle,
- pLog->LogHandle,
- &BackupFileName);
+ Status = ElfrClearELFA(pLog->BindingHandle,
+ pLog->LogHandle,
+ &BackupFileName);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
+
return TRUE;
}
* ClearEventLogW [ADVAPI32.@]
*/
BOOL WINAPI
-ClearEventLogW(
- IN HANDLE hEventLog,
- IN LPCWSTR lpBackupFileName)
+ClearEventLogW(IN HANDLE hEventLog,
+ IN LPCWSTR lpBackupFileName)
{
PLOG_INFO pLog;
NTSTATUS Status;
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
- Status = ElfrClearELFW(
- pLog->BindingHandle,
- pLog->LogHandle,
- &BackupFileName);
+ Status = ElfrClearELFW(pLog->BindingHandle,
+ pLog->LogHandle,
+ &BackupFileName);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
+
return TRUE;
}
* CloseEventLog [ADVAPI32.@]
*/
BOOL WINAPI
-CloseEventLog(
- IN HANDLE hEventLog)
+CloseEventLog(IN HANDLE hEventLog)
{
PLOG_INFO pLog;
NTSTATUS Status;
}
else
{
- Status = ElfrCloseEL(
- pLog->BindingHandle,
- &pLog->LogHandle);
+ Status = ElfrCloseEL(pLog->BindingHandle,
+ &pLog->LogHandle);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
* RETURNS STD
*/
BOOL WINAPI
-DeregisterEventSource(
- IN HANDLE hEventLog)
+DeregisterEventSource(IN HANDLE hEventLog)
{
PLOG_INFO pLog;
NTSTATUS Status;
if (!pLog)
return TRUE;
- Status = ElfrDeregisterEventSource(
- pLog->BindingHandle,
- &pLog->LogHandle);
+ Status = ElfrDeregisterEventSource(pLog->BindingHandle,
+ &pLog->LogHandle);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
+
return TRUE;
}
* NumberOfRecords []
*/
BOOL WINAPI
-GetNumberOfEventLogRecords(
- IN HANDLE hEventLog,
- OUT PDWORD NumberOfRecords)
+GetNumberOfEventLogRecords(IN HANDLE hEventLog,
+ OUT PDWORD NumberOfRecords)
{
PLOG_INFO pLog;
NTSTATUS Status;
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
- Status = ElfrNumberOfRecords(
- pLog->BindingHandle,
- pLog->LogHandle,
- &Records);
+
+ Status = ElfrNumberOfRecords(pLog->BindingHandle,
+ pLog->LogHandle,
+ &Records);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
}
*NumberOfRecords = Records;
+
return TRUE;
}
* OldestRecord []
*/
BOOL WINAPI
-GetOldestEventLogRecord(
- IN HANDLE hEventLog,
- OUT PDWORD OldestRecord)
+GetOldestEventLogRecord(IN HANDLE hEventLog,
+ OUT PDWORD OldestRecord)
{
PLOG_INFO pLog;
NTSTATUS Status;
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
- Status = ElfrOldestRecord(
- pLog->BindingHandle,
- pLog->LogHandle,
- &Oldest);
+
+ Status = ElfrOldestRecord(pLog->BindingHandle,
+ pLog->LogHandle,
+ &Oldest);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
}
*OldestRecord = Oldest;
+
return TRUE;
}
* hEvent []
*/
BOOL WINAPI
-NotifyChangeEventLog(
- IN HANDLE hEventLog,
- IN HANDLE hEvent)
+NotifyChangeEventLog(IN HANDLE hEventLog,
+ IN HANDLE hEvent)
{
/* Use ElfrChangeNotify */
UNIMPLEMENTED;
* OpenBackupEventLogA [ADVAPI32.@]
*/
HANDLE WINAPI
-OpenBackupEventLogA(
- IN LPCSTR lpUNCServerName,
- IN LPCSTR lpFileName)
+OpenBackupEventLogA(IN LPCSTR lpUNCServerName,
+ IN LPCSTR lpFileName)
{
UNICODE_STRING UNCServerName;
UNICODE_STRING FileName;
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
+
if (!RtlCreateUnicodeStringFromAsciiz(&FileName, lpFileName))
{
RtlFreeUnicodeString(&UNCServerName);
return NULL;
}
- Handle = OpenBackupEventLogW(
- UNCServerName.Buffer,
- FileName.Buffer);
+ Handle = OpenBackupEventLogW(UNCServerName.Buffer,
+ FileName.Buffer);
RtlFreeUnicodeString(&UNCServerName);
RtlFreeUnicodeString(&FileName);
* lpFileName []
*/
HANDLE WINAPI
-OpenBackupEventLogW(
- IN LPCWSTR lpUNCServerName,
- IN LPCWSTR lpFileName)
+OpenBackupEventLogW(IN LPCWSTR lpUNCServerName,
+ IN LPCWSTR lpFileName)
{
PLOG_INFO pLog;
NTSTATUS Status;
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
+
ZeroMemory(pLog, sizeof(LOG_INFO));
if (lpUNCServerName == NULL || *lpUNCServerName == 0)
}
}
- Status = ElfrOpenBELW(
- pLog->BindingHandle,
- (LPWSTR)lpUNCServerName,
- &FileName,
- 0,
- 0,
- &pLog->LogHandle);
-
+ 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;
}
* OpenEventLogA [ADVAPI32.@]
*/
HANDLE WINAPI
-OpenEventLogA(
- IN LPCSTR lpUNCServerName,
- IN LPCSTR lpSourceName)
+OpenEventLogA(IN LPCSTR lpUNCServerName,
+ IN LPCSTR lpSourceName)
{
UNICODE_STRING UNCServerName;
UNICODE_STRING SourceName;
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
+
if (!RtlCreateUnicodeStringFromAsciiz(&SourceName, lpSourceName))
{
RtlFreeUnicodeString(&UNCServerName);
return NULL;
}
- Handle = OpenEventLogW(UNCServerName.Buffer, SourceName.Buffer);
+ Handle = OpenEventLogW(UNCServerName.Buffer,
+ SourceName.Buffer);
RtlFreeUnicodeString(&UNCServerName);
RtlFreeUnicodeString(&SourceName);
* lpSourceName []
*/
HANDLE WINAPI
-OpenEventLogW(
- IN LPCWSTR lpUNCServerName,
- IN LPCWSTR lpSourceName)
+OpenEventLogW(IN LPCWSTR lpUNCServerName,
+ IN LPCWSTR lpSourceName)
{
PLOG_INFO pLog;
NTSTATUS Status;
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
+
ZeroMemory(pLog, sizeof(LOG_INFO));
if (lpUNCServerName == NULL || *lpUNCServerName == 0)
}
}
- Status = ElfrOpenELW(
- pLog->BindingHandle,
- (LPWSTR)lpUNCServerName,
- &SourceName,
- &EmptyString,
- 0,
- 0,
- &pLog->LogHandle);
-
+ 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;
}
* ReadEventLogA [ADVAPI32.@]
*/
BOOL WINAPI
-ReadEventLogA(
- IN HANDLE hEventLog,
- IN DWORD dwReadFlags,
- IN DWORD dwRecordOffset,
- OUT LPVOID lpBuffer,
- IN DWORD nNumberOfBytesToRead,
- OUT DWORD *pnBytesRead,
- OUT DWORD *pnMinNumberOfBytesNeeded)
+ReadEventLogA(IN HANDLE hEventLog,
+ IN DWORD dwReadFlags,
+ IN DWORD dwRecordOffset,
+ OUT LPVOID lpBuffer,
+ IN DWORD nNumberOfBytesToRead,
+ OUT DWORD *pnBytesRead,
+ OUT DWORD *pnMinNumberOfBytesNeeded)
{
PLOG_INFO pLog;
NTSTATUS Status;
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
- Status = ElfrReadELA(
- pLog->BindingHandle,
- pLog->LogHandle,
- dwReadFlags,
- dwRecordOffset,
- nNumberOfBytesToRead,
- lpBuffer,
- &bytesRead,
- &minNumberOfBytesNeeded);
+
+ Status = ElfrReadELA(pLog->BindingHandle,
+ pLog->LogHandle,
+ dwReadFlags,
+ dwRecordOffset,
+ nNumberOfBytesToRead,
+ lpBuffer,
+ &bytesRead,
+ &minNumberOfBytesNeeded);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
*pnBytesRead = (DWORD)bytesRead;
*pnMinNumberOfBytesNeeded = (DWORD)minNumberOfBytesNeeded;
+
return TRUE;
}
* pnMinNumberOfBytesNeeded []
*/
BOOL WINAPI
-ReadEventLogW(
- IN HANDLE hEventLog,
- IN DWORD dwReadFlags,
- IN DWORD dwRecordOffset,
- OUT LPVOID lpBuffer,
- IN DWORD nNumberOfBytesToRead,
- OUT DWORD *pnBytesRead,
- OUT DWORD *pnMinNumberOfBytesNeeded)
+ReadEventLogW(IN HANDLE hEventLog,
+ IN DWORD dwReadFlags,
+ IN DWORD dwRecordOffset,
+ OUT LPVOID lpBuffer,
+ IN DWORD nNumberOfBytesToRead,
+ OUT DWORD *pnBytesRead,
+ OUT DWORD *pnMinNumberOfBytesNeeded)
{
PLOG_INFO pLog;
NTSTATUS Status;
SetLastError(ERROR_INVALID_HANDLE);
return FALSE;
}
- Status = ElfrReadELW(
- pLog->BindingHandle,
- pLog->LogHandle,
- dwReadFlags,
- dwRecordOffset,
- nNumberOfBytesToRead,
- lpBuffer,
- &bytesRead,
- &minNumberOfBytesNeeded);
+
+ Status = ElfrReadELW(pLog->BindingHandle,
+ pLog->LogHandle,
+ dwReadFlags,
+ dwRecordOffset,
+ nNumberOfBytesToRead,
+ lpBuffer,
+ &bytesRead,
+ &minNumberOfBytesNeeded);
if (!NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
*pnBytesRead = (DWORD)bytesRead;
*pnMinNumberOfBytesNeeded = (DWORD)minNumberOfBytesNeeded;
+
return TRUE;
}
* RegisterEventSourceA [ADVAPI32.@]
*/
HANDLE WINAPI
-RegisterEventSourceA(
- IN LPCSTR lpUNCServerName,
- IN LPCSTR lpSourceName)
+RegisterEventSourceA(IN LPCSTR lpUNCServerName,
+ IN LPCSTR lpSourceName)
{
UNICODE_STRING UNCServerName;
UNICODE_STRING SourceName;
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
+
if (!RtlCreateUnicodeStringFromAsciiz(&SourceName, lpSourceName))
{
RtlFreeUnicodeString(&UNCServerName);
return NULL;
}
- Handle = RegisterEventSourceW(UNCServerName.Buffer, SourceName.Buffer);
+ Handle = RegisterEventSourceW(UNCServerName.Buffer,
+ SourceName.Buffer);
RtlFreeUnicodeString(&UNCServerName);
RtlFreeUnicodeString(&SourceName);
* Failure: NULL
*/
HANDLE WINAPI
-RegisterEventSourceW(
- IN LPCWSTR lpUNCServerName,
- IN LPCWSTR lpSourceName)
+RegisterEventSourceW(IN LPCWSTR lpUNCServerName,
+ IN LPCWSTR lpSourceName)
{
PLOG_INFO pLog;
NTSTATUS Status;
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
+
ZeroMemory(pLog, sizeof(LOG_INFO));
if (lpUNCServerName == NULL || *lpUNCServerName == 0)
}
}
- Status = ElfrRegisterEventSourceW(
- pLog->BindingHandle,
- (LPWSTR)lpUNCServerName,
- &SourceName,
- &EmptyString,
- 0,
- 0,
- &pLog->LogHandle);
-
+ 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;
}
* ReportEventA [ADVAPI32.@]
*/
BOOL WINAPI
-ReportEventA(
- IN HANDLE hEventLog,
- IN WORD wType,
- IN WORD wCategory,
- IN DWORD dwEventID,
- IN PSID lpUserSid,
- IN WORD wNumStrings,
- IN DWORD dwDataSize,
- IN LPCSTR *lpStrings,
- IN LPVOID lpRawData)
+ReportEventA(IN HANDLE hEventLog,
+ IN WORD wType,
+ IN WORD wCategory,
+ IN DWORD dwEventID,
+ IN PSID lpUserSid,
+ IN WORD wNumStrings,
+ IN DWORD dwDataSize,
+ IN LPCSTR *lpStrings,
+ IN LPVOID lpRawData)
{
LPCWSTR *wideStrArray;
UNICODE_STRING str;
if (lpStrings == NULL)
return TRUE;
- wideStrArray = HeapAlloc(
- GetProcessHeap(),
- HEAP_ZERO_MEMORY,
- sizeof(LPCWSTR) * wNumStrings);
+ wideStrArray = HeapAlloc(GetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ sizeof(LPCWSTR) * wNumStrings);
for (i = 0; i < wNumStrings; i++)
{
if (i == wNumStrings)
{
- ret = ReportEventW(
- hEventLog,
- wType,
- wCategory,
- dwEventID,
- lpUserSid,
- wNumStrings,
- dwDataSize,
- wideStrArray,
- lpRawData);
+ ret = ReportEventW(hEventLog,
+ wType,
+ wCategory,
+ dwEventID,
+ lpUserSid,
+ wNumStrings,
+ dwDataSize,
+ wideStrArray,
+ lpRawData);
}
else
{
{
if (wideStrArray[i])
{
- HeapFree(
- GetProcessHeap(),
- 0,
- (PVOID)wideStrArray[i]);
+ HeapFree(GetProcessHeap(),
+ 0,
+ (PVOID)wideStrArray[i]);
}
}
- HeapFree(
- GetProcessHeap(),
- 0,
- wideStrArray);
+ HeapFree(GetProcessHeap(),
+ 0,
+ wideStrArray);
return ret;
}
* lpRawData []
*/
BOOL WINAPI
-ReportEventW(
- IN HANDLE hEventLog,
- IN WORD wType,
- IN WORD wCategory,
- IN DWORD dwEventID,
- IN PSID lpUserSid,
- IN WORD wNumStrings,
- IN DWORD dwDataSize,
- IN LPCWSTR *lpStrings,
- IN LPVOID lpRawData)
+ReportEventW(IN HANDLE hEventLog,
+ IN WORD wType,
+ IN WORD wCategory,
+ IN DWORD dwEventID,
+ IN PSID lpUserSid,
+ IN WORD wNumStrings,
+ IN DWORD dwDataSize,
+ IN LPCWSTR *lpStrings,
+ IN LPVOID lpRawData)
{
#if 0
PLOG_INFO pLog;
return FALSE;
}
- Strings = HeapAlloc(
- GetProcessHeap(),
- 0,
- wNumStrings * sizeof(UNICODE_STRING));
+ Strings = HeapAlloc(GetProcessHeap(),
+ 0,
+ wNumStrings * sizeof(UNICODE_STRING));
if (!Strings)
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
+
for (i = 0; i < wNumStrings; i++)
RtlInitUnicodeString(&Strings[i], lpStrings[i]);
- Status = ElfrReportEventW(
- pLog->BindingHandle,
- pLog->LogHandle,
- 0, /* FIXME: Time */
- wType,
- wCategory,
- dwEventID,
- wNumStrings,
- dwDataSize,
- L"", /* FIXME: ComputerName */
- lpUserSid,
- (LPWSTR *)lpStrings, /* FIXME: should be Strings */
- lpRawData,
- 0,
- NULL,
- NULL);
+ Status = ElfrReportEventW(pLog->BindingHandle,
+ pLog->LogHandle,
+ 0, /* FIXME: Time */
+ wType,
+ wCategory,
+ dwEventID,
+ wNumStrings,
+ dwDataSize,
+ L"", /* FIXME: ComputerName */
+ lpUserSid,
+ (LPWSTR *)lpStrings, /* FIXME: should be Strings */
+ lpRawData,
+ 0,
+ NULL,
+ NULL);
HeapFree(GetProcessHeap(), 0, Strings);
if (!NT_SUCCESS(Status))
SetLastError(RtlNtStatusToDosError(Status));
return FALSE;
}
+
return TRUE;
#else
int i;
* @implemented
*/
BOOL STDCALL
-PrivilegeCheck (HANDLE ClientToken,
- PPRIVILEGE_SET RequiredPrivileges,
- LPBOOL pfResult)
+PrivilegeCheck(HANDLE ClientToken,
+ PPRIVILEGE_SET RequiredPrivileges,
+ LPBOOL pfResult)
{
- BOOLEAN Result;
- NTSTATUS Status;
+ BOOLEAN Result;
+ NTSTATUS Status;
- Status = NtPrivilegeCheck (ClientToken,
- RequiredPrivileges,
- &Result);
- if (!NT_SUCCESS (Status))
+ Status = NtPrivilegeCheck(ClientToken,
+ RequiredPrivileges,
+ &Result);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- *pfResult = (BOOL) Result;
+ *pfResult = (BOOL)Result;
- return TRUE;
+ return TRUE;
}
/* EOF */
* @implemented
*/
BOOL STDCALL
-AdjustTokenGroups (HANDLE TokenHandle,
- BOOL ResetToDefault,
- PTOKEN_GROUPS NewState,
- DWORD BufferLength,
- PTOKEN_GROUPS PreviousState,
- PDWORD ReturnLength)
+AdjustTokenGroups(HANDLE TokenHandle,
+ BOOL ResetToDefault,
+ PTOKEN_GROUPS NewState,
+ DWORD BufferLength,
+ PTOKEN_GROUPS PreviousState,
+ PDWORD ReturnLength)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = NtAdjustGroupsToken (TokenHandle,
- ResetToDefault,
- NewState,
- BufferLength,
- PreviousState,
- (PULONG)ReturnLength);
- if (!NT_SUCCESS (Status))
+ Status = NtAdjustGroupsToken(TokenHandle,
+ ResetToDefault,
+ NewState,
+ BufferLength,
+ PreviousState,
+ (PULONG)ReturnLength);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-AdjustTokenPrivileges (HANDLE TokenHandle,
- BOOL DisableAllPrivileges,
- PTOKEN_PRIVILEGES NewState,
- DWORD BufferLength,
- PTOKEN_PRIVILEGES PreviousState,
- PDWORD ReturnLength)
+AdjustTokenPrivileges(HANDLE TokenHandle,
+ BOOL DisableAllPrivileges,
+ PTOKEN_PRIVILEGES NewState,
+ DWORD BufferLength,
+ PTOKEN_PRIVILEGES PreviousState,
+ PDWORD ReturnLength)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = NtAdjustPrivilegesToken (TokenHandle,
- DisableAllPrivileges,
- NewState,
- BufferLength,
- PreviousState,
- (PULONG)ReturnLength);
- if (STATUS_NOT_ALL_ASSIGNED == Status)
+ Status = NtAdjustPrivilegesToken(TokenHandle,
+ DisableAllPrivileges,
+ NewState,
+ BufferLength,
+ PreviousState,
+ (PULONG)ReturnLength);
+ if (STATUS_NOT_ALL_ASSIGNED == Status)
{
- SetLastError(ERROR_NOT_ALL_ASSIGNED);
- return TRUE;
+ SetLastError(ERROR_NOT_ALL_ASSIGNED);
+ return TRUE;
}
- if (! NT_SUCCESS(Status))
+
+ if (!NT_SUCCESS(Status))
{
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- SetLastError(ERROR_SUCCESS); /* AdjustTokenPrivileges is documented to do this */
- return TRUE;
+ /* AdjustTokenPrivileges is documented to do this */
+ SetLastError(ERROR_SUCCESS);
+
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-GetTokenInformation (HANDLE TokenHandle,
- TOKEN_INFORMATION_CLASS TokenInformationClass,
- LPVOID TokenInformation,
- DWORD TokenInformationLength,
- PDWORD ReturnLength)
+GetTokenInformation(HANDLE TokenHandle,
+ TOKEN_INFORMATION_CLASS TokenInformationClass,
+ LPVOID TokenInformation,
+ DWORD TokenInformationLength,
+ PDWORD ReturnLength)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = NtQueryInformationToken (TokenHandle,
- TokenInformationClass,
- TokenInformation,
- TokenInformationLength,
- (PULONG)ReturnLength);
- if (!NT_SUCCESS (Status))
+ Status = NtQueryInformationToken(TokenHandle,
+ TokenInformationClass,
+ TokenInformation,
+ TokenInformationLength,
+ (PULONG)ReturnLength);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
return TRUE;
* @implemented
*/
BOOL STDCALL
-SetTokenInformation (HANDLE TokenHandle,
- TOKEN_INFORMATION_CLASS TokenInformationClass,
- LPVOID TokenInformation,
- DWORD TokenInformationLength)
+SetTokenInformation(HANDLE TokenHandle,
+ TOKEN_INFORMATION_CLASS TokenInformationClass,
+ LPVOID TokenInformation,
+ DWORD TokenInformationLength)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = NtSetInformationToken (TokenHandle,
- TokenInformationClass,
- TokenInformation,
- TokenInformationLength);
- if (!NT_SUCCESS (Status))
+ Status = NtSetInformationToken(TokenHandle,
+ TokenInformationClass,
+ TokenInformation,
+ TokenInformationLength);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-AccessCheck (PSECURITY_DESCRIPTOR pSecurityDescriptor,
- HANDLE ClientToken,
- DWORD DesiredAccess,
- PGENERIC_MAPPING GenericMapping,
- PPRIVILEGE_SET PrivilegeSet,
- LPDWORD PrivilegeSetLength,
- LPDWORD GrantedAccess,
- LPBOOL AccessStatus)
+AccessCheck(PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ HANDLE ClientToken,
+ DWORD DesiredAccess,
+ PGENERIC_MAPPING GenericMapping,
+ PPRIVILEGE_SET PrivilegeSet,
+ LPDWORD PrivilegeSetLength,
+ LPDWORD GrantedAccess,
+ LPBOOL AccessStatus)
{
- NTSTATUS Status;
- NTSTATUS AccessStat;
-
- Status = NtAccessCheck (pSecurityDescriptor,
- ClientToken,
- DesiredAccess,
- GenericMapping,
- PrivilegeSet,
- (PULONG)PrivilegeSetLength,
- (PACCESS_MASK)GrantedAccess,
- &AccessStat);
- if (!NT_SUCCESS (Status))
+ NTSTATUS Status;
+ NTSTATUS AccessStat;
+
+ Status = NtAccessCheck(pSecurityDescriptor,
+ ClientToken,
+ DesiredAccess,
+ GenericMapping,
+ PrivilegeSet,
+ (PULONG)PrivilegeSetLength,
+ (PACCESS_MASK)GrantedAccess,
+ &AccessStat);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- if (!NT_SUCCESS (AccessStat))
+ if (!NT_SUCCESS(AccessStat))
{
- SetLastError (RtlNtStatusToDosError (Status));
- *AccessStatus = FALSE;
- return TRUE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ *AccessStatus = FALSE;
+ return TRUE;
}
- *AccessStatus = TRUE;
+ *AccessStatus = TRUE;
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-OpenProcessToken (HANDLE ProcessHandle,
- DWORD DesiredAccess,
- PHANDLE TokenHandle)
+OpenProcessToken(HANDLE ProcessHandle,
+ DWORD DesiredAccess,
+ PHANDLE TokenHandle)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = NtOpenProcessToken (ProcessHandle,
- DesiredAccess,
- TokenHandle);
- if (!NT_SUCCESS (Status))
+ Status = NtOpenProcessToken(ProcessHandle,
+ DesiredAccess,
+ TokenHandle);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-OpenThreadToken (HANDLE ThreadHandle,
- DWORD DesiredAccess,
- BOOL OpenAsSelf,
- PHANDLE TokenHandle)
+OpenThreadToken(HANDLE ThreadHandle,
+ DWORD DesiredAccess,
+ BOOL OpenAsSelf,
+ PHANDLE TokenHandle)
{
- NTSTATUS Status;
+ NTSTATUS Status;
- Status = NtOpenThreadToken (ThreadHandle,
- DesiredAccess,
- OpenAsSelf,
- TokenHandle);
- if (!NT_SUCCESS(Status))
+ Status = NtOpenThreadToken(ThreadHandle,
+ DesiredAccess,
+ OpenAsSelf,
+ TokenHandle);
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-SetThreadToken (IN PHANDLE ThreadHandle OPTIONAL,
- IN HANDLE TokenHandle)
+SetThreadToken(IN PHANDLE ThreadHandle OPTIONAL,
+ IN HANDLE TokenHandle)
{
- NTSTATUS Status;
- HANDLE hThread;
+ NTSTATUS Status;
+ HANDLE hThread;
- hThread = ((ThreadHandle != NULL) ? *ThreadHandle : NtCurrentThread());
+ hThread = (ThreadHandle != NULL) ? *ThreadHandle : NtCurrentThread();
- Status = NtSetInformationThread (hThread,
- ThreadImpersonationToken,
- &TokenHandle,
- sizeof(HANDLE));
- if (!NT_SUCCESS(Status))
+ Status = NtSetInformationThread(hThread,
+ ThreadImpersonationToken,
+ &TokenHandle,
+ sizeof(HANDLE));
+ if (!NT_SUCCESS(Status))
{
- SetLastError (RtlNtStatusToDosError (Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-DuplicateTokenEx (IN HANDLE ExistingTokenHandle,
- IN DWORD dwDesiredAccess,
- IN LPSECURITY_ATTRIBUTES lpTokenAttributes OPTIONAL,
- IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
- IN TOKEN_TYPE TokenType,
- OUT PHANDLE DuplicateTokenHandle)
+DuplicateTokenEx(IN HANDLE ExistingTokenHandle,
+ IN DWORD dwDesiredAccess,
+ IN LPSECURITY_ATTRIBUTES lpTokenAttributes OPTIONAL,
+ IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
+ IN TOKEN_TYPE TokenType,
+ OUT PHANDLE DuplicateTokenHandle)
{
- OBJECT_ATTRIBUTES ObjectAttributes;
- NTSTATUS Status;
- SECURITY_QUALITY_OF_SERVICE Sqos;
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ NTSTATUS Status;
+ SECURITY_QUALITY_OF_SERVICE Sqos;
- Sqos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
- Sqos.ImpersonationLevel = ImpersonationLevel;
- Sqos.ContextTrackingMode = 0;
- Sqos.EffectiveOnly = FALSE;
+ Sqos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
+ Sqos.ImpersonationLevel = ImpersonationLevel;
+ Sqos.ContextTrackingMode = 0;
+ Sqos.EffectiveOnly = FALSE;
- if (lpTokenAttributes != NULL)
+ if (lpTokenAttributes != NULL)
{
- InitializeObjectAttributes(&ObjectAttributes,
- NULL,
- lpTokenAttributes->bInheritHandle ? OBJ_INHERIT : 0,
- NULL,
- lpTokenAttributes->lpSecurityDescriptor);
+ InitializeObjectAttributes(&ObjectAttributes,
+ NULL,
+ lpTokenAttributes->bInheritHandle ? OBJ_INHERIT : 0,
+ NULL,
+ lpTokenAttributes->lpSecurityDescriptor);
}
- else
+ else
{
- InitializeObjectAttributes(&ObjectAttributes,
- NULL,
- 0,
- NULL,
- NULL);
+ InitializeObjectAttributes(&ObjectAttributes,
+ NULL,
+ 0,
+ NULL,
+ NULL);
}
- ObjectAttributes.SecurityQualityOfService = &Sqos;
+ ObjectAttributes.SecurityQualityOfService = &Sqos;
- Status = NtDuplicateToken (ExistingTokenHandle,
- dwDesiredAccess,
- &ObjectAttributes,
- FALSE,
- TokenType,
- DuplicateTokenHandle);
- if (!NT_SUCCESS(Status))
+ Status = NtDuplicateToken(ExistingTokenHandle,
+ dwDesiredAccess,
+ &ObjectAttributes,
+ FALSE,
+ TokenType,
+ DuplicateTokenHandle);
+ if (!NT_SUCCESS(Status))
{
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
}
- return TRUE;
+ return TRUE;
}
* @implemented
*/
BOOL STDCALL
-DuplicateToken (IN HANDLE ExistingTokenHandle,
- IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
- OUT PHANDLE DuplicateTokenHandle)
+DuplicateToken(IN HANDLE ExistingTokenHandle,
+ IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
+ OUT PHANDLE DuplicateTokenHandle)
{
- return DuplicateTokenEx (ExistingTokenHandle,
- TOKEN_IMPERSONATE | TOKEN_QUERY,
- NULL,
- ImpersonationLevel,
- TokenImpersonation,
- DuplicateTokenHandle);
+ return DuplicateTokenEx(ExistingTokenHandle,
+ TOKEN_IMPERSONATE | TOKEN_QUERY,
+ NULL,
+ ImpersonationLevel,
+ TokenImpersonation,
+ DuplicateTokenHandle);
}
&PrivBufferSize,
&GrantedAccess,
&AccessStatus);
-
if (NT_SUCCESS(Status) && NT_SUCCESS(AccessStatus) && (GrantedAccess == 0x1))
{
*IsMember = TRUE;
BOOL STDCALL
IsTokenRestricted(HANDLE TokenHandle)
{
- ULONG RetLength;
- PTOKEN_GROUPS lpGroups;
- NTSTATUS Status;
- BOOL Ret = FALSE;
-
- /* determine the required buffer size and allocate enough memory to read the
- list of restricted SIDs */
+ ULONG RetLength;
+ PTOKEN_GROUPS lpGroups;
+ NTSTATUS Status;
+ BOOL Ret = FALSE;
- Status = NtQueryInformationToken(TokenHandle,
- TokenRestrictedSids,
- NULL,
- 0,
- &RetLength);
- if (Status != STATUS_BUFFER_TOO_SMALL)
- {
- SetLastError(RtlNtStatusToDosError(Status));
- return FALSE;
- }
+ /* determine the required buffer size and allocate enough memory to read the
+ list of restricted SIDs */
+ Status = NtQueryInformationToken(TokenHandle,
+ TokenRestrictedSids,
+ NULL,
+ 0,
+ &RetLength);
+ if (Status != STATUS_BUFFER_TOO_SMALL)
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
AllocAndReadRestrictedSids:
- lpGroups = (PTOKEN_GROUPS)HeapAlloc(GetProcessHeap(),
- 0,
- RetLength);
- if (lpGroups == NULL)
- {
- SetLastError(ERROR_OUTOFMEMORY);
- return FALSE;
- }
-
- /* actually read the list of the restricted SIDs */
-
- Status = NtQueryInformationToken(TokenHandle,
- TokenRestrictedSids,
- lpGroups,
- RetLength,
- &RetLength);
- if (NT_SUCCESS(Status))
- {
- Ret = (lpGroups->GroupCount != 0);
- }
- else if (Status == STATUS_BUFFER_TOO_SMALL)
- {
- /* looks like the token was modified in the meanwhile, let's just try again */
+ lpGroups = (PTOKEN_GROUPS)HeapAlloc(GetProcessHeap(),
+ 0,
+ RetLength);
+ if (lpGroups == NULL)
+ {
+ SetLastError(ERROR_OUTOFMEMORY);
+ return FALSE;
+ }
+ /* actually read the list of the restricted SIDs */
+ Status = NtQueryInformationToken(TokenHandle,
+ TokenRestrictedSids,
+ lpGroups,
+ RetLength,
+ &RetLength);
+ if (NT_SUCCESS(Status))
+ {
+ Ret = (lpGroups->GroupCount != 0);
+ }
+ 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);
+
+ goto AllocAndReadRestrictedSids;
+ }
+ else
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ }
+
+ /* free allocated memory */
HeapFree(GetProcessHeap(),
0,
lpGroups);
- goto AllocAndReadRestrictedSids;
- }
- else
- {
- SetLastError(RtlNtStatusToDosError(Status));
- }
-
- /* free allocated memory */
-
- HeapFree(GetProcessHeap(),
- 0,
- lpGroups);
-
- return Ret;
+ return Ret;
}
+
BOOL STDCALL
-CreateRestrictedToken(
- HANDLE TokenHandle,
- DWORD Flags,
- DWORD DisableSidCount,
- PSID_AND_ATTRIBUTES pSidAndAttributes,
- DWORD DeletePrivilegeCount,
- PLUID_AND_ATTRIBUTES pLUIDAndAttributes,
- DWORD RestrictedSidCount,
- PSID_AND_ATTRIBUTES pSIDAndAttributes,
- PHANDLE NewTokenHandle
-)
+CreateRestrictedToken(HANDLE TokenHandle,
+ DWORD Flags,
+ DWORD DisableSidCount,
+ PSID_AND_ATTRIBUTES pSidAndAttributes,
+ DWORD DeletePrivilegeCount,
+ PLUID_AND_ATTRIBUTES pLUIDAndAttributes,
+ DWORD RestrictedSidCount,
+ PSID_AND_ATTRIBUTES pSIDAndAttributes,
+ PHANDLE NewTokenHandle)
{
UNIMPLEMENTED;
return FALSE;
}
+
/*
* @unimplemented
*/
return PSiteSid;
}
+
BOOL
WINAPI
CreateProcessWithTokenW(IN HANDLE hToken,