PiSwIrpInterfaceSetState

INT64 __stdcall PiSwIrpInterfaceSetState(PIRP Irp){
  __int64 v2; 
  INT64 v3; 
  int v4; 
  __int64 v5; 
  __int64 *InterfaceEntry; 
  VOID *v8; 
  __int64 v9; 
  INT64 v10; 
  v2 = *((_QWORD *)Irp + 23);
  v3 = *(_QWORD *)(*(_QWORD *)(v2 + 48) + 32i64);
  v10 = v3;
  v9 = 0i64;
  v8 = 0i64;
  if( !*((_QWORD *)Irp + 3) )
    goto LABEL_17;
  v4 = MesDecodeBufferHandleCreate(*((_QWORD *)Irp + 3), *(unsigned int *)(v2 + 16), &v9);
  if( v4 < 0 )
    goto LABEL_10;
  NdrMesTypeDecode3(v9, "TP 3\a", &off_140983A98, &off_140C01A60, 3, &v8);
  if( v8 && *(_QWORD *)v8 )
  {
    PiSwLock();
    if( PiSwDeviceOperationsAllowed(v3) )
    {
      InterfaceEntry = PiSwDeviceFindInterfaceEntry(v5, *(const wchar_t **)v8);
      if( InterfaceEntry )
        v4 = PiSwDeviceInterfaceSetState(v3, (INT64)InterfaceEntry, *((_BYTE *)v8 + 8));
      else
        v4 = -1073741275;
    }
    else
    {
      v4 = -1073741637;
    }
    PiSwUnlock();
  }
  else
  {
LABEL_17:
    v4 = -1073741811;
  }
LABEL_10:
  if( v8 )
    MIDL_user_free(v8);
  if( v9 )
    MesHandleFree();
  *((_DWORD *)Irp + 12) = v4;
  IofCompleteRequest(Irp, 0);
  return(unsigned int)v4;
}

Referenced by:

PiSwDispatch