Hello, All.
Does anybody knows how to implement WMI support in the
StreamMinidriver for KernelStreaming.

--
Andrey

Re: WMI support for Stream minidriver by Max

Max
Wed Jul 02 14:32:11 CDT 2003

Yes, it can be done. It is not explicitely supported by either AVStream or
Stream Class. In DriverEntry you can patch driver's dispatch table after
class driver finished doing its work.

For AVStream minidriver do something like (similar for Stream Class
solution)

NTSTATUS ntStatus = KsInitializeDriver( pDriverObject, pusRegistryPath,
&c_DeviceDescriptor );
if( NT_SUCCESS( ntStatus ) )
{
// Hook our own WMI IRP handler
pDriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] =
DkSystemControl;
}

While class model does not support WMI calls it does not prohibit it either.
Therefore I assume that this technique is legal (I confirmed it with KS
developers some time ago).

Of course, you will have to do all regular WMI registration/unregistration
stuff somewhere during device start/stop and implement systeam-control
routine accordingly.

-- Max.



"Andrey" <andrej_no@spam_telemed.lt> wrote in message
news:eNcP3XHQDHA.1148@TK2MSFTNGP11.phx.gbl...
> Hello, All.
> Does anybody knows how to implement WMI support in the
> StreamMinidriver for KernelStreaming.
>
> --
> Andrey
>
>



Re: WMI support for Stream minidriver by Andrey

Andrey
Thu Jul 03 03:21:27 CDT 2003

Thank you, Max.
I'll try to hook IRP_MJ_SYSTEM_CONTROL.
By the way, do you have some experience with ksproxy plugins?
Some moments are not clear for me.

--
Andrey
"Max Paklin" <mpaklin@hotmail.com> wrote in message
news:edFXyCNQDHA.3664@tk2msftngp13.phx.gbl...
> Yes, it can be done. It is not explicitely supported by either AVStream or
> Stream Class. In DriverEntry you can patch driver's dispatch table after
> class driver finished doing its work.
>
> For AVStream minidriver do something like (similar for Stream Class
> solution)
>
> NTSTATUS ntStatus = KsInitializeDriver( pDriverObject,
pusRegistryPath,
> &c_DeviceDescriptor );
> if( NT_SUCCESS( ntStatus ) )
> {
> // Hook our own WMI IRP handler
> pDriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] =
> DkSystemControl;
> }
>
> While class model does not support WMI calls it does not prohibit it
either.
> Therefore I assume that this technique is legal (I confirmed it with KS
> developers some time ago).
>
> Of course, you will have to do all regular WMI registration/unregistration
> stuff somewhere during device start/stop and implement systeam-control
> routine accordingly.
>
> -- Max.
>
>
>
> "Andrey" <andrej_no@spam_telemed.lt> wrote in message
> news:eNcP3XHQDHA.1148@TK2MSFTNGP11.phx.gbl...
> > Hello, All.
> > Does anybody knows how to implement WMI support in the
> > StreamMinidriver for KernelStreaming.
> >
> > --
> > Andrey
> >
> >
>
>



Re: WMI support for Stream minidriver by Max

Max
Thu Jul 03 17:25:07 CDT 2003

Yes, I have written countless plugins. As a matter of fact it is very
simple, there is nothing to it.
The only problem is that it is poorly documented and given the lack of
samples some people get stuck trying to do it.

Some help is available in DDK, but it is not some easy to find. Search for
"ks proxy" and specifically check out "Custom Property Sets and Interfaces"
topic. It offers some insight on how plugins should be implemented.

-- Max.


"Andrey" <andrej_no@spam_telemed.lt> wrote in message
news:OC%2311OTQDHA.2036@TK2MSFTNGP10.phx.gbl...
> Thank you, Max.
> I'll try to hook IRP_MJ_SYSTEM_CONTROL.
> By the way, do you have some experience with ksproxy plugins?
> Some moments are not clear for me.
>
> --
> Andrey
> "Max Paklin" <mpaklin@hotmail.com> wrote in message
> news:edFXyCNQDHA.3664@tk2msftngp13.phx.gbl...
> > Yes, it can be done. It is not explicitely supported by either AVStream
or
> > Stream Class. In DriverEntry you can patch driver's dispatch table after
> > class driver finished doing its work.
> >
> > For AVStream minidriver do something like (similar for Stream Class
> > solution)
> >
> > NTSTATUS ntStatus = KsInitializeDriver( pDriverObject,
> pusRegistryPath,
> > &c_DeviceDescriptor );
> > if( NT_SUCCESS( ntStatus ) )
> > {
> > // Hook our own WMI IRP handler
> > pDriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] =
> > DkSystemControl;
> > }
> >
> > While class model does not support WMI calls it does not prohibit it
> either.
> > Therefore I assume that this technique is legal (I confirmed it with KS
> > developers some time ago).
> >
> > Of course, you will have to do all regular WMI
registration/unregistration
> > stuff somewhere during device start/stop and implement systeam-control
> > routine accordingly.
> >
> > -- Max.
> >
> >
> >
> > "Andrey" <andrej_no@spam_telemed.lt> wrote in message
> > news:eNcP3XHQDHA.1148@TK2MSFTNGP11.phx.gbl...
> > > Hello, All.
> > > Does anybody knows how to implement WMI support in the
> > > StreamMinidriver for KernelStreaming.
> > >
> > > --
> > > Andrey
> > >
> > >
> >
> >
>
>



Re: WMI support for Stream minidriver by Andrey

Andrey
Fri Jul 04 04:18:10 CDT 2003

Hello, Max.
About WMI. I have tried to hook IRP_MJ_SYSTEM_CONTROL and I faced with
the follow problem.
After registering with IoWMIRegistrationControl, I get an
IRP_MJ_SYSTEM_CONTROL
with minor code IRP_MN_REGINFO_EX. (Driver is running under WinXP, SP1)
But calling WmiSystemControl returns disposition code "IrpNotWmi". DDK says
it
because WMILIB didn't recognize the minor function code. How could it be, I
am
running on WinXp?! Any suggestions what I'm doing wrong?

P.S. driver was compiled using Win2000 DDK, but I guess it doesn't matter
since WMILIB comes with OS...

--
Andrey
"Max Paklin" <mpaklin@hotmail.com> wrote in message
news:edFXyCNQDHA.3664@tk2msftngp13.phx.gbl...
> Yes, it can be done. It is not explicitely supported by either AVStream or
> Stream Class. In DriverEntry you can patch driver's dispatch table after
> class driver finished doing its work.
>
> For AVStream minidriver do something like (similar for Stream Class
> solution)
>
> NTSTATUS ntStatus = KsInitializeDriver( pDriverObject,
pusRegistryPath,
> &c_DeviceDescriptor );
> if( NT_SUCCESS( ntStatus ) )
> {
> // Hook our own WMI IRP handler
> pDriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] =
> DkSystemControl;
> }
>
> While class model does not support WMI calls it does not prohibit it
either.
> Therefore I assume that this technique is legal (I confirmed it with KS
> developers some time ago).
>
> Of course, you will have to do all regular WMI registration/unregistration
> stuff somewhere during device start/stop and implement systeam-control
> routine accordingly.
>
> -- Max.
>
>
>
> "Andrey" <andrej_no@spam_telemed.lt> wrote in message
> news:eNcP3XHQDHA.1148@TK2MSFTNGP11.phx.gbl...
> > Hello, All.
> > Does anybody knows how to implement WMI support in the
> > StreamMinidriver for KernelStreaming.
> >
> > --
> > Andrey
> >
> >
>
>



Re: WMI support for Stream minidriver by Max

Max
Mon Jul 07 17:37:23 CDT 2003

I have the driver compiled in Win2K build environment on XP SP1 DDK and it
works just fine on XP SP1.
I do receive some strange sys.command with minor function 0xFF. I simply
pass it through as required by standard WMI support guidelines. WmiSysContol
returns IrpNotWmi. I run my drivers under Driver Verifier, so maybe it is
one of those verifier tricks. The next IRP that I receive is the one with
minor function IRP_MN_REGINFO_EX. My call to WmiSysControl succeeds and
QueryRegInfo callback is invoked.

I am not sure what could be the source of your problem. Are running your
driver under verifier? Are you sure that IrpNotWmi is returned in response
to IRP_MN_REGINFO_EX?
Do you register your GUID with WMI correctly?

The way WMI is handled from KS driver is no different from any other kernel
driver. Check out the samples and make sure that you perform all the steps
necessary to register your driver with WMI.

-- Max.


"Andrey" <andrej_no@spam_telemed.lt> wrote in message
news:%23u7HNTgQDHA.2228@tk2msftngp13.phx.gbl...
> Hello, Max.
> About WMI. I have tried to hook IRP_MJ_SYSTEM_CONTROL and I faced with
> the follow problem.
> After registering with IoWMIRegistrationControl, I get an
> IRP_MJ_SYSTEM_CONTROL
> with minor code IRP_MN_REGINFO_EX. (Driver is running under WinXP, SP1)
> But calling WmiSystemControl returns disposition code "IrpNotWmi". DDK
says
>
> because WMILIB didn't recognize the minor function code. How could it be,
I
> am
> running on WinXp?! Any suggestions what I'm doing wrong?
>
> P.S. driver was compiled using Win2000 DDK, but I guess it doesn't matter
> since WMILIB comes with OS...
>
> --
> Andrey
> "Max Paklin" <mpaklin@hotmail.com> wrote in message
> news:edFXyCNQDHA.3664@tk2msftngp13.phx.gbl...
> > Yes, it can be done. It is not explicitely supported by either AVStream
or
> > Stream Class. In DriverEntry you can patch driver's dispatch table after
> > class driver finished doing its work.
> >
> > For AVStream minidriver do something like (similar for Stream Class
> > solution)
> >
> > NTSTATUS ntStatus = KsInitializeDriver( pDriverObject,
> pusRegistryPath,
> > &c_DeviceDescriptor );
> > if( NT_SUCCESS( ntStatus ) )
> > {
> > // Hook our own WMI IRP handler
> > pDriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] =
> > DkSystemControl;
> > }
> >
> > While class model does not support WMI calls it does not prohibit it
> either.
> > Therefore I assume that this technique is legal (I confirmed it with KS
> > developers some time ago).
> >
> > Of course, you will have to do all regular WMI
registration/unregistration
> > stuff somewhere during device start/stop and implement systeam-control
> > routine accordingly.
> >
> > -- Max.
> >
> >
> >
> > "Andrey" <andrej_no@spam_telemed.lt> wrote in message
> > news:eNcP3XHQDHA.1148@TK2MSFTNGP11.phx.gbl...
> > > Hello, All.
> > > Does anybody knows how to implement WMI support in the
> > > StreamMinidriver for KernelStreaming.
> > >
> > > --
> > > Andrey
> > >
> > >
> >
> >
>
>



Re: WMI support for Stream minidriver by Max

Max
Mon Jul 07 17:55:23 CDT 2003

It is quite clear what you are trying to do and it makes perfect sense.
I did it once and it worked just fine. I don't remember anything special
about this sort of proxy plug-in so I expect that doing it the same way as
any other interface plug-in would make it work right away.

What you need to do is to define custom GUID for your pin's property set.
Implement it for your pin, not the filter! Then write custom interface
handler as described in the DDK (look at "Custom Property Sets and
Interfaces") and create an association between your COM plug-in and custom
property set in registry (look at the same chapter in DDK for info).

If you've done all this the proxy should search the registry for interface
plug-in when it is being QI'd for the interface that it does not support.
IIRC it uses the same technique for the filter as well as for its pins.

-- Max.


"Andrey" <andrej_no@spam_telemed.lt> wrote in message
news:%23ciORcfQDHA.3088@TK2MSFTNGP10.phx.gbl...
> My problem is a follow. I want to implement custom stream format.
> And I want to provide a custorm interface to control steam format
> (say IMyStreamConfig with some methods SetFormat, GetFormat, GetConfig).
> I know how to control stream formats via IKsProperty interface, but I
don't
> know what I must to do make this interface available via
> IPin::QueryInterface
> method call. And this interface (IMyStreamConfig) must be available only
> for pins with my format. I know that I can declare additional property
> in my minidriver and realize COM interface to control that property, but
> I want to control stream format via standard property set
> (KSPROPSET_Connection). Do you know how to do that?
>
> It seems that my description is not clear :(
>
> Andrey
>
> "Max Paklin" <mpaklin@hotmail.com> wrote in message
> news:eZkK6HbQDHA.4024@tk2msftngp13.phx.gbl...
> > Yes, I have written countless plugins. As a matter of fact it is very
> > simple, there is nothing to it.
> > The only problem is that it is poorly documented and given the lack of
> > samples some people get stuck trying to do it.
> >
> > Some help is available in DDK, but it is not some easy to find. Search
for
> > "ks proxy" and specifically check out "Custom Property Sets and
> Interfaces"
> > topic. It offers some insight on how plugins should be implemented.
> >
> > -- Max.
> >
>
>



Re: WMI support for Stream minidriver by Andrey

Andrey
Wed Jul 09 05:17:08 CDT 2003

Problem with IRP_MN_REGINFO_EX is solved.
The problem was in the DriverWorks library. It was
compiled for W2K DDK and blocked IRP_MN_REGINFO_EX request
for this case. After recompiling library for WinXP all is OK.

--
Andrey

"Max Paklin" <mpaklin@hotmail.com> wrote in message
news:usLJahNRDHA.2480@tk2msftngp13.phx.gbl...
> I have the driver compiled in Win2K build environment on XP SP1 DDK and it
> works just fine on XP SP1.
> I do receive some strange sys.command with minor function 0xFF. I simply
> pass it through as required by standard WMI support guidelines.
WmiSysContol
> returns IrpNotWmi. I run my drivers under Driver Verifier, so maybe it is
> one of those verifier tricks. The next IRP that I receive is the one with
> minor function IRP_MN_REGINFO_EX. My call to WmiSysControl succeeds and
> QueryRegInfo callback is invoked.
>
> I am not sure what could be the source of your problem. Are running your
> driver under verifier? Are you sure that IrpNotWmi is returned in response
> to IRP_MN_REGINFO_EX?
> Do you register your GUID with WMI correctly?
>
> The way WMI is handled from KS driver is no different from any other
kernel
> driver. Check out the samples and make sure that you perform all the steps
> necessary to register your driver with WMI.
>
> -- Max.
>
>
> "Andrey" <andrej_no@spam_telemed.lt> wrote in message
> news:%23u7HNTgQDHA.2228@tk2msftngp13.phx.gbl...
> > Hello, Max.
> > About WMI. I have tried to hook IRP_MJ_SYSTEM_CONTROL and I faced with
> > the follow problem.
> > After registering with IoWMIRegistrationControl, I get an
> > IRP_MJ_SYSTEM_CONTROL
> > with minor code IRP_MN_REGINFO_EX. (Driver is running under WinXP, SP1)
> > But calling WmiSystemControl returns disposition code "IrpNotWmi". DDK
> says
> >
> > because WMILIB didn't recognize the minor function code. How could it
be,
> I
> > am
> > running on WinXp?! Any suggestions what I'm doing wrong?
> >
> > P.S. driver was compiled using Win2000 DDK, but I guess it doesn't
matter
> > since WMILIB comes with OS...
> >
> > --
> > Andrey
> > "Max Paklin" <mpaklin@hotmail.com> wrote in message
> > news:edFXyCNQDHA.3664@tk2msftngp13.phx.gbl...
> > > Yes, it can be done. It is not explicitely supported by either
AVStream
> or
> > > Stream Class. In DriverEntry you can patch driver's dispatch table
after
> > > class driver finished doing its work.
> > >
> > > For AVStream minidriver do something like (similar for Stream Class
> > > solution)
> > >
> > > NTSTATUS ntStatus = KsInitializeDriver( pDriverObject,
> > pusRegistryPath,
> > > &c_DeviceDescriptor );
> > > if( NT_SUCCESS( ntStatus ) )
> > > {
> > > // Hook our own WMI IRP handler
> > > pDriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] =
> > > DkSystemControl;
> > > }
> > >
> > > While class model does not support WMI calls it does not prohibit it
> > either.
> > > Therefore I assume that this technique is legal (I confirmed it with
KS
> > > developers some time ago).
> > >
> > > Of course, you will have to do all regular WMI
> registration/unregistration
> > > stuff somewhere during device start/stop and implement systeam-control
> > > routine accordingly.
> > >
> > > -- Max.
> > >
> > >
> > >
> > > "Andrey" <andrej_no@spam_telemed.lt> wrote in message
> > > news:eNcP3XHQDHA.1148@TK2MSFTNGP11.phx.gbl...
> > > > Hello, All.
> > > > Does anybody knows how to implement WMI support in the
> > > > StreamMinidriver for KernelStreaming.
> > > >
> > > > --
> > > > Andrey
> > > >
> > > >
> > >
> > >
> >
> >
>
>