How to call Parallel Port driver dispatch routine

Discussion in 'Windows Vista Drivers' started by T.Masuda, Aug 30, 2006.

  1. T.Masuda

    T.Masuda Guest

    I want to use a parellel port from my custom driver. I'm now trying to send
    my own IRP to parallel port driver. When I try to call IoCallDriver() using
    parallel port device object pointer, my system crush with bug check code
    0x19, 0x35, or 0x44.

    1) How can I build custom driver's own IRP ?
    I call IoAllocateIrp() and then call IoSetNextIrpStackLocation(). To get
    stack location, I call IoGetNextIrpStackLocation(). Is my procedure right?

    2) How can I get parallel port device object pointer?
    I use the pointer which I get using IoGetDeviceObjectPointer() directly. How
    should I use file object pointer?

    Thanks in advance.

    Takashi Masuda
    Sony Co.
     
    T.Masuda, Aug 30, 2006
    #1
    1. Advertisements

  2. I want to use a parellel port from my custom driver.

    Find the NT4 DDK . It has several samples showing how to talk to the
    parallel port driver.

    Leo Havmøller.
     
    Leo Havmøller, Aug 30, 2006
    #2
    1. Advertisements

  3. T.Masuda

    Calvin Guan Guest

    Tak,

    #1) What IRP are you sending down? Depending on what irp you are sending,
    you may also use IoBuildAsynchronousFsdRequest,
    IoBuildDeviceIoControlRequest or IoBuildSynchronousFsdRequest.

    To use IoAllocateIrp, you don't want to call IoSetNextIrpStackLocation. You
    are passing an uninitialized i/o stack to the target driver.

    #2) Assuming you have got the device object so the call looks good. If you
    don't use the file object, the normal practice is take a reference count to
    the device object then de-reference the file object (not the other way
    around).

    I'm sure someone on this group would suggest you to use KMDF or WDF. Playing
    with IRP nowadays seems toooo old fashioned:).

    --
    Calvin Guan (DDK MVP)
    Sr. Staff Engineer
    NetXtreme NTX Miniport
    Broadcom Corporation
    Connecting Everything(r)
     
    Calvin Guan, Aug 30, 2006
    #3
  4. that woudl be me :). KMDF will make all of these issues go away. KMDF lets
    you easily create, format and send IRPs to a device w/out worrying about
    buffers or stack locations. you can download KMDF from
    http://www.microsoft.com/whdc/driver/wdf/KMDF_pkg.mspx and look at the
    samples. toastmon shows how to open a device based on device interface
    notifications.

    d
     
    Doron Holan [MS], Aug 30, 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.