none
Getting Configuration Descriptors from KMDF RRS feed

  • Question

  • I was working with the OSR USB FX device and trying to get the Configuration descriptor of the device from a KMDF driver by sending a control request. But the WdfUsbTargetDeviceSendControlTransferSynchronously() call fails with status STATUS_INVALID_PARAMETER. I am sending the control request in EvtPrepareHardware() callback. The USB device is created successfully. Below is the code I am trying to get the descriptors.

    USB_CONFIGURATION_DESCRIPTOR ConfigDescriptor;
    WDF_USB_CONTROL_SETUP_PACKET_INIT(&ControlSetupPacket, BmRequestHostToDevice, BmRequestToDevice, USB_REQUEST_GET_CONFIGURATION, 0, 0);
    	WDF_MEMORY_DESCRIPTOR_INIT_BUFFER(&MemDescriptor, (PVOID) &ConfigDescriptor, sizeof(ConfigDescriptor));
    	WDF_REQUEST_SEND_OPTIONS_INIT(&SendOptions, WDF_REQUEST_SEND_OPTION_TIMEOUT);
    	WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT(&SendOptions, WDF_REL_TIMEOUT_IN_SEC(10));
    	status = WdfUsbTargetDeviceSendControlTransferSynchronously(DeviceContext->UsbDevice, WDF_NO_HANDLE, NULL, &ControlSetupPacket, &MemoryDescriptor, NULL);
    	if (!NT_SUCCESS(status))
    	{
    		KdPrintEx((DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "WdfUsbTargetDeviceSendControlTransferSynchronously() failed. \r\n"));
    
    		return status;
    	}
    	else
    	{
    		KdPrint(("Number of interfaces = 0x%x \r\n", ConfigDescriptor.bNumInterfaces));
    	}


    The same status error code is returned when  I tried to get Device Descriptors also. What could be wrong here?  Which parameter is invalid?





    • Edited by its_me_here Thursday, March 20, 2014 12:02 PM
    Thursday, March 20, 2014 12:00 PM

Answers

All replies