PiSwDeviceInterfacesUpdateState

NTSTATUS __stdcall PiSwDeviceInterfacesUpdateState(PI_SWD_OBJECT *SwDeviceObject, UINT8 Start){
  PI_SWD_OBJECT *v2; 
  wchar_t *v3; 
  PI_SWD_OBJECT *v4; 
  int v5; 
  int PWSTR; 
  WCHAR *v9; 
  INT64 v10; 
  _UNICODE_STRING DestinationString[2]; 
  wchar_t *NtPathFormat; 

  v2 = SwDeviceObject + 46;
  v3 = 0i64;
  v4 = (PI_SWD_OBJECT *)*((_QWORD *)SwDeviceObject + 23);
  v5 = 0;
  NtPathFormat = 0i64;
  DestinationString[0] = 0i64;
  if( v4 == SwDeviceObject + 46 )
    return v5;
  while( !*((_BYTE *)v4 + 36) )
  {
LABEL_4:
    v4 = *(PI_SWD_OBJECT **)v4;
    if( v4 == v2 )
      goto LABEL_5;
  }
  PWSTR = PnpAllocatePWSTR(*((WCHAR **)v4 + 2), 0x7FFFFFFFui64, 0x57706E50u, (PVOID *)&NtPathFormat);
  v3 = NtPathFormat;
  v5 = PWSTR;
  if( PWSTR >= 0 )
  {
    v5 = CmSetDeviceInterfacePathFormat(v9, (UINT8)NtPathFormat);
    if( v5 >= 0 )
    {
      RtlInitUnicodeString(DestinationString, v3);
      v5 = IoSetDeviceInterfaceState((INT64)DestinationString, Start, v10);
      if( v5 >= 0 )
      {
        ExFreePoolWithTag(v3, 0x57706E50u);
        v3 = 0i64;
        NtPathFormat = 0i64;
        goto LABEL_4;
      }
    }
  }
LABEL_5:
  if( v3 )
    ExFreePoolWithTag(v3, 0x57706E50u);
  return v5;
}

Referenced by:

PiSwPdoPnPDispatch
PiSwProcessRemove