IopQueryConflictFillString

NTSTATUS __stdcall IopQueryConflictFillString(PDEVICE_OBJECT DeviceObject, PWSTR Buffer, PULONG Length, PULONG Flags){
  unsigned int v7; 
  unsigned int v8; 
  unsigned int v9; 
  _DRIVER_OBJECT *DriverObject; 
  _UNICODE_STRING *p_DriverName; 
  _DEVOBJ_EXTENSION *DeviceObjectExtension; 
  char *DeviceNode; 
  unsigned __int64 v14; 

  v7 = 0;
  v8 = 0;
  v9 = 0;
  if( Length )
    v7 = *Length;
  if( Flags )
    v9 = *Flags;
  if( DeviceObject )
  {
    if( (DeviceObject->Flags & 0x1000) == 0 )
    {
      DriverObject = DeviceObject->DriverObject;
LABEL_8:
      if( !DriverObject )
        goto LABEL_20;
      p_DriverName = &DriverObject->DriverName;
      v9 |= 1u;
      goto LABEL_15;
    }
    DeviceObjectExtension = DeviceObject->DeviceObjectExtension;
    if( !DeviceObjectExtension )
      goto LABEL_20;
    DeviceNode = (char *)DeviceObjectExtension->DeviceNode;
    if( !DeviceNode )
      goto LABEL_20;
    if( DeviceNode == (char *)*(&PnpReplaceEvent + 831) )
    {
      v9 |= 2u;
    }
    else if( !*((_QWORD *)DeviceNode + 2) )
    {
      DriverObject = (_DRIVER_OBJECT *)*((_QWORD *)DeviceNode + 54);
      goto LABEL_8;
    }
    p_DriverName = (_UNICODE_STRING *)(DeviceNode + 40);
LABEL_15:
    if( p_DriverName )
    {
      if( Buffer )
      {
        v14 = p_DriverName->Length;
        if( 2 * (unsigned __int64)v7 > v14 )
          memmove(Buffer, p_DriverName->Buffer, v14);
      }
      v8 = p_DriverName->Length >> 1;
    }
  }
LABEL_20:
  if( Buffer && v7 > v8 )
    Buffer[v8] = 0;
  if( Length )
    *Length = v8 + 1;
  if( Flags )
    *Flags = v9;
  return 0;
}

Referenced by:

IopQueryConflictFillConflicts