Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


IoBuildDeviceIoControlRequest() and IoCallDriver()

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Hi All,
On getting a IOCTL from a win32 application, in my filter driver, I'm using IoBuildDeviceIoControlRequest() and IoCallDriver() to send block Read/Write commands(special purpose) to the underlying SCSI Port driver. I'm supplying a event to IoBuildDeviceIoControlRequest() and also waiting on it, if IoCallDriver() returns with STATUS_PENDING. But very rarely, the Read/Write I send to the underlying driver never returns(the event never gets signaled).

Can anybody tell me what might be the problem.

Thanks,
Sajeev.

Comments

  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    Are you using IoBuildDeviceIoControlRequest() to build IRP_MJ_READ and
    IRP_MJ_WRITE requests? If so, this is not correct, you shouold use
    IoBuildSynchronousFsdRequest() or IoBuildAsynchronousFsdRequest().

    Jamey

    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Sajeev
    Sent: Thursday, June 15, 2000 11:53 AM
    To: NT Developers Interest List
    Subject: [ntdev] IoBuildDeviceIoControlRequest() and IoCallDriver()


    Hi All,
    On getting a IOCTL from a win32 application, in my filter driver, I'm
    using IoBuildDeviceIoControlRequest() and IoCallDriver() to send block
    Read/Write commands(special purpose) to the underlying SCSI Port driver. I'm
    supplying a event to IoBuildDeviceIoControlRequest() and also waiting on it,
    if IoCallDriver() returns with STATUS_PENDING. But very rarely, the
    Read/Write I send to the underlying driver never returns(the event never
    gets signaled).

    Can anybody tell me what might be the problem.

    Thanks,
    Sajeev.
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    I'm using IOCTL_SCSI_EXEC_IN as the control code for the IoBuildDeviceIoControlRequest() and using direct CDB command for reading. I doubt whether I can use IoBuildSynchronousFsdRequest() since, my filter sits between disk.sys and scsiport.

    Thanks,
    Sajeev
    ----- Original Message -----
    From: Jamey Kirby
    To: NT Developers Interest List
    Sent: Thursday, June 15, 2000 11:53 AM
    Subject: [ntdev] RE: IoBuildDeviceIoControlRequest() and IoCallDriver()


    Are you using IoBuildDeviceIoControlRequest() to build IRP_MJ_READ and IRP_MJ_WRITE requests? If so, this is not correct, you shouold use IoBuildSynchronousFsdRequest() or IoBuildAsynchronousFsdRequest().

    Jamey

    -----Original Message-----
    From: xxx[email protected] [mailto:[email protected]]On Behalf Of Sajeev
    Sent: Thursday, June 15, 2000 11:53 AM
    To: NT Developers Interest List
    Subject: [ntdev] IoBuildDeviceIoControlRequest() and IoCallDriver()


    Hi All,
    On getting a IOCTL from a win32 application, in my filter driver, I'm using IoBuildDeviceIoControlRequest() and IoCallDriver() to send block Read/Write commands(special purpose) to the underlying SCSI Port driver. I'm supplying a event to IoBuildDeviceIoControlRequest() and also waiting on it, if IoCallDriver() returns with STATUS_PENDING. But very rarely, the Read/Write I send to the underlying driver never returns(the event never gets signaled).

    Can anybody tell me what might be the problem.

    Thanks,
    Sajeev.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 26 Feb - 1 Mar 2024 Live, Online