CmSetDeviceRegProp

NTSTATUS __stdcall CmSetDeviceRegProp(
        HPNPCTX *hPnpCtx,
        WCHAR *DeviceInstanceId,
        VOID *BaseKeyHandle,
        _CM_REG_PROP CmRegProp,
        UINT64 CmRegPropType,
        UINT8 *PropertyBuffer,
        UINT64 PropertySize,
        UINT64 Flags){
  __int64(__fastcall *v12)(HPNPCTX *, WCHAR *, __int64, __int64, int, VOID **); 
  int v13; 
  NTSTATUS v14; 
  NTSTATUS v16; 
  int v17; 
  int v18; 
  NTSTATUS v19; 
  UINT64 v20; 
  UINT64 SecurityDescriptorLength; 
  UINT64 v22; 
  VOID *SecurityDescriptorInput[12]; 

  memset(SecurityDescriptorInput, 0i64, 0x58u);
  v12 = (__int64(__fastcall *)(HPNPCTX *, WCHAR *, __int64, __int64, int, VOID **))*((_QWORD *)hPnpCtx + 63);
  HIDWORD(SecurityDescriptorInput[3]) = CmRegPropType;
  LODWORD(SecurityDescriptorInput[5]) = PropertySize;
  SecurityDescriptorInput[2] = BaseKeyHandle;
  LODWORD(SecurityDescriptorInput[3]) = CmRegProp;
  HIDWORD(SecurityDescriptorInput[5]) = Flags;
  SecurityDescriptorInput[4] = PropertyBuffer;
  if( v12 )
  {
    v13 = v12(hPnpCtx, DeviceInstanceId, 1i64, 10i64, 1, SecurityDescriptorInput);
    if( v13 == -1073741822 )
    {
      v12 = 0i64;
    }
    else
    {
      if( v13 == -1073741536 )
        return(NTSTATUS)SecurityDescriptorInput[0];
      if( v13 )
        return -1073741595;
    }
  }
  LODWORD(v22) = HIDWORD(SecurityDescriptorInput[5]);
  LODWORD(SecurityDescriptorLength) = SecurityDescriptorInput[5];
  LODWORD(v20) = HIDWORD(SecurityDescriptorInput[3]);
  v16 = CmSetDeviceRegPropWorker(
          hPnpCtx,
          DeviceInstanceId,
          SecurityDescriptorInput[2],
          (_CM_REG_PROP)SecurityDescriptorInput[3],
          v20,
          (UINT8 *)SecurityDescriptorInput[4],
          SecurityDescriptorLength,
          v22);
  v14 = v16;
  if( v12 )
  {
    LODWORD(SecurityDescriptorInput[0]) = v16;
    v17 = v12(hPnpCtx, DeviceInstanceId, 1i64, 10i64, 2, SecurityDescriptorInput);
    v18 = v17;
    if( v17 != -1073741822 )
    {
      if( v17 == -1073741536 )
        return(NTSTATUS)SecurityDescriptorInput[0];
      v19 = v14;
      if( v18 )
        return -1073741595;
      return v19;
    }
  }
  return v14;
}

Referenced by:

CmDeleteDeviceRegKeyWorker
CmGetDeviceSoftwareKey
CmSetDeviceMappedPropertyFromRegProp
IoReportDetectedDevice
IoReportRootDevice
IopCreateLegacyDeviceIds
IopInitializePlugPlayServices
PiDcResetChildDeviceContainers
PiDcUpdateDeviceContainerMembership
PiPnpRtlSetDeviceRegProperty
PiProcessNewDeviceNode
PipCallDriverAddDevice
PipMigrateResetDeviceCallback
PipProcessStartPhase3
PipResetDevice
PnpSaveDeviceCapabilities