PiSwDeviceInterfaceSetState

INT64 __fastcall PiSwDeviceInterfaceSetState(INT64 a1, INT64 a2, CHAR a3){
  WCHAR *v3; 
  int v4; 
  __int64 v5; 
  __int64 v8; 
  int PWSTR; 
  __int64 v10; 
  WCHAR v11; 
  struct _UNICODE_STRING DestinationString; 
  PCWSTR SourceString; 
  v3 = 0i64;
  SourceString = 0i64;
  v4 = 0;
  DestinationString = 0i64;
  v5 = *(_QWORD *)(a1 + 120);
  if( !v5
    || (v8 = *(_QWORD *)(v5 + 64)) == 0
    || (*(_DWORD *)(v8 + 8) & 1) == 0
    || *(_BYTE *)(a2 + 36) == a3
    || (PWSTR = PnpAllocatePWSTR(*(WCHAR **)(a2 + 16), 0x7FFFFFFFui64, 0x57706E50ui64, (WCHAR **)&SourceString),
        v3 = (WCHAR *)SourceString,
        v4 = PWSTR,
        PWSTR >= 0)
    && (v4 = CmSetDeviceInterfacePathFormat(v10, (WCHAR *)SourceString, 1), v4 >= 0)
    && (RtlInitUnicodeString(&DestinationString, v3, v11),
        v4 = IoSetDeviceInterfaceState(&DestinationString, a3),
        v4 >= 0) )
  {
    *(_BYTE *)(a2 + 36) = a3;
  }
  if( v3 )
    ExFreePoolWithTag(v3, 0x57706E50u);
  return(unsigned int)v4;
}

Referenced by:

PiSwIrpInterfaceRegister
PiSwIrpInterfaceSetState