I want to send IRP_MJ_DEVICEIOCONTROL to the stream driver from kernel mode.
Is there function similar to DeviceIOControl or I have to send IRP to driver
directrly?

Re: DeviceIOControl by Max

Max
Mon May 31 02:38:39 CDT 2004

PDO for KS based minidriver is owned by the class driver (ks.sys).
This means that you can't send anything to your driver directly, it will all
go through KS (unless you bother to hook dispatch table in PDO or you create
an extra PDO and make it a target for your IOCTL).

Still nothing stops you from creating a custom property set and sending
IOCTLs to your driver using IKsControl, IKsPropertySet or plain
KsSynchronousDeviceControl.

-- Max.



"Alexander" <fastbrain@hotbox.ru> wrote in message
news:Ot41OMtREHA.3452@TK2MSFTNGP10.phx.gbl...
> I want to send IRP_MJ_DEVICEIOCONTROL to the stream driver from kernel
mode.
> Is there function similar to DeviceIOControl or I have to send IRP to
driver
> directrly?
>
>
>



Re: DeviceIOControl by Maxim

Maxim
Mon May 31 03:36:26 CDT 2004

Really?

For instance, the PDO for MSDV camera (with old MSDV stack from w2k) was
owned by 1394bus. And MSDV.SYS was a stream class minidriver.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com


"Max Paklin" <mpaklin@hotmail.com> wrote in message
news:eVGfnKuREHA.2404@TK2MSFTNGP09.phx.gbl...
> PDO for KS based minidriver is owned by the class driver (ks.sys).
> This means that you can't send anything to your driver directly, it will all
> go through KS (unless you bother to hook dispatch table in PDO or you create
> an extra PDO and make it a target for your IOCTL).
>
> Still nothing stops you from creating a custom property set and sending
> IOCTLs to your driver using IKsControl, IKsPropertySet or plain
> KsSynchronousDeviceControl.
>
> -- Max.
>
>
>
> "Alexander" <fastbrain@hotbox.ru> wrote in message
> news:Ot41OMtREHA.3452@TK2MSFTNGP10.phx.gbl...
> > I want to send IRP_MJ_DEVICEIOCONTROL to the stream driver from kernel
> mode.
> > Is there function similar to DeviceIOControl or I have to send IRP to
> driver
> > directrly?
> >
> >
> >
>
>



Re: DeviceIOControl by Alexander

Alexander
Mon May 31 09:55:42 CDT 2004

I would like to clarify my question. I have own driver for a virtual sound
card and I want to redirect some sound data to the hardware sound card which
have third party driver.

At the moment I have enumerated all sound devices (Max, thank you very much)
and create connection to a pin (KsCreatePin) of hardware sound card.
KsCreatePin return HANDLE and I have no any ideas how to send
IOCTL_KS_WRITE_STREAM. All functions such as KsSynchronousIoControlDevice
need a FILE_OBJECT on input. How can I obtain a FILE_OBJECT from a pin
HANDLE? I have tried to use KsSynchronousDeviceControl but the driver was
not loaded during a boot. Probably there was a linkage problem: May be there
is other way. What do you think?





"Max Paklin" <mpaklin@hotmail.com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:eVGfnKuREHA.2404@TK2MSFTNGP09.phx.gbl...
> PDO for KS based minidriver is owned by the class driver (ks.sys).
> This means that you can't send anything to your driver directly, it will
all
> go through KS (unless you bother to hook dispatch table in PDO or you
create
> an extra PDO and make it a target for your IOCTL).
>
> Still nothing stops you from creating a custom property set and sending
> IOCTLs to your driver using IKsControl, IKsPropertySet or plain
> KsSynchronousDeviceControl.
>
> -- Max.
>
>
>
> "Alexander" <fastbrain@hotbox.ru> wrote in message
> news:Ot41OMtREHA.3452@TK2MSFTNGP10.phx.gbl...
> > I want to send IRP_MJ_DEVICEIOCONTROL to the stream driver from kernel
> mode.
> > Is there function similar to DeviceIOControl or I have to send IRP to
> driver
> > directrly?
> >
> >
> >
>
>



Re: DeviceIOControl by Max

Max
Tue Jun 01 03:10:43 CDT 2004

Don't know anything about MSDV.

Usually (emphasis on _usually_) drivers call StreamClassRegisterXXX or
AVStream flavor of it and that's the point where KS
takes over.
My own experience is based on PCI and all sorts of virtual devices (ROOT or
SWENUM based).

In the context of OP question, this makes no difference. The fact is that
his driver does not own the PDO, so doing DeviceIoControl out of the blue
won't work. The block of data passed between his driver entry point and the
user land has to conform to standards setup by KS. The right way to go is to
use the API provided by KS Proxy.

Doing raw DeviceIoControl is still possible, of course. It is just that
parameters must be in certain form for it to work.

-- Max.



"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:ecBsEouREHA.3140@tk2msftngp13.phx.gbl...
> Really?
>
> For instance, the PDO for MSDV camera (with old MSDV stack from w2k)
was
> owned by 1394bus. And MSDV.SYS was a stream class minidriver.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
>
> "Max Paklin" <mpaklin@hotmail.com> wrote in message
> news:eVGfnKuREHA.2404@TK2MSFTNGP09.phx.gbl...
> > PDO for KS based minidriver is owned by the class driver (ks.sys).
> > This means that you can't send anything to your driver directly, it will
all
> > go through KS (unless you bother to hook dispatch table in PDO or you
create
> > an extra PDO and make it a target for your IOCTL).
> >
> > Still nothing stops you from creating a custom property set and sending
> > IOCTLs to your driver using IKsControl, IKsPropertySet or plain
> > KsSynchronousDeviceControl.
> >
> > -- Max.
> >
> >
> >
> > "Alexander" <fastbrain@hotbox.ru> wrote in message
> > news:Ot41OMtREHA.3452@TK2MSFTNGP10.phx.gbl...
> > > I want to send IRP_MJ_DEVICEIOCONTROL to the stream driver from kernel
> > mode.
> > > Is there function similar to DeviceIOControl or I have to send IRP to
> > driver
> > > directrly?
> > >
> > >
> > >
> >
> >
>
>



Re: DeviceIOControl by Max

Max
Tue Jun 01 03:22:54 CDT 2004

> I would like to clarify my question. I have own driver for a virtual sound
> card and I want to redirect some sound data to the hardware sound card
which
> have third party driver.

Why don't you have a user mode service building a small graph of your
device's filter with the output pin connected to the input of real sound
card filter?
That would save you a lot of pain.
Base your driver on Testcap sample and have it expose regular filters that
the sound card driver is expected to expose. On top of that make it create a
special filter of yours with one output pin for a data to be sent to a real
sound card. Then hook it up to a sound card renderer filter.


> At the moment I have enumerated all sound devices (Max, thank you very
much)
> and create connection to a pin (KsCreatePin) of hardware sound card.
> KsCreatePin return HANDLE and I have no any ideas how to send
> IOCTL_KS_WRITE_STREAM. All functions such as KsSynchronousIoControlDevice
> need a FILE_OBJECT on input. How can I obtain a FILE_OBJECT from a pin

KsSynchronousIoControlDevice needs a file handle. That's what KsCreatePin
gives you.
The API such as KsCreatePin is not very widely used. I don't know of anybody
outside of MS who would be willing to use it. Why?


> HANDLE? I have tried to use KsSynchronousDeviceControl but the driver was
> not loaded during a boot. Probably there was a linkage problem: May be
there
> is other way. What do you think?

Huh?
Linkage problem?
Your virtual driver won't load by default. It loads when an app tries to use
it.
Once again, you can do it the way you are trying to do it, but it is MUCH
more difficult. I see no point going down that road.

-- Max.


>
>
>
>
>
> "Max Paklin" <mpaklin@hotmail.com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
> news:eVGfnKuREHA.2404@TK2MSFTNGP09.phx.gbl...
> > PDO for KS based minidriver is owned by the class driver (ks.sys).
> > This means that you can't send anything to your driver directly, it will
> all
> > go through KS (unless you bother to hook dispatch table in PDO or you
> create
> > an extra PDO and make it a target for your IOCTL).
> >
> > Still nothing stops you from creating a custom property set and sending
> > IOCTLs to your driver using IKsControl, IKsPropertySet or plain
> > KsSynchronousDeviceControl.
> >
> > -- Max.
> >
> >
> >
> > "Alexander" <fastbrain@hotbox.ru> wrote in message
> > news:Ot41OMtREHA.3452@TK2MSFTNGP10.phx.gbl...
> > > I want to send IRP_MJ_DEVICEIOCONTROL to the stream driver from kernel
> > mode.
> > > Is there function similar to DeviceIOControl or I have to send IRP to
> > driver
> > > directrly?
> > >
> > >
> > >
> >
> >
>
>