Conflict between Driver Verifier and MS Modem interface

Q

QuasiCodo

We have a Multi-Port Serial driver which we are trying to certify. Part of
certification is to run Driver Verifier. When Verifier is ran, it gives use
the following message in WinDbg:


***********************************************************************

* THIS VALIDATION BUG IS FATAL AND WILL CAUSE THE VERIFIER TO HALT *

* WINDOWS (BUGCHECK) WHEN THE MACHINE IS NOT UNDER A KERNEL DEBUGGER! *

***********************************************************************



WDM DRIVER ERROR: [RpshSi.sys @ 0xF93015B0] This driver has not filled out a

dispatch routine for a required IRP major function (Irp =

81F36E70 ).

IRP_MJ_SYSTEM_CONTROL.IRP_MN_BOGUS

[ DevObj=FFA71678, FileObject=00000000, Parameters=FFA75030 00000000
00000000 00000000 ]

http://www.microsoft.com/hwdq/bc/default.asp?os=5.1.2600&major=0xc9&minor=0x21f&lang=0x9

Break, Ignore, Zap, Remove, Disable all (bizrd)? i


In the eyes of Verifier, the default return code of STATUS_INVALID_PARAMETER
of unhandled IOCTLs is WRONG!

So we changed the default return code to STATUS_NOT_SUPPORTED.

THIS MADE VERIFIER HAPPY!!!! Yeah!

However, it also broke the Microsoft Modem Inferface with our driver.

For example, when we return STATUS_INVLID_PARAMETER from the driver, adding
a new modem to the system works fine.

When we return STATUS_UNSUPPORTED, however, we cannot add a new modem on the
com ports which our driver controls. This is because in the "Add Hardware
Wizard" page, our com ports are not listed in the list box labled "On which
port do you want to install it?"

After tracing the driver, I found that the IOCTL 0x002B002C
(FILE_DEVICE_MODEM, function = 0xB) was one of the IOCTLs which was using
the default value. So we placed a special case in out IOCTL code:

switch (ioctl_code)
{
...
case 0x002B002C: // FILE_DEVICE_MODEM, Function 0xB - what does
this mean? Undocumented
status = STATUS_INVALID_PARAMETER;
break;
default:
// status = STATUS_INVALID_PARAMETER; VERIFIER says we
MUST NOT return this value!
status = STATUS_NOT_SUPPORTED;
break;
}

With the above code, our com ports are now listed in the port list box.

After some testing, we found there are other problems which are modem
related. I'll not get into the issues here, but needless to say, we need to
know about these IOCTLs so that we can please both Microsoft's Driver
Verifier and Microsoft's Modem Interface. What I'd like is a detailed
specification of Microsoft's MODEM IOCTLs.

((&-<
 
Q

QuasiCodo

Some Corrections to my original entry:

1. The IRP we are intested in is IRP_MJ_DEVICE_CONTROL, not
IRP_MJ_SYSTEM_CONTROL.

2. The fixed code returns Irp->IoStatus.Status, not STATUS_NOT_SUPPORTED.
Here is the real code:

NTSTATUS SerialIoControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
{
...

switch (IoControlCode)
{
...

case 0x002B002C:
Status = STATUS_INVALID_PARAMETER;
break;

//******************************

default: // bad IOCTL request
{
MyKdPrintError(("ERROR: Unknown IoControlCode =
0x%x\n",IoControlCode));
Status = STATUS_NOT_SUPPORTED;
break;
}
}

//
//Only return status in IRP for known IOCTLs we process
//

if (Status == STATUS_NOT_SUPPORTED)
{
Status = Irp->IoStatus.Status;
}
else
{
Irp->IoStatus.Status = Status;
};

SerialCompleteRequest(Extension, Irp, 0);
return Status;
}

((&-<
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top