PnpGetRelatedTargetDevice
__int64 __fastcall PnpGetRelatedTargetDevice(_FILE_OBJECT *FileObject, _QWORD *a2, INT64 a3){
UINT8 v5;
_DEVICE_OBJECT *v6;
_DEVICE_OBJECT *v7;
__int64 v8;
__int64 result;
unsigned int v10;
__int64 v11;
__int64 v12;
_IO_STACK_LOCATION TopStackLocation;
PVOID P;
P = 0i64;
*a2 = 0i64;
v5 = KeAcquireQueuedSpinLock(10i64, (INT64)a2, a3);
LODWORD(v6) = IoGetRelatedDeviceObject((INT64)FileObject);
v7 = v6;
KeReleaseQueuedSpinLock(LockQueueIoDatabaseLock, v5);
if( !v7 )
return 3221225486i64;
memset(&TopStackLocation, 0i64, sizeof(TopStackLocation));
*(_WORD *)&TopStackLocation.MajorFunction = 1819;
LODWORD(TopStackLocation.Parameters.SecurityContext) = 4;
TopStackLocation.DeviceObject = v7;
TopStackLocation.FileObject = FileObject;
result = PnpSendIrp(v7, &TopStackLocation, v8, 0i64, (UINT64 *)&P);
v10 = result;
if( (int)result < 0 )
return result;
if( !P )
return 3221225486i64;
v11 = *(_DWORD *)P == 1 ? *((_QWORD *)P + 1) : 0i64;
ExFreePoolWithTag(P, 0);
if( !v11 )
return 3221225486i64;
v12 = *(_QWORD *)(*(_QWORD *)(v11 + 312) + 40i64);
if( !v12 )
return 3221225486i64;
*a2 = v12;
return v10;
}Referenced by:
IoGetRelatedTargetDevice
IoRegisterPlugPlayNotification
PiUEventGetDeviceInstanceIdFromUserHandle