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/


How to handle hardware event using IRP-based approach in WDK

croy_kfrcroy_kfr Member Posts: 2

Hi all,
I am trying to implement hardware event in a PCI driver using the IRP-based approach developing in the hardware event sample "general/event/"
However, this is written as a WDM model and I would like to have an equivalent for a WDK model.
Where can I find some examples for hardware event using IRP-based approach in WDK ?
Thanks.
Best Regards,

Comments

  • Mark_RoddyMark_Roddy Member - All Emails Posts: 4,391

    That sample is embarrassingly old and outdated. On the other hand just use the kmdf ioctl sample as a starting point for a wdf driver and apply the concepts in the event sample to it.
    https://github.com/microsoft/Windows-driver-samples/tree/master/general/ioctl/kmdf

  • croy_kfrcroy_kfr Member Posts: 2

    Thank you Mark for your reply.
    Just note that the event sample does not work on my win10 (BSOD).
    I read the general ioctl\kmdf but it is for a non-pnp application and my drive is PnP.
    In fact, I am looking for an example of how a driver event is signalled to the user app.
    I read over PST that one way is to use overlapped structure and completion I/O port.
    Do you have an example of this kind of structure to help me ?
    Thanks.

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,763

    The fact that the sample is non-PnP is completely irrelevant to your need. You want an example of how to do communication, and that part is the same.

    ... one way is to use overlapped structure and completion I/O port.

    Those are user-mode concerns. They don't have any impact on the driver. The basic concept is that the application submits a few ioctls, the driver stores those in a queue, and when something interesting happens, the driver pops one of the pending requests and completes it. The application processes it and sends it back to the driver. It's just that simple.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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!
Writing WDF Drivers 7 Dec 2020 LIVE ONLINE
Internals & Software Drivers 25 Jan 2021 LIVE ONLINE
Developing Minifilters 8 March 2021 LIVE ONLINE