IoAttachDeviceByPointer

NTSTATUS
    IoAttachDeviceByPointer(

        IN PDEVICE_OBJECT  SourceDevice,
        IN PDEVICE_OBJECT  TargetDevice
        );

This routine is obsolete; use IoAttachDeviceToDeviceStack.

IoAttachDeviceByPointer attaches the caller’s device object to a target device object so that I/O requests bound for the target device are routed first to the caller. This routine returns STATUS_SUCCESS or STATUS_NO_SUCH_DEVICE.