For NDIS drivers IRP_MJ_SYSTEM_CONTROL IS supported by all devices. It is
supported by the NDIS.sys driver, not within the individual “NDIS drivers”
themselves.
The “NDIS wrapper” creates and manipulates the DEVICE_OBJECT for NDIS
drivers. For example, in the case of PnP system PnP events are translated to
the NDIS equivalent.
A NDIS driver doesn’t actually have to handle any I/O paths in the
traditional sense.
Thomas F. Divine
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Gianluca Varenni
Sent: Friday, December 01, 2006 11:54 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] NDIS Driver and IRP_MJ_SYSTEM_CONTROL handling
I think I’m missing something too, then.
A minimal NDIS IM driver does *not* directly expose a control device.
Everything is managed under the hood by NDIS. If you take the passthru
sample, it exposes a control device (registering it with
NdisMRegisterDevice) and it doesn’t seem to have a dispatch routine for
IRP_MJ_SYSTEM_CONTROL (which means that the OS will do it for you, probably
completing those IRPs with a failure). What is the exact dispatcher code
that you are using for that IRP?
You should have something like this
NTSTATUS
DispatchSystemControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
)
{
PIO_STACK_LOCATION irpStack;
POPEN_INSTANCE pOpen;
Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
Irp->IoStatus.Information = 0;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_UNSUCCESSFUL;
}
I’m not sure if STATUS_UNSUCCESSFUL is the correct error code, in any case
there’s a page on that in the MSDN/DDK documentation regarding those IRPs
http://msdn2.microsoft.com/en-us/library/aa490413.aspx
I think that unless you do want to support WMI, you do not need to register
a dispatcher for IRP_MJ_SYSTEM_CONTROL.
Have a nice day
GV
----- Original Message -----
From: Steve Dispensa mailto:xxxxx
To: Windows System mailto:xxxxx Software Devs Interest List
Sent: Friday, December 01, 2006 8:06 AM
Subject: Re: [ntdev] NDIS Driver and IRP_MJ_SYSTEM_CONTROL handling
The OP said he was testing an NDIS IM driver, right?
> We’ve been meaning to test our NDIS Intermediate driver through driver
verifier, but immediately
> encountered a BSOD: IO SYSTEM VERIFICATION ERROR in <our-driver.sys> (WDM
DRIVER ERROR
> 220).
Maybe I’m missing something… I was tired when I read it the first time…
-sd
On Dec 1, 2006, at 8:00 AM, Daniel Terhell wrote:
IRP_MJ_SYSTEM_CONTROL must be supported by all devices. If a device doesn’t
use WMI, it must forward the IRP. Also, he said he is not a filter. How can
you make up from his message that his driver is an intermediate driver ?
Thanks,
/Daniel
“Steve Dispensa” < mailto:xxxxx
xxxxx@positivenetworks.net> wrote in message news:xxxxx
news:xxxxx@ntdev…
But fundamentally, if you don’t have any need for SYSTEM_CONTROL, you
shouldn’t register for it or handle it.
-sd
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</news:xxxxx></mailto:xxxxx></our-driver.sys></mailto:xxxxx></mailto:xxxxx>