IoCallDriver is causing crash :-(

Hi,
I got a usb device driver to fix. My problem is when we run
DC2.exe(Microsoft driver test tool)driver crashes(System directly restarts
no BSOD). I debugged the driver and found the following:

  1. DC2.exe performs Set/Query test (activated with dc2.exe /hct +q /dr
    command)
    2. My driver gets an IRP_MN_QUERY_DEVICE_RELATIONS.
    3. The Device object passed to driver entry point for IRP contains NULL as
    Lower device object(This lower device object represents physical device
    object for our USB device)
    4. This Lower device object value change to NULL is sudden as in some
    previous calls it points to a valid physical object.
    5. When we pass IRP_MN_QUERY_DEVICE_RELATIONS IRP to next device using
    IoCallDriver, system crashes with
    1000008E(KERNEL_MODE_EXCEPTION_NOT_HANDLED_M) bugcheck.

    I could not understand why the physical device object becomes NULL. Please
    suggest.

    I also try a workaround: in IRP handler first test the lower device object
    for NULL and if this is NULL then return error and complete the IRP, as
    follows:

    if(NULL == lowerDeviceObject)
    {
    Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
    Irp->IoStatus.Information = 0;
    status = STATUS_UNSUCCESSFUL;

    IoCompleteRequest( Irp, IO_NO_INCREMENT );
    return status;
    }

    Is this a right approach? Please suggest.

    Mini crash dump file is also attached with mail.

    Any help will be highly appreciated.

    Thanks,
    Dev

Friends,
Any help :-(…

Here is Analysis for minidump in windbg:
****************************************************************************
***
*
*
* Bugcheck Analysis
*
*
*
****************************************************************************
***

Use !analyze -v to get detailed debugging information.

BugCheck 1000008E, {c0000005, 8062c086, f6ba5b3c, 0}

***** Kernel symbols are WRONG. Please fix symbols to do analysis.

Unable to load image mydevice.sys, Win32 error 2
*** WARNING: Unable to verify timestamp for mydevice.sys
*** ERROR: Module load completed but symbols could not be loaded for
mydevice.sys
Probably caused by : Unknown_Image ( mydevice+1af9 )

Please suggest!!!

Thanks,
Dev

-----Original Message-----
From: Devendra Singh
Sent: Wednesday, October 29, 2003 6:54 PM
To: ‘Windows System Software Devs Interest List’
Subject: IoCallDriver is causing crash :frowning:

Hi,
I got a usb device driver to fix. My problem is when we run
DC2.exe(Microsoft driver test tool)driver crashes(System directly restarts
no BSOD). I debugged the driver and found the following:

  1. DC2.exe performs Set/Query test (activated with dc2.exe /hct +q /dr
    command)
    2. My driver gets an IRP_MN_QUERY_DEVICE_RELATIONS.
    3. The Device object passed to driver entry point for IRP contains NULL as
    Lower device object(This lower device object represents physical device
    object for our USB device)
    4. This Lower device object value change to NULL is sudden as in some
    previous calls it points to a valid physical object.
    5. When we pass IRP_MN_QUERY_DEVICE_RELATIONS IRP to next device using
    IoCallDriver, system crashes with
    1000008E(KERNEL_MODE_EXCEPTION_NOT_HANDLED_M) bugcheck.

    I could not understand why the physical device object becomes NULL. Please
    suggest.

    I also try a workaround: in IRP handler first test the lower device object
    for NULL and if this is NULL then return error and complete the IRP, as
    follows:

    if(NULL == lowerDeviceObject)
    {
    Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
    Irp->IoStatus.Information = 0;
    status = STATUS_UNSUCCESSFUL;

    IoCompleteRequest( Irp, IO_NO_INCREMENT );
    return status;
    }

    Is this a right approach? Please suggest.

    Mini crash dump file is also attached with mail.

    Any help will be highly appreciated.

    Thanks,
    Dev

> Use !analyze -v to get detailed debugging information.

BugCheck 1000008E, {c0000005, 8062c086, f6ba5b3c, 0}

***** Kernel symbols are WRONG. Please fix symbols to do analysis.

You need to fix this problem first. The output of !analyze is pretty useless
until you resolve this.

Mike