27 LPWSTR GenericString =
L"Composite USB Device";
47 return Irp->IoStatus.Status;
53 if (PDODeviceExtension->FunctionDescriptor->FunctionDescription.Length)
71 RtlCopyMemory(
Buffer, PDODeviceExtension->FunctionDescriptor->FunctionDescription.Buffer, PDODeviceExtension->FunctionDescriptor->FunctionDescription.Length);
101 DPRINT(
"USBCCGP_PdoHandleDeviceRelations\n");
116 return Irp->IoStatus.Status;
123 if (!DeviceRelations)
134 DeviceRelations->
Count = 1;
255 swprintf(
Buffer,
L"%s&MI_%02x", (
LPWSTR)
Irp->IoStatus.Information, PDODeviceExtension->FunctionDescriptor->FunctionNumber);
276 DeviceString = &PDODeviceExtension->FunctionDescriptor->HardwareId;
295 swprintf(
Buffer,
L"%04x", PDODeviceExtension->FunctionDescriptor->FunctionNumber);
304 DeviceString = &PDODeviceExtension->FunctionDescriptor->CompatibleId;
311 return Irp->IoStatus.Status;
398 for(
Index = 0;
Index < PDODeviceExtension->FDODeviceExtension->FunctionDescriptorCount;
Index++)
405 PDODeviceExtension->FDODeviceExtension->ChildPDO[
Index] =
NULL;
452 DPRINT(
"[USBCCGP] PDO IRP_MN_START\n");
518 DPRINT(
"USBCCGP_BuildConfigurationDescriptor\n");
528 ConfigurationDescriptor = PDODeviceExtension->ConfigurationDescriptor;
535 for (
Index = 0;
Index < PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces;
Index++)
601 DPRINT1(
"[USBCCGP] Failed to allocate %lu Bytes\n", TotalSize);
611 for (
Index = 0;
Index < PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces;
Index++)
674 ConfigurationDescriptor =
Buffer;
676 ConfigurationDescriptor->
bNumInterfaces = PDODeviceExtension->FunctionDescriptor->NumberOfInterfaces;
717 ULONG NeedSelect, FoundInterface;
772 DPRINT1(
"[USBCCGP] SelectConfiguration Function %x InterfaceNumber %x Alternative %x Length %lu InterfaceInformation->Length %lu\n", PDODeviceExtension->FunctionDescriptor->FunctionNumber, InterfaceInformation->
InterfaceNumber, InterfaceInformation->
AlternateSetting,
Length, InterfaceInformation->
Length);
777 FoundInterface =
FALSE;
780 if (PDODeviceExtension->FunctionDescriptor->InterfaceDescriptorList[
InterfaceIndex]->bInterfaceNumber == InterfaceInformation->
InterfaceNumber)
783 FoundInterface =
TRUE;
941 DPRINT1(
"[USBCCGP] SelectConfiguration Function %x Completed\n", PDODeviceExtension->FunctionDescriptor->FunctionNumber);
976 DPRINT(
"IOCTL_INTERNAL_USB_SUBMIT_URB Function %x\n", Urb->
UrbHeader.Function);
1039 (
PVOID*)&StringDescriptor);
1042 if (StringDescriptor->
bLength == 2)
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
DECLSPEC_NORETURN VOID NTAPI KeBugCheck(ULONG BugCheckCode)
#define STATUS_NOT_IMPLEMENTED
#define NT_SUCCESS(StatCode)
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
NTSTATUS NTAPI USBCCGP_GetDescriptor(IN PDEVICE_OBJECT DeviceObject, IN UCHAR DescriptorType, IN ULONG DescriptorLength, IN UCHAR DescriptorIndex, IN LANGID LanguageId, OUT PVOID *OutDescriptor)
NTSTATUS USBCCGP_SyncUrbRequest(IN PDEVICE_OBJECT DeviceObject, OUT PURB UrbRequest)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PVOID AllocateItem(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes)
VOID FreeItem(IN PVOID Item)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define IoSkipCurrentIrpStackLocation(Irp)
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
#define IoCompleteRequest
BOOLEAN NTAPI IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
#define STATUS_INVALID_BUFFER_SIZE
base of all file and directory entries
PDEVICE_OBJECT Objects[1]
struct _IO_STACK_LOCATION::@3979::@4018 Others
struct _IO_STACK_LOCATION::@3979::@4011 QueryDeviceText
struct _IO_STACK_LOCATION::@1580::@1581 DeviceIoControl
struct _IO_STACK_LOCATION::@3979::@4010 QueryId
union _IO_STACK_LOCATION::@1580 Parameters
struct _IO_STACK_LOCATION::@3979::@4004 QueryDeviceRelations
struct _IO_STACK_LOCATION::@3979::@4006 DeviceCapabilities
COMMON_DEVICE_EXTENSION Common
struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration
struct _URB_CONTROL_DESCRIPTOR_REQUEST UrbControlDescriptorRequest
struct _URB_SELECT_INTERFACE UrbSelectInterface
struct _URB_HEADER UrbHeader
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_DEVICE_DATA_ERROR
#define STATUS_INSUFFICIENT_RESOURCES
#define USB_CONFIGURATION_DESCRIPTOR_TYPE
struct _USB_INTERFACE_DESCRIPTOR * PUSB_INTERFACE_DESCRIPTOR
#define USB_DEVICE_DESCRIPTOR_TYPE
struct _USB_DEVICE_DESCRIPTOR USB_DEVICE_DESCRIPTOR
#define USB_STRING_DESCRIPTOR_TYPE
#define USB_INTERFACE_DESCRIPTOR_TYPE
#define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE
NTSTATUS PDO_HandleInternalDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS USBCCGP_PdoHandleQueryId(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS PDO_HandlePower(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS PDO_HandlePnp(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS USBCCGP_PdoHandleQueryDeviceText(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
NTSTATUS PDO_Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS USBCCGP_PdoAppendInterfaceNumber(IN LPWSTR DeviceId, IN ULONG InterfaceNumber, OUT LPWSTR *OutString)
NTSTATUS USBCCGP_PdoHandleDeviceRelations(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp)
NTSTATUS USBCCGP_PDOSelectConfiguration(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS USBCCGP_BuildConfigurationDescriptor(PDEVICE_OBJECT DeviceObject, PIRP Irp)
struct _USBD_INTERFACE_INFORMATION * PUSBD_INTERFACE_INFORMATION
#define URB_FUNCTION_SELECT_CONFIGURATION
#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE
#define UsbBuildSelectInterfaceRequest(urb, length, configurationHandle, interfaceNumber, alternateSetting)
#define GET_SELECT_INTERFACE_REQUEST_SIZE(totalPipes)
_In_ PVOID _In_ LONG InterfaceNumber
#define IOCTL_INTERNAL_USB_SUBMIT_URB
#define IOCTL_INTERNAL_USB_RESET_PORT
#define IOCTL_INTERNAL_USB_CYCLE_PORT
#define IOCTL_INTERNAL_USB_GET_PORT_STATUS
_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_ WDFDEVICE _In_ WDFSTRING String
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
_In_ WDFUSBINTERFACE _In_ UCHAR _Out_ PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor
_In_ WDFUSBDEVICE _In_ UCHAR InterfaceIndex
#define IRP_MN_QUERY_INTERFACE
#define IRP_MN_START_DEVICE
#define IRP_MN_REMOVE_DEVICE
struct _DEVICE_RELATIONS * PDEVICE_RELATIONS
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IRP_MN_QUERY_STOP_DEVICE
#define IRP_MN_QUERY_DEVICE_TEXT
#define IRP_MN_QUERY_CAPABILITIES
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
#define IRP_MN_QUERY_POWER
#define IRP_MN_QUERY_REMOVE_DEVICE
#define ObReferenceObject