PiSwIrpInterfaceSetState

NTSTATUS __stdcall PiSwIrpInterfaceSetState(_IRP *Irp){
  __int64 v1; 
  __int64 v2; 
  _IO_STACK_LOCATION *CurrentStackLocation; 
  PI_SWD_OBJECT *FsContext2; 
  int v6; 
  _PI_SWD_OBJECT *v7; 
  PI_SWD_INTERFACE *InterfaceEntry; 
  VOID *pMemory; 
  __int64 v11; 
  PI_SWD_OBJECT *v12; 

  CurrentStackLocation = Irp->Tail.CurrentStackLocation;
  FsContext2 = (PI_SWD_OBJECT *)CurrentStackLocation->FileObject->FsContext2;
  v12 = FsContext2;
  v11 = 0i64;
  pMemory = 0i64;
  if( !Irp->AssociatedIrp.MasterIrp )
    goto LABEL_17;
  v6 = MesDecodeBufferHandleCreate(Irp->AssociatedIrp.MasterIrp, CurrentStackLocation->Parameters.Options, &v11);
  if( v6 < 0 )
    goto LABEL_10;
  NdrMesTypeDecode3(v11, "TP 3\a", &off_140983A98, (char *)&stru_140C00F40 + 2848, 3, &pMemory);
  if( pMemory && *(_QWORD *)pMemory )
  {
    PiSwLock();
    if( PiSwDeviceOperationsAllowed((INT64)FsContext2) )
    {
      InterfaceEntry = PiSwDeviceFindInterfaceEntry(v7, *(WCHAR **)pMemory);
      if( InterfaceEntry )
        v6 = PiSwDeviceInterfaceSetState(FsContext2, InterfaceEntry, *((_BYTE *)pMemory + 8));
      else
        v6 = -1073741275;
    }
    else
    {
      v6 = -1073741637;
    }
    PiSwUnlock();
  }
  else
  {
LABEL_17:
    v6 = -1073741811;
  }
LABEL_10:
  if( pMemory )
    MIDL_user_free(pMemory);
  if( v11 )
    MesHandleFree(v11, v1, v2);
  Irp->IoStatus.Status = v6;
  IofCompleteRequest(Irp, 0);
  return v6;
}

Referenced by:

PiSwDispatch