In WDK’s vhidmini example, for IOCTL_HID_GET_FEATURE, author is using following code to access HID_XFER_PACKET.
// Line 718 in vhidmini.c
transferPacket = (PHID_XFER_PACKET)Irp->UserBuffer;
My question is which I/O access method (METHOD_BUFFERED, METHOD_OUT_DIRECT, METHOD_NEITHER) is used for IOCTL_HID_GET_FEATURE ?
Thanks,
The answer is in hidclass.h
D
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Tuesday, April 24, 2007 12:28 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] I/O access method
In WDK’s vhidmini example, for IOCTL_HID_GET_FEATURE, author is using
following code to access HID_XFER_PACKET.
// Line 718 in vhidmini.c
transferPacket = (PHID_XFER_PACKET)Irp->UserBuffer;
My question is which I/O access method (METHOD_BUFFERED,
METHOD_OUT_DIRECT, METHOD_NEITHER) is used for IOCTL_HID_GET_FEATURE ?
Thanks,
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
METHOD_OUT_DIRECT thanks d.
So when HidD_GetFeature is called, request goes to HIDCLASS which then calls Hid minidriver (vhidmini) to complete the request. Is HIDCLASS doing any work before calling minidriver. Because i don’t see any MmGetMdlVirtualAddress (DMA) or MmGetSystemAddressForMdlSafe (PIO) in vhidmini.c
The buffer in UserBuffer is not the caller’s buffer, UserBuffer is a PHID_XFER_PACKET which points to the caller’s buffer and length. You do not have a MDL to operate on, or more succinctly, the system VA returned from the PMDL is not the same ointer as UserBuffer.
d
so the caller’s buffer that PHID_XFER_PACKET is pointing to is in user virtual space. In that case isn’t there any need to lock user buffer before accessing it unless driver code that is accessing user buffer is always running in the context of calling thread.
what i’m trying to understand, is there any case where accessing buffer that PHID_XFER_PACKET is pointing to will ever fail (BSOD).
The buffer that is in the PHID_XFER_PACKET is system VA and is already
locked. You can safely touch the buffer.
d
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Tuesday, April 24, 2007 2:23 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] I/O access method
so the caller’s buffer that PHID_XFER_PACKET is pointing to is in user
virtual space. In that case isn’t there any need to lock user buffer
before accessing it unless driver code that is accessing user buffer is
always running in the context of calling thread.
what i’m trying to understand, is there any case where accessing buffer
that PHID_XFER_PACKET is pointing to will ever fail (BSOD).
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer