Hi,

for KS miniDriver

KSDEVICE_DISPATCH maintains a list of functions pointers,
We put the address of our functions, (for example AddDevice, PnPStart) into
these pointers, In our definitions for these functions (AddDevice, PnPStart),
there are IN parameters, what are these parameter? Where do i get this
informations for these parameter?

for example, for AddDevice functions,
it is

const
KSDEVICE_DISPATCH
CaptureDeviceDispatch = {
MyCaptureDevice::MyDevice_PnPAdd
...
}

MyCaptureDevice::MyDevice_PnPAdd(IN KSDEVICE device){
}

I what exactly is "device" being passed in?

where can i find a better reference than the API reference on these?

--
--------------------------------------------
William

Re: what is being passed into KSDEVICE_DISPATCH dispatch functions by Tim

Tim
Sat Oct 20 17:11:51 PDT 2007

William Xie <WilliamXie@discussions.microsoft.com> wrote:
>
>KSDEVICE_DISPATCH maintains a list of functions pointers,
>We put the address of our functions, (for example AddDevice, PnPStart) into
>these pointers, In our definitions for these functions (AddDevice, PnPStart),
>there are IN parameters, what are these parameter? Where do i get this
>informations for these parameter?
>
>for example, for AddDevice functions, it is
>
>const
>KSDEVICE_DISPATCH
>CaptureDeviceDispatch = {
> MyCaptureDevice::MyDevice_PnPAdd
> ...
>}
>
>MyCaptureDevice::MyDevice_PnPAdd(IN KSDEVICE device){
>}
>
>I what exactly is "device" being passed in?

You could have answered this by checking in ks.h.

The KSDEVICE is created by AVStream when AddDevice is called. It is a
pointer to a "struct _KSDEVICE", which is defined in ks.h. For most
AVStream drivers, it can be treated as opaque. The first time you see it
is in the Create callback. At that time, you shove your own context
structure pointer into Device->Context, and from that time forward you can
get whatever you need from it.

>where can i find a better reference than the API reference on these?

In many ways, the AVStream samples are as good a reference as the DDK
documentation.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: what is being passed into KSDEVICE_DISPATCH dispatch functions by WilliamXie

WilliamXie
Sat Oct 20 19:55:00 PDT 2007

thank you, Tim. :)
--
--------------------------------------------
William


"Tim Roberts" wrote:

> William Xie <WilliamXie@discussions.microsoft.com> wrote:
> >
> >KSDEVICE_DISPATCH maintains a list of functions pointers,
> >We put the address of our functions, (for example AddDevice, PnPStart) into
> >these pointers, In our definitions for these functions (AddDevice, PnPStart),
> >there are IN parameters, what are these parameter? Where do i get this
> >informations for these parameter?
> >
> >for example, for AddDevice functions, it is
> >
> >const
> >KSDEVICE_DISPATCH
> >CaptureDeviceDispatch = {
> > MyCaptureDevice::MyDevice_PnPAdd
> > ...
> >}
> >
> >MyCaptureDevice::MyDevice_PnPAdd(IN KSDEVICE device){
> >}
> >
> >I what exactly is "device" being passed in?
>
> You could have answered this by checking in ks.h.
>
> The KSDEVICE is created by AVStream when AddDevice is called. It is a
> pointer to a "struct _KSDEVICE", which is defined in ks.h. For most
> AVStream drivers, it can be treated as opaque. The first time you see it
> is in the Create callback. At that time, you shove your own context
> structure pointer into Device->Context, and from that time forward you can
> get whatever you need from it.
>
> >where can i find a better reference than the API reference on these?
>
> In many ways, the AVStream samples are as good a reference as the DDK
> documentation.
> --
> Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.
>