About KMDF sends IOCTL_HID_GET_FEATURE failed

Hi,

My driver uses the following code to get the feature report from the remote HID IO target. But calling the WdfIoTargetSendIoCtlSynchronously alreays returns error code STATUS_DATA_ERROR. The object handle hIoTarget is correct because I can get the preparsed data from it. Does anyone know whether it’s the right way to do that? If not, how can I do that?

pReport = (PCHAR)ExAllocatePoolWithTag(
NonPagedPool,
hidpCaps.FeatureReportByteLength,
RZFILTER_POOL_TAG
);
RtlZeroMemory(pReport, hidpCaps.FeatureReportByteLength);

pMdl = IoAllocateMdl(
pReport,
hidpCaps.FeatureReportByteLength,
FALSE,
FALSE,
NULL
);
MmBuildMdlForNonPagedPool(pMdl);

WDF_MEMORY_DESCRIPTOR_INIT_MDL(
&outputDescriptor,
pMdl,
hidpCaps.FeatureReportByteLength
);

status = WdfIoTargetSendIoctlSynchronously(
hIoTarget,
NULL,
IOCTL_HID_GET_FEATURE,
NULL,
&outputDescriptor,
NULL,
NULL
);

Thanks,
Marshall