CmSetInterfaceClassMappedProperty

NTSTATUS __stdcall CmSetInterfaceClassMappedProperty(
        HPNPCTX *hPnpCtx,
        const WCHAR *ClassGuid,
        VOID *ObjectBaseKey,
        const WCHAR *PropertyLocaleName,
        const _DEVPROPKEY *PropertyKey,
        UINT8 *PropertyType,
        UINT8 *PropertyBuffer,
        UINT64 PropertySize){
  NTSTATUS v11; 
  DEVPROPKEY **v12; 
  int v13; 
  DEVPROPKEY *v14; 
  __int64 v15; 
  NTSTATUS v16; 
  DEVPROPKEY **v17; 
  int v18; 
  DEVPROPKEY *v19; 
  __int64 v20; 
  UINT64 v22; 
  UINT64 v23; 

  v11 = -1073741802;
  if( !PropertyLocaleName )
  {
    v12 = &off_140983758;
    v13 = 0;
    while( 1 )
    {
      v14 = *v12;
      if( *v12 && PropertyKey->pid == v14->pid )
      {
        v15 = *(_QWORD *)&PropertyKey->fmtid.Data1 - *(_QWORD *)&v14->fmtid.Data1;
        if( *(_QWORD *)&PropertyKey->fmtid.Data1 == *(_QWORD *)&v14->fmtid.Data1 )
          v15 = *(_QWORD *)PropertyKey->fmtid.Data4 - *(_QWORD *)v14->fmtid.Data4;
        if( !v15 )
          break;
      }
      ++v13;
      v12 += 2;
      if( v13 )
        goto LABEL_16;
    }
    if( (unsigned int)PropertyType < 2 )
    {
      v16 = CmDeleteInterfaceClassMappedPropertyFromRegValue(
              hPnpCtx,
              (WCHAR *)ClassGuid,
              ObjectBaseKey,
              (_DEVPROPKEY *)PropertyKey);
    }
    else
    {
      LODWORD(v23) = PropertySize;
      LODWORD(v22) = (_DWORD)PropertyType;
      v16 = CmSetInterfaceClassMappedPropertyFromRegValue(
              hPnpCtx,
              (WCHAR *)ClassGuid,
              ObjectBaseKey,
              (_DEVPROPKEY *)PropertyKey,
              v22,
              PropertyBuffer,
              v23);
    }
    v11 = v16;
    if( v16 >= 0 )
      PnpObjectRaisePropertyChangeEvent(
        (__int64)hPnpCtx,
        (INT64)ClassGuid,
        4i64,
        (INT64)ObjectBaseKey,
        0i64,
        (__int64)PropertyKey);
    if( v11 != -1073741802 )
      return v11;
LABEL_16:
    v17 = &off_140983808;
    v18 = 0;
    while( 1 )
    {
      v19 = *v17;
      if( PropertyKey->pid == (*v17)->pid )
      {
        v20 = *(_QWORD *)&PropertyKey->fmtid.Data1 - *(_QWORD *)&v19->fmtid.Data1;
        if( *(_QWORD *)&PropertyKey->fmtid.Data1 == *(_QWORD *)&v19->fmtid.Data1 )
          v20 = *(_QWORD *)PropertyKey->fmtid.Data4 - *(_QWORD *)v19->fmtid.Data4;
        if( !v20 )
          break;
      }
      ++v18;
      v17 += 2;
      if( v18 )
        return v11;
    }
    return -1073741790;
  }
  return v11;
}

Referenced by:

CmDeleteInterfaceClassWorker
PnpDispatchInterfaceClass