I use MSVAD to develop my own usb audio stream driver. When I want to
CallUSBD, I must have LowerDeviceObject to pass down the IRP. How to
find the LowerDeviceObject??



--
duoman
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Re: How to find LowerDeviceObject in DDK MSVAD Audio Sample?? by Tim

Tim
Thu Dec 21 23:11:29 CST 2006

duoman <duoman.2j3z9t@mail.codecomments.com> wrote:
>
>I use MSVAD to develop my own usb audio stream driver. When I want to
>CallUSBD, I must have LowerDeviceObject to pass down the IRP. How to
>find the LowerDeviceObject??

How did your device get loaded? Are you loading as a USB function driver,
or as a filter on something other USB driver? In either case, the lower
device object is the one you attached to in the driver stack.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: How to find LowerDeviceObject in DDK MSVAD Audio Sample?? by goodhousekk

goodhousekk
Fri Jan 05 04:18:14 CST 2007

Here is the code I modified from msvad sample

extern "C" NTSTATUS
AddDevice
(
IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT PhysicalDeviceObject
)
{
--------
ntStatus =3D PcAddAdapterDevice

(

DriverObject,

PhysicalDeviceObject,

PCPFNSTARTDEVICE(StartDevice),

MAX_MINIPORTS,

0

);
------
ntStatus =3D IoCreateDevice(
DriverObject,
sizeof(DEVICE_EXTENSION),
NULL,
FILE_DEVICE_UNKNOWN,
FILE_AUTOGENERATED_DEVICE_NAME,
TRUE,
&deviceObject);
---
// deviceExtension->TopOfStackDeviceObject =3D
IoAttachDeviceToDeviceStack(deviceObject, PhysicalDeviceObject);

deviceObject->Flags &=3D ~DO_DEVICE_INITIALIZING;

return ntStatus;

} // AddDevice

1, When I don't use IoAttachDeviceToDeviceStack(), the driver's
function is normal
2, When I use IoAttachDeviceToDeviceStack(), the driver's function is
unnormal. The pnp irp REMOVE_DEVICE
was invoked by system.
How to get LowerDeviceObject in msvad sample?
Tim Roberts =BCg=B9D=A1G

> duoman <duoman.2j3z9t@mail.codecomments.com> wrote:
> >
> >I use MSVAD to develop my own usb audio stream driver. When I want to
> >CallUSBD, I must have LowerDeviceObject to pass down the IRP. How to
> >find the LowerDeviceObject??
>
> How did your device get loaded? Are you loading as a USB function driver,
> or as a filter on something other USB driver? In either case, the lower
> device object is the one you attached to in the driver stack.
> --=20
> Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.