Sending Irp from SCSI miniport driver to bus driver

Discussion in 'Windows Vista Drivers' started by bglaudel, Feb 6, 2006.

  1. bglaudel

    bglaudel Guest

    I have a bus driver similar to the toaster bus driver from the DDK. I
    create a PDO (by using an application to send
    IOCTL_BUSENUM_PLUGIN_HARDWARE), and then I load my SCSI miniport driver
    onto that PDO. My bus driver exports an interface that the SCSI
    miniport driver uses. In the SCSI miniport code, I want to send
    IRP_MN_QUERY_INTERFACE to the child PDO that corresponds to the PDO on
    which the miniport driver is installed. In the miniport code, I have
    been sending the IRP by using the code below, where targetObject is the
    DEVICE_OBJECT field of the DRIVER_OBJECT parameter passed to the
    miniport's DriverEntry function. I believe that targetObject would
    then correspond to the FDO (not the child PDO that I want), but,
    nevertheless, this was working with no problems at all. However, I
    recently switched to another test PC, and now I get Bug Check 0x35
    (NO_MORE_IRP_STACK_LOCATIONS) on the call to IoCallDriver.

    1) Any idea why I get this Bug Check?
    2) Is there a way for the miniport driver to get the PDO pointer that I
    need?

    KeInitializeEvent(&event, NotificationEvent, FALSE);

    irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP, targetObject, NULL, 0,
    NULL, &event, &ioStatusBlock);
    if(NULL == irp)
    {
    status = STATUS_INSUFFICIENT_RESOURCES;
    goto End;
    }

    irpStack = IoGetNextIrpStackLocation(irp);

    irpStack->MinorFunction = IRP_MN_QUERY_INTERFACE;
    irpStack->Parameters.QueryInterface.InterfaceType =
    (LPGUID)&ChannelBusProtocolGuid;
    irpStack->Parameters.QueryInterface.Size = sizeof(CHANNEL_BUS);
    irpStack->Parameters.QueryInterface.Version = 1;
    irpStack->Parameters.QueryInterface.Interface =
    (PINTERFACE)pChannelBus;
    irpStack->Parameters.QueryInterface.InterfaceSpecificData = NULL;
    irp->IoStatus.Status = STATUS_NOT_SUPPORTED;

    status = IoCallDriver(targetObject, irp);
    if(STATUS_PENDING == status)
    {
    KeWaitForSingleObject(&event, Executive, KernelMode, FALSE,
    NULL);
    status = ioStatusBlock.Status;
    }
     
    bglaudel, Feb 6, 2006
    #1
    1. Advertisements

  2. Considering that a SCSI mini-port does NOT include NTDDK.H the questiion
    bcomes HOW your are resolving the
    header file inconsistencies to actually do KeXxx or IoXxxx in your miniport.
    I've done such, but I'd like to know how you resolved it, becsue there could
    lie the problem.

    Also ... you've pretty well violated the principal of a SCSi mini-port in
    doing what you have done.
     
    Gary G. Little, Feb 6, 2006
    #2
    1. Advertisements

  3. bglaudel

    bglaudel Guest

    I actually have been including ntddk.h in my SCSI miniport, and I
    haven't hit a problem up until this Bug Check. How are you resolving
    it?

    Thanks.
     
    bglaudel, Feb 7, 2006
    #3
  4. bglaudel

    bglaudel Guest

    Today I tried the method suggested in some other postings, where I
    create a separate source file that includes NTDDK.H and exports wrapper
    functions for the miniport source file to use. Unfortunately, I still
    get the NO_MORE_IRP_STACK_LOCATIONS Bug Check.
     
    bglaudel, Feb 7, 2006
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.