Hi,
I could use some help understanding how to make driver verifier happy on Win7. We’ve got a hid minidriver that bugchecks when I turn on verifier. The stop code is 0xc9 arg1:0x22e which says that we are completing the irp will success but not passing it down.
It blames the section that handles IRP_MN_START_DEVICE.
Here’s the code for that:
PNP code…
case IRP_MN_START_DEVICE:
{
KEVENT startEvent;
IO_COMPLETION_ROUTINE PnPComplete;
KeInitializeEvent(&startEvent, NotificationEvent, FALSE);
IoCopyCurrentIrpStackLocationToNext(pIrp_I);
IoSetCompletionRoutine(pIrp_I, PnPComplete, &startEvent, TRUE, TRUE, TRUE);
ntStatus = IoCallDriver(GET_NEXT_DEVICE_OBJECT(pDeviceObject_I), pIrp_I);
if (STATUS_PENDING == ntStatus)
{
KeWaitForSingleObject(&startEvent, Executive, KernelMode, FALSE, NULL);
ntStatus = pIrp_I->IoStatus.Status;
}
pIrp_I->IoStatus.Status = ntStatus;
IoCompleteRequest(pIrp_I, IO_NO_INCREMENT);
return ntStatus;
}
break;
…
//PNP Callback
NTSTATUS PnPComplete(
IN PDEVICE_OBJECT pDeviceObject_I,
IN PIRP pIrp_I,
IN PVOID pContext_I)
{
UNREFERENCED_PARAMETER(pDeviceObject_I);
if (pIrp_I->PendingReturned)
{
KeSetEvent((PKEVENT)pContext_I, 0, FALSE);
}
return STATUS_MORE_PROCESSING_REQUIRED;
}
I can’t see what I’m doing wrong here. The irp is being passed down prior to completion. StaticDV gives it a clean bill of health and it works fine on Vista. Any hints would be greatly appreciated.