Hi,
To give a background…
I am writing a KMDF HID client driver that sits above the HIDClass(This is not a filter driver like the Firefly sample). This is a POC project and wanted to make sure if we are on the right track.
The stack would look something like:
HID client driver -> HIDClass -> HIDMiniport -> Firmware
Our firmware exposes a specific device for this HIDclient driver (the miniport is also owned by us).
The HID client INF looks something like:
Class = Sensor
ClassGuid = {5175D334-C371-4806-B3BA-71FD53C9258D}
The device ID part would be something like
%XXX.DeviceDesc%=XXX, HID\Vid_0001&Pid_0088
Even though the UP/U exposed is for SENSOR, technically this would not be a sensor like any of the accelerometer etc. We would not be exposing this to the OS as a sensor.
Problem:
The driver loads and I am able to send some of the COLLECTION related IOCTL’s and get data back.
For e.g. IOCTL_HID_GET_COLLECTION_INFORMATION, IOCTL_HID_GET_COLLECTION_DESCRIPTOR
But when I try to send a IOCTL_HID_GET_FEATURE, it fails with STATUS_PRIVILEGE_NOT_HELD
Initially I was using the local IO target (WdfDeviceGetIoTarget). I then tried using a remote IO target like the Firefly example. However in that case
WdfIoTargetOpen(…) failed with STATUS_NO_DEVICE.
ntStatus = WdfIoTargetCreate(p_wdfDevice,
WDF_NO_OBJECT_ATTRIBUTES,
&wdfIoTarget);
if (!NT_SUCCESS(ntStatus)) {
goto exit;
}
WDF_IO_TARGET_OPEN_PARAMS_INIT_OPEN_BY_NAME(&wdfIoTargetOpenParams,
&pDeviceContext->pdoName,
FILE_WRITE_ACCESS);
wdfIoTargetOpenParams.ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE;
//pFileObject = WdfIoTargetWdmGetTargetFileObject(wdfIoTarget);
//if (pFileObject == NULL) {
// goto exit;
//}
//wdfIoTargetOpenParams.TargetFileObject = pFileObject;
ntStatus = WdfIoTargetOpen(wdfIoTarget, &wdfIoTargetOpenParams);
if (!NT_SUCCESS(ntStatus)) {
goto exit;
}
Would appreciate if someone could point to what I am missing here? The firefly sample seems to be doing the same?
Thanks in advance!