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
> > >
> > >
> >
> >
>
>