ULONG StorageType;
LARGE_INTEGER SystemTime;
PCM_KEY_CONTROL_BLOCK Kcb;
+ PSECURITY_DESCRIPTOR NewDescriptor;
/* Get the storage type */
StorageType = Stable;
/* Link it with the KCB */
EnlistKeyBodyWithKCB(KeyBody, 0);
+ /* Assign security */
+ Status = SeAssignSecurity(ParentDescriptor,
+ AccessState->SecurityDescriptor,
+ &NewDescriptor,
+ TRUE,
+ &AccessState->SubjectSecurityContext,
+ &CmpKeyObjectType->TypeInfo.GenericMapping,
+ CmpKeyObjectType->TypeInfo.PoolType);
+ if (NT_SUCCESS(Status))
+ {
+ Status = CmpSecurityMethod(*Object,
+ AssignSecurityDescriptor,
+ NULL,
+ NewDescriptor,
+ NULL,
+ NULL,
+ CmpKeyObjectType->TypeInfo.PoolType,
+ &CmpKeyObjectType->TypeInfo.GenericMapping);
+ }
+
Quickie:
/* Check if we got here because of failure */
if (!NT_SUCCESS(Status))
/* Link to the KCB */
EnlistKeyBodyWithKCB(KeyBody, 0);
+
+ if (!ObCheckObjectAccess(*Object,
+ AccessState,
+ FALSE,
+ AccessMode,
+ &Status))
+ {
+ /* Access check failed */
+ ObDereferenceObject(*Object);
+ }
}
else
{