PiControlGetDeviceInterfaceEnabled

void __fastcall PiControlGetDeviceInterfaceEnabled(__int64 a1, VOID **a2, __int64 a3, INT8 a4){
  unsigned int v4; 
  _ETHREAD *CurrentThread; 
  _PI_DM_OBJECT *v8; 
  UINT64 v9; 
  WCHAR *ObjectName; 
  VOID *Destination[2]; 
  _PI_DM_OBJECT *Object; 

  v4 = *(unsigned __int16 *)a2;
  Object = 0i64;
  ObjectName = 0i64;
  *(_OWORD *)Destination = 0i64;
  WORD1(Destination[0]) = v4;
  LOWORD(Destination[0]) = v4;
  if( (unsigned __int16)(v4 - 1) <= 0x3EFu && (v4 & 1) == 0 && !*((_DWORD *)a2 + 4) )
  {
    LODWORD(v9) = 1;
    if( PiControlMakeUserModeCallersCopy(&Destination[1], a2[1], v4, 2ui64, a4, v9) >= 0 )
    {
      if( (int)PnpUnicodeStringToWstr((__int16 **)&ObjectName, 0i64, (unsigned __int16 *)Destination) >= 0
        && PiDmGetObject(3, ObjectName, &Object) >= 0 )
      {
        CurrentThread = (_ETHREAD *)KeGetCurrentThread();
        --CurrentThread->Tcb.KernelApcDisable;
        v8 = Object;
        ExAcquirePushLockSharedEx((_EX_PUSH_LOCK *)Object, 0i64);
        *((_BYTE *)a2 + 20) = *((_QWORD *)v8 + 5) != 0i64;
        ExReleasePushLockEx((ULONG_PTR)v8, 0);
        KeLeaveCriticalRegionThread(KeGetCurrentThread());
        PiDmObjectRelease(Object);
      }
      PnpUnicodeStringToWstrFree(ObjectName, (__int64)Destination);
      PiControlFreeUserModeCallersBuffer(a4, Destination[1]);
    }
  }
}

Referenced by:

No references.