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/


What is the difference between [Read Report & Get Input Report] , [Write Report & Set Output Report]

akshdeepakshdeep Member Posts: 3

I am new to HID devices. I am writing a HID driver in windows (similar to vhidmini2). I am a bit confused about APIs used for data movement between the application and the selected device.

What is the difference between:
* IOCTL_HID_READ_REPORT and IOCTL_HID_GET_INPUT_REPORT/IOCTL_UMDF_HID_GET_INPUT_REPORT
* IOCTL_HID_WRITE_REPORT and IOCTL_HID_SET_OUTPUT_REPORT/IOCTL_UMDF_HID_SET_OUTPUT_REPORT
* ReadFile and HidD_GetInputReport
* WriteFile and HidD_SetOutputReport

By difference I mean I don't understand when to use which one? As to me, I think all the pairs do the same thing.

Comments

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 7,913

    I haven't worked much in the HID stack, so I'm not the best one to answer this... but for IOCTL_HID_GET_INPUT_REPORT vs IOCTL_GET_READ_REPORT (and friends) it's a layering thing.

    IOCTL_HID_GET_INPUT_REPORT is an INPUT to HID Class... IOCTL_HID_READ_REPORT is OUTPUT from HID Class.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,498

    IOCTL_HID_READ_REPORT asks for whatever input report might be waiting. IOCTL_HIT_GET_INPUT_REPORT asks for one specific report ID. Also note that READ_REPORT and WRITE_REPORT are METHOD_NEITHER, while GET_INPUT_REPORT and SET_OUTPUT_REPORT are METHOD_xxx_DIRECT.

    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!
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 15 Jun 2020 LIVE ONLINE
Writing WDF Drivers 22 June 2020 LIVE ONLINE
Internals & Software Drivers 28 Sept 2020 Dulles, VA