ObAssignObjectSecurityDescriptor

NTSTATUS __stdcall ObAssignObjectSecurityDescriptor(VOID *Object, VOID *SecurityDescriptor, POOL_TYPE PoolType){
  int v5; 
  char *v7; 

  v7 = 0i64;
  if( SecurityDescriptor )
  {
    v5 = ObLogSecurityDescriptor(SecurityDescriptor, (VOID **)&v7, 0x10ui64);
    if( v5 >= 0 )
    {
      ExFreePoolWithTag(SecurityDescriptor, 0);
      if( v7 )
        *((_QWORD *)Object - 1) = v7 + 15;
      else
        *((_QWORD *)Object - 1) = 0i64;
    }
    return v5;
  }
  else
  {
    *((_QWORD *)Object - 1) = 0i64;
    return 0;
  }
}

Referenced by:

CmpAssignKeySecurity
WmipSecurityMethod