Hi,
Recently I went thru' a source code that uses IoAttachDevice function
to get the target device object.
status = IoAttachDevice (DeviceObject, TargetDeviceName,
&pDevExt->AttachedDeviceObject); // TargetDeviceName is set to
\\Device\\Video0
pDevExt->TargetDeviceObject = pDevExt->AttachedDeviceObject;
IoDetachDevice (pDevExt->AttachedDeviceObject);
IoCallDriver (pDevExt->TargetDeviceObject, ....)
But is this the right way to do that?
2. Moreover, what's the difference between
pDevExt->AttachedDeviceObject and
pDevExt->AttachedDeviceObject->DriverObject->DeviceObject in this
context?
Could someone please explain me?
Thanks
VK