128 if (StringDescriptor->
bLength == 2)
181 DeviceExtension->DeviceDescriptor =
NULL;
194 FreeItem(DeviceExtension->DeviceDescriptor);
195 DeviceExtension->DeviceDescriptor =
NULL;
202 DescriptorLength = DeviceExtension->ConfigurationDescriptor->wTotalLength;
207 FreeItem(DeviceExtension->ConfigurationDescriptor);
208 DeviceExtension->ConfigurationDescriptor =
NULL;
219 FreeItem(DeviceExtension->DeviceDescriptor);
220 DeviceExtension->DeviceDescriptor =
NULL;
283 DbgPrint(
"Bogus ConfigurationDescriptor Found\n");
284 DbgPrint(
"InterfaceCount %x\n", ConfigurationDescriptor->bNumInterfaces);
317 ULONG DescriptorCount;
322 ASSERT(ConfigurationDescriptor);
323 ASSERT(ConfigurationDescriptor->bNumInterfaces);
328 DescriptorCount = ConfigurationDescriptor->bNumInterfaces;
329 if (DescriptorCount == 0)
331 DPRINT1(
"[USBCCGP] DescriptorCount is zero\n");
339 if (!FDODeviceExtension->InterfaceList)
350 FDODeviceExtension->InterfaceListCount = 0;
363 ASSERT(FDODeviceExtension->InterfaceListCount < DescriptorCount);
364 FDODeviceExtension->InterfaceList[FDODeviceExtension->InterfaceListCount].InterfaceDescriptor =
InterfaceDescriptor;
365 FDODeviceExtension->InterfaceListCount++;
376 if (FDODeviceExtension->DeviceDescriptor && FDODeviceExtension->DeviceDescriptor->idVendor == 0x0458 && FDODeviceExtension->DeviceDescriptor->idProduct == 0x705f)
390 ASSERT(FDODeviceExtension->InterfaceListCount);
401 DbgPrint(
"Dumping ConfigurationDescriptor %x\n", ConfigurationDescriptor);
509 DPRINT1(
"USBCCGP_SyncUrbRequest failed to set interface %x\n",
Status);
524 if (!DeviceExtension->InterfaceList[
Index].Interface)
#define NT_SUCCESS(StatCode)
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
VOID DumpFullConfigurationDescriptor(IN PFDO_DEVICE_EXTENSION FDODeviceExtension, IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor)
NTSTATUS USBCCGP_SelectConfiguration(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension)
VOID DumpConfigurationDescriptor(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor)
NTSTATUS NTAPI USBCCGP_GetStringDescriptor(IN PDEVICE_OBJECT DeviceObject, IN ULONG DescriptorLength, IN UCHAR DescriptorIndex, IN LANGID LanguageId, OUT PVOID *OutDescriptor)
NTSTATUS NTAPI USBCCGP_GetDescriptor(IN PDEVICE_OBJECT DeviceObject, IN UCHAR DescriptorType, IN ULONG DescriptorLength, IN UCHAR DescriptorIndex, IN LANGID LanguageId, OUT PVOID *OutDescriptor)
NTSTATUS AllocateInterfaceDescriptorsArray(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, OUT PUSB_INTERFACE_DESCRIPTOR **OutArray)
NTSTATUS USBCCGP_SelectInterface(IN PDEVICE_OBJECT DeviceObject, IN PFDO_DEVICE_EXTENSION DeviceExtension, IN ULONG InterfaceIndex)
NTSTATUS USBCCGP_GetDescriptors(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS NTAPI USBCCGP_ScanConfigurationDescriptor(IN OUT PFDO_DEVICE_EXTENSION FDODeviceExtension, IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor)
NTSTATUS USBCCGP_SyncUrbRequest(IN PDEVICE_OBJECT DeviceObject, OUT PURB UrbRequest)
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
VOID FreeItem(IN PVOID Item)
struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration
struct _URB_CONTROL_DESCRIPTOR_REQUEST UrbControlDescriptorRequest
struct _URB_SELECT_INTERFACE UrbSelectInterface
UCHAR bConfigurationValue
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_DEVICE_DATA_ERROR
#define STATUS_INSUFFICIENT_RESOURCES
#define USB_CONFIGURATION_DESCRIPTOR_TYPE
struct _USB_STRING_DESCRIPTOR * PUSB_STRING_DESCRIPTOR
#define USB_DEVICE_DESCRIPTOR_TYPE
#define USB_STRING_DESCRIPTOR_TYPE
struct _USB_COMMON_DESCRIPTOR * PUSB_COMMON_DESCRIPTOR
struct _USBD_INTERFACE_INFORMATION * PUSBD_INTERFACE_INFORMATION
PURB NTAPI USBD_CreateConfigurationRequestEx(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, PUSBD_INTERFACE_LIST_ENTRY InterfaceList)
PUSB_INTERFACE_DESCRIPTOR NTAPI USBD_ParseConfigurationDescriptorEx(PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, PVOID StartPosition, LONG InterfaceNumber, LONG AlternateSetting, LONG InterfaceClass, LONG InterfaceSubClass, LONG InterfaceProtocol)
#define UsbBuildGetDescriptorRequest(urb, length, descriptorType, descriptorIndex, languageId, transferBuffer, transferBufferMDL, transferBufferLength, link)
_In_ ULONG _In_ PVOID _In_ LONG DescriptorType
#define UsbBuildSelectInterfaceRequest(urb, length, configurationHandle, interfaceNumber, alternateSetting)
#define GET_SELECT_INTERFACE_REQUEST_SIZE(totalPipes)
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
_In_ WDFUSBINTERFACE _In_ UCHAR _Out_ PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor
_In_ WDFUSBDEVICE _In_ UCHAR InterfaceIndex