CmSetDeviceMappedProperty

__int64 __fastcall CmSetDeviceMappedProperty(
        __int64 a1,
        const WCHAR *a2,
        void *a3,
        __int64 a4,
        __int64 a5,
        unsigned int a6,
        PLARGE_INTEGER Time,
        ULONG a8){
  unsigned int v11; 
  DEVPROPKEY **v12; 
  unsigned int v13; 
  DEVPROPKEY *v14; 
  DEVPROPKEY **v15; 
  unsigned int v16; 
  DEVPROPKEY *v17; 
  DEVPROPKEY **v18; 
  unsigned int v19; 
  DEVPROPKEY *v20; 
  DEVPROPKEY **v21; 
  unsigned int v22; 
  DEVPROPKEY *v23; 
  __int64 v25; 
  __int64 v26; 
  unsigned int v27; 
  __int64 v28; 
  __int64 v29; 
  int v30; 
  v11 = -1073741802;
  if( !a4 )
  {
    if( !CmIsRootDevice(a2) )
    {
      v12 = &CmDeviceRegPropMap;
      v13 = 0;
      while( 1 )
      {
        v14 = *v12;
        if( *v12 && *(_DWORD *)(a5 + 16) == v14->pid )
        {
          v26 = *(_QWORD *)a5 - *(_QWORD *)&v14->fmtid.Data1;
          if( *(_QWORD *)a5 == *(_QWORD *)&v14->fmtid.Data1 )
            v26 = *(_QWORD *)(a5 + 8) - *(_QWORD *)v14->fmtid.Data4;
          if( !v26 )
            break;
        }
        ++v13;
        v12 += 3;
        if( v13 >= 0x21 )
          goto LABEL_7;
      }
      CmSetDeviceMappedPropertyFromRegProp(a1, a2, (__int64)a3, a5, a6, (int *)Time, a8);
      v11 = v27;
      if( v27 != -1073741802 )
        return v11;
LABEL_7:
      v15 = &off_140986950;
      v16 = 0;
      while( 1 )
      {
        v17 = *v15;
        if( *(_DWORD *)(a5 + 16) == (*v15)->pid )
        {
          v28 = *(_QWORD *)a5 - *(_QWORD *)&v17->fmtid.Data1;
          if( *(_QWORD *)a5 == *(_QWORD *)&v17->fmtid.Data1 )
            v28 = *(_QWORD *)(a5 + 8) - *(_QWORD *)v17->fmtid.Data4;
          if( !v28 )
            break;
        }
        ++v16;
        v15 += 4;
        if( v16 >= 0xD )
          goto LABEL_10;
      }
      if( a6 < 2 )
        CmDeleteDeviceMappedPropertyFromDriverKeyRegValue(a1, a2, a5);
      else
        CmSetDeviceMappedPropertyFromDriverKeyRegValue(a1, a2, a5, a6, Time, a8);
      v11 = -1073741802;
LABEL_10:
      v18 = &off_140983E70;
      v19 = 0;
      while( 1 )
      {
        v20 = *v18;
        if( *(_DWORD *)(a5 + 16) == (*v18)->pid )
        {
          v29 = *(_QWORD *)a5 - *(_QWORD *)&v20->fmtid.Data1;
          if( *(_QWORD *)a5 == *(_QWORD *)&v20->fmtid.Data1 )
            v29 = *(_QWORD *)(a5 + 8) - *(_QWORD *)v20->fmtid.Data4;
          if( !v29 )
            break;
        }
        ++v19;
        v18 += 4;
        if( v19 >= 2 )
          goto LABEL_13;
      }
      if( a6 >= 2 )
        v30 = CmSetDeviceMappedPropertyFromInstanceKeyRegValue(a1, a2, a3, a5, a6, Time, a8);
      else
        v30 = CmDeleteDeviceMappedPropertyFromInstanceKeyRegValue(a1, a2, a3, a5);
      v11 = v30;
      if( v30 >= 0 )
        PnpObjectRaisePropertyChangeEvent(a1, (__int64)a2, 1i64, (__int64)a3, 0i64, a5);
      if( v11 != -1073741802 )
        return v11;
LABEL_13:
      v21 = &off_140985E60;
      v22 = 0;
      while( 1 )
      {
        v23 = *v21;
        if( *(_DWORD *)(a5 + 16) == (*v21)->pid )
        {
          v25 = *(_QWORD *)a5 - *(_QWORD *)&v23->fmtid.Data1;
          if( *(_QWORD *)a5 == *(_QWORD *)&v23->fmtid.Data1 )
            v25 = *(_QWORD *)(a5 + 8) - *(_QWORD *)v23->fmtid.Data4;
          if( !v25 )
            break;
        }
        ++v22;
        v21 += 2;
        if( v22 >= 0x1B )
          return v11;
      }
    }
    return(unsigned int)-1073741790;
  }
  return v11;
}

Referenced by:

CmDeleteDeviceWorker
PnpDispatchDevice