WmipSecurityMethod

INT64 __fastcall WmipSecurityMethod(
        VOID *Object,
        _SECURITY_OPERATION_CODE OperationCode,
        UINT64 *SecurityInformation,
        VOID *SecurityDescriptor,
        UINT64 *CapturedLength,
        VOID **ObjectsSecurityDescriptor,
        _POOL_TYPE PoolType,
        _GENERIC_MAPPING *GenericMapping,
        CHAR Mode){
  __int32 v10; 
  __int32 v11; 
  INT64 result; 
  int v13; 
  UINT64 v14; 
  VOID *PoolWithTag; 
  void *v16; 
  WCHAR v17; 
  VOID **v18; 
  VOID **v19; 
  UINT64 Length; 
  struct _UNICODE_STRING GuidName; 
  wchar_t pszDest[40]; 
  if( OperationCode )
  {
    v10 = OperationCode - 1;
    if( v10 )
    {
      v11 = v10 - 1;
      if( v11 )
      {
        if( v11 != 1 )
          KeBugCheckEx(0x29u, 1ui64, 0xFFFFFFFFC000000Dui64, 0i64, 0i64);
        LODWORD(result) = ObAssignObjectSecurityDescriptor(Object, SecurityDescriptor);
      }
      else
      {
        LODWORD(result) = ObDeassignSecurity(ObjectsSecurityDescriptor);
      }
    }
    else
    {
      return ObQuerySecurityDescriptorInfo(Object, SecurityInformation, SecurityDescriptor, CapturedLength, v18);
    }
  }
  else
  {
    GuidName = 0i64;
    v13 = ObSetSecurityDescriptorInfo(
            Object,
            SecurityInformation,
            SecurityDescriptor,
            ObjectsSecurityDescriptor,
            PoolType,
            GenericMapping);
    if( v13 >= 0 )
    {
      v14 = 1024i64;
      LODWORD(Length) = 1024;
      while( 1 )
      {
        PoolWithTag = ExAllocatePoolWithTag(PoolType, v14, 0x70696D57ui64);
        v16 = PoolWithTag;
        if( !PoolWithTag )
          break;
        HIDWORD(Length) = -1;
        v13 = ObQuerySecurityDescriptorInfo(Object, (UINT64 *)((char *)&Length + 4), PoolWithTag, &Length, v19);
        if( v13 != -1073741789 )
          goto LABEL_12;
        ExFreePoolWithTag(v16, 0);
        v14 = (unsigned int)Length;
      }
      v13 = -1073741670;
LABEL_12:
      if( v13 >= 0 )
      {
        RtlStringCbPrintfW(pszDest, 0x4Cui64, (WCHAR *)L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x");
        RtlInitUnicodeString(&GuidName, pszDest, v17);
        v13 = WmipSaveGuidSecurityDescriptor(&GuidName, v16);
        ExFreePoolWithTag(v16, 0);
      }
    }
    return(unsigned int)v13;
  }
  return result;
}

Referenced by:

No references.