29 DPRINT(
"USBPORT_SendSetupPacket: DeviceHandle - %p, FdoDevice - %p, SetupPacket - %p, Buffer - %p, Length - %x, TransferedLen - %x, pUSBDStatus - %x\n",
121 *pUSBDStatus = USBDStatus;
136 DPRINT(
"USBPORT_SendSetupPacket: Status - %x\n",
Status);
149 DPRINT(
"USBPORT_GetInterfaceLength ... \n");
151 Length = iDescriptor->bLength;
154 if (iDescriptor->bNumEndpoints)
156 for (ix = 0; ix < iDescriptor->bNumEndpoints; ix++)
198 DPRINT(
"USBPORT_ParseConfigurationDescriptor ... \n");
201 *HasAlternates =
FALSE;
228 OutDescriptor = iDescriptor;
238 if ((ix > 1) && HasAlternates)
239 *HasAlternates =
TRUE;
241 return OutDescriptor;
271 DPRINT(
"USBPORT_OpenInterface: ...\n");
274 InterfaceInfo->InterfaceNumber,
275 InterfaceInfo->AlternateSetting,
283 if (HasAlternates && SendSetInterface)
291 SetupPacket.wValue.W = InterfaceInfo->AlternateSetting;
292 SetupPacket.wIndex.W = InterfaceInfo->InterfaceNumber;
310 InterfaceHandle = *iHandle;
321 if (!InterfaceHandle)
329 for (ix = 0; ix < NumEndpoints; ++ix)
331 PipeHandle = &InterfaceHandle->PipeHandle[ix];
349 InterfaceInfo->Reserved = 0;
355 for (ix = 0; ix < NumEndpoints; ++ix)
374 Descriptor->wMaxPacketSize = InterfaceInfo->Pipes[ix].MaximumPacketSize;
382 PipeHandle->PipeFlags = InterfaceInfo->Pipes[ix].PipeFlags;
388 MaxPacketSize = (wMaxPacketSize & 0x7FF) * (((wMaxPacketSize >> 11) & 3) + 1);
390 InterfaceInfo->Pipes[ix].EndpointAddress =
Descriptor->bEndpointAddress;
392 InterfaceInfo->Pipes[ix].MaximumPacketSize = MaxPacketSize;
394 InterfaceInfo->Pipes[ix].Interval =
Descriptor->bInterval;
402 for (ix = 0; ix < NumEndpoints; ++ix)
404 PipeInfo = &InterfaceInfo->Pipes[ix];
428 InterfaceInfo->InterfaceHandle = InterfaceHandle;
429 *iHandle = InterfaceHandle;
430 InterfaceInfo->Length =
Length;
438 DPRINT1(
"USBPORT_OpenInterface: USBDStatus - %lx\n", USBDStatus);
460 DPRINT(
"USBPORT_CloseConfiguration: ... \n");
474 DPRINT(
"USBPORT_CloseConfiguration: iHandle - %p\n", iHandle);
482 while (NumEndpoints > 0)
509 DPRINT(
"USBPORT_InitInterfaceInfo: InterfaceInfo - %p, ConfigHandle - %p\n",
514 InterfaceInfo->InterfaceNumber,
515 InterfaceInfo->AlternateSetting,
528 if (InterfaceInfo->Length >=
Length)
530 InterfaceInfo->Class = 0;
531 InterfaceInfo->SubClass = 0;
532 InterfaceInfo->Protocol = 0;
533 InterfaceInfo->Reserved = 0;
534 InterfaceInfo->InterfaceHandle = 0;
535 InterfaceInfo->NumberOfPipes = NumberOfPipes;
537 Pipe = InterfaceInfo->Pipes;
539 while (NumberOfPipes > 0)
541 Pipe->EndpointAddress = 0;
544 Pipe->PipeHandle = 0;
546 PipeFlags =
Pipe->PipeFlags;
552 Pipe->MaximumPacketSize = 0;
568 InterfaceInfo->Length =
Length;
590 DPRINT(
"USBPORT_HandleSelectConfiguration: ConfigDescriptor %p\n",
591 Urb->UrbSelectConfiguration.ConfigurationDescriptor);
606 DPRINT(
"USBPORT_HandleSelectConfiguration: ConfigDescriptor == NULL\n");
630 InterfaceInfo = &Urb->UrbSelectConfiguration.Interface;
703 InterfaceInfo = &Urb->UrbSelectConfiguration.Interface;
705 for (ix = 0; ix < iNumber; ++ix)
710 InterfaceHandle =
NULL;
751 Urb->UrbSelectConfiguration.ConfigurationHandle = ConfigHandle;
756 DPRINT1(
"USBPORT_HandleSelectConfiguration: Status %x\n",
Status);
774 DPRINT(
"USBPORT_AddDeviceHandle: ... \n");
790 DPRINT(
"USBPORT_RemoveDeviceHandle \n");
831 HandleList = HandleList->
Flink;
847 DPRINT(
"USBPORT_DeviceHasTransfers: ... \n");
857 PipeHandleList = PipeHandleList->
Flink;
878 DPRINT(
"USBPORT_AbortAllTransfers: ... \n");
888 HandleList = HandleList->
Flink;
924 *OutHubDeviceHandle =
NULL;
928 DPRINT(
"USBPORT_GetTt: DeviceHandle - %p, DeviceHandle->PortNumber - %X\n",
960 if (TtExtension->
TtNumber == *OutPort)
997 ULONG DescriptorMinSize;
1003 DPRINT(
"USBPORT_CreateDevice: PortStatus - %p, Port - %x\n",
1023 DPRINT1(
"USBPORT_CreateDevice: Not valid hub DeviceHandle\n");
1032 DPRINT1(
"USBPORT_CreateDevice: USB1 device connected to USB2 port\n");
1039 DPRINT(
"USBPORT_CreateDevice: TtDeviceHandle - %p, port - %x\n",
1055 DPRINT1(
"USBPORT_CreateDevice: Not allocated DeviceHandle\n");
1061 *pUsbdDeviceHandle =
NULL;
1095 PipeHandle->EndpointDescriptor.wMaxPacketSize = 8;
1114 DPRINT1(
"USBPORT_CreateDevice: USBPORT_OpenPipe return - %lx\n",
Status);
1132 DPRINT1(
"USBPORT_CreateDevice: Not allocated DeviceDescriptor\n");
1173 MaxPacketSize =
DeviceHandle->DeviceDescriptor.bMaxPacketSize0;
1175 if (MaxPacketSize == 8 ||
1176 MaxPacketSize == 16 ||
1177 MaxPacketSize == 32 ||
1178 MaxPacketSize == 64)
1194 DPRINT1(
"USBPORT_CreateDevice: ERROR!!! TransferedLen - %x, Status - %lx\n",
1200 if (TtExtension && TtDeviceHandle)
1257 DPRINT(
"USBPORT_AllocateUsbAddress \n");
1261 for (ix = 0; ix < 4; ++ix)
1265 for (BitNumber = 0; BitNumber < 32; ++BitNumber)
1270 return 32 * ix + BitNumber;
1295 for (ix = 0; ix < 4; ++ix)
1298 CurrentAddress = 32 * ix;
1300 for (BitNumber = 0; BitNumber < 32; ++BitNumber)
1321 ULONG TransferedLen;
1323 UCHAR MaxPacketSize;
1327 DPRINT(
"USBPORT_InitializeDevice: ... \n");
1355 DPRINT(
"USBPORT_InitializeDevice: DeviceAddress - %x. SendSetupPacket Status - %x\n",
1396 MaxPacketSize =
DeviceHandle->DeviceDescriptor.bMaxPacketSize0;
1398 ASSERT((MaxPacketSize == 8) ||
1399 (MaxPacketSize == 16) ||
1400 (MaxPacketSize == 32) ||
1401 (MaxPacketSize == 64));
1412 DPRINT1(
"USBPORT_InitializeDevice: ExitError. Status - %x\n",
Status);
1433 DPRINT(
"USBPORT_GetUsbDescriptor: Type - %x\n");
1460 DPRINT(
"USBPORT_GetInterfaceHandle: ConfigurationHandle - %p, InterfaceNumber - %p\n",
1466 while (iHandleList &&
1476 return InterfaceHandle;
1501 DPRINT(
"USBPORT_HandleSelectInterface: ... \n");
1513 Interface = &Urb->UrbSelectInterface.Interface;
1516 Urb->UrbHeader.Length =
Length;
1531 if (InterfaceHandle)
1565 if (InterfaceHandle)
1593 DPRINT(
"USBPORT_RemoveDevice: DeviceHandle - %p, Flags - %x\n",
1618 DPRINT1(
"USBPORT_RemoveDevice: Not valid device handle\n");
1628 DPRINT(
"USBPORT_RemoveDevice: DeviceHandleLock - %x\n",
1637 DPRINT(
"USBPORT_RemoveDevice: DeviceHandleLock ok\n");
1653 DPRINT1(
"USBPORT_RemoveDevice: DeviceHandle->TtList not empty\n");
1664 DPRINT(
"USBPORT_RemoveDevice: TtExtension - %p\n", TtExtension);
1679 DPRINT(
"USBPORT_RemoveDevice: ExFreePoolWithTag TtExtension - %p\n", TtExtension);
1717 DPRINT(
"USBPORT_RestoreDevice: OldDeviceHandle - %p, NewDeviceHandle - %p\n",
1737 DPRINT(
"USBPORT_RestoreDevice: OldDeviceHandle not valid\n");
1750 DPRINT(
"USBPORT_RestoreDevice: NewDeviceHandle not valid\n");
1794 iHandleList =
NewDeviceHandle->ConfigHandle->InterfaceHandleList.Flink;
1796 while (iHandleList &&
1825 iHandleList = iHandleList->
Flink;
1832 DPRINT1(
"USBPORT_RestoreDevice: FIXME Transaction Translator\n");
1895 &EndpointRequirements);
1931 DPRINT(
"USBPORT_RestoreDevice: New DeviceDescriptor != Old DeviceDescriptor\n");
1962 DPRINT(
"USBPORT_InitializeTT: HubDeviceHandle - %p, TtNumber - %X\n",
1974 DPRINT1(
"USBPORT_InitializeTT: ExAllocatePoolWithTag return NULL\n");
1978 DPRINT(
"USBPORT_InitializeTT: TtExtension - %p\n", TtExtension);
2037 for (ix = 0; ix <
TtCount; ++ix)
#define InterlockedIncrement
#define InterlockedDecrement
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
#define NT_SUCCESS(StatCode)
VOID NTAPI USBPORT_DumpingConfiguration(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigDescriptor)
NTSTATUS NTAPI USBPORT_RemoveDevice(IN PDEVICE_OBJECT FdoDevice, IN OUT PUSBPORT_DEVICE_HANDLE DeviceHandle, IN ULONG Flags)
NTSTATUS NTAPI USBPORT_InitializeTT(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_DEVICE_HANDLE HubDeviceHandle, IN ULONG TtNumber)
VOID NTAPI USBPORT_CloseConfiguration(IN PUSBPORT_DEVICE_HANDLE DeviceHandle, IN PDEVICE_OBJECT FdoDevice)
BOOLEAN NTAPI USBPORT_ValidateDeviceHandle(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_DEVICE_HANDLE DeviceHandle)
VOID NTAPI USBPORT_AbortTransfers(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_DEVICE_HANDLE DeviceHandle)
NTSTATUS NTAPI USBPORT_InitInterfaceInfo(IN PUSBD_INTERFACE_INFORMATION InterfaceInfo, IN PUSBPORT_CONFIGURATION_HANDLE ConfigHandle)
USBD_STATUS NTAPI USBPORT_OpenInterface(IN PURB Urb, IN PUSBPORT_DEVICE_HANDLE DeviceHandle, IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_CONFIGURATION_HANDLE ConfigHandle, IN PUSBD_INTERFACE_INFORMATION InterfaceInfo, IN OUT PUSBPORT_INTERFACE_HANDLE *iHandle, IN BOOLEAN SendSetInterface)
NTSTATUS NTAPI USBPORT_HandleSelectConfiguration(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp, IN PURB Urb)
NTSTATUS NTAPI USBPORT_GetUsbDescriptor(IN PUSBPORT_DEVICE_HANDLE DeviceHandle, IN PDEVICE_OBJECT FdoDevice, IN UCHAR Type, IN PUCHAR ConfigDesc, IN PULONG ConfigDescSize)
ULONG NTAPI USBPORT_AllocateUsbAddress(IN PDEVICE_OBJECT FdoDevice)
VOID NTAPI USBPORT_FreeUsbAddress(IN PDEVICE_OBJECT FdoDevice, IN USHORT DeviceAddress)
NTSTATUS NTAPI USBPORT_CreateDevice(IN OUT PUSB_DEVICE_HANDLE *pUsbdDeviceHandle, IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_DEVICE_HANDLE HubDeviceHandle, IN USHORT PortStatus, IN USHORT Port)
PUSB2_TT_EXTENSION NTAPI USBPORT_GetTt(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_DEVICE_HANDLE HubDeviceHandle, OUT PUSHORT OutPort, OUT PUSBPORT_DEVICE_HANDLE *OutHubDeviceHandle)
PUSBPORT_INTERFACE_HANDLE NTAPI USBPORT_GetInterfaceHandle(IN PUSBPORT_CONFIGURATION_HANDLE ConfigurationHandle, IN UCHAR InterfaceNumber)
PUSB_INTERFACE_DESCRIPTOR NTAPI USBPORT_ParseConfigurationDescriptor(IN PUSB_CONFIGURATION_DESCRIPTOR ConfigDescriptor, IN UCHAR InterfaceNumber, IN UCHAR Alternate, OUT PBOOLEAN HasAlternates)
NTSTATUS NTAPI USBPORT_HandleSelectInterface(IN PDEVICE_OBJECT FdoDevice, IN PIRP Irp, IN PURB Urb)
VOID NTAPI USBPORT_RemoveDeviceHandle(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_DEVICE_HANDLE DeviceHandle)
NTSTATUS NTAPI USBPORT_Initialize20Hub(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_DEVICE_HANDLE HubDeviceHandle, IN ULONG TtCount)
NTSTATUS NTAPI USBPORT_InitializeDevice(IN PUSBPORT_DEVICE_HANDLE DeviceHandle, IN PDEVICE_OBJECT FdoDevice)
ULONG NTAPI USBPORT_GetInterfaceLength(IN PUSB_INTERFACE_DESCRIPTOR iDescriptor, IN ULONG_PTR EndDescriptors)
NTSTATUS NTAPI USBPORT_RestoreDevice(IN PDEVICE_OBJECT FdoDevice, IN OUT PUSBPORT_DEVICE_HANDLE OldDeviceHandle, IN OUT PUSBPORT_DEVICE_HANDLE NewDeviceHandle)
VOID NTAPI USBPORT_AddDeviceHandle(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_DEVICE_HANDLE DeviceHandle)
BOOLEAN NTAPI USBPORT_DeviceHasTransfers(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_DEVICE_HANDLE DeviceHandle)
NTSTATUS NTAPI USBPORT_SendSetupPacket(IN PUSBPORT_DEVICE_HANDLE DeviceHandle, IN PDEVICE_OBJECT FdoDevice, IN PUSB_DEFAULT_PIPE_SETUP_PACKET SetupPacket, IN PVOID Buffer, IN ULONG Length, IN OUT PULONG TransferedLen, IN OUT PUSBD_STATUS pUSBDStatus)
VOID NTAPI USBPORT_AbortEndpoint(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_ENDPOINT Endpoint, IN PIRP Irp)
VOID NTAPI USBPORT_QueueTransferUrb(IN PURB Urb)
VOID NTAPI USBPORT_RemovePipeHandle(IN PUSBPORT_DEVICE_HANDLE DeviceHandle, IN PUSBPORT_PIPE_HANDLE PipeHandle)
VOID NTAPI USBPORT_AddPipeHandle(IN PUSBPORT_DEVICE_HANDLE DeviceHandle, IN PUSBPORT_PIPE_HANDLE PipeHandle)
VOID NTAPI USBPORT_ClosePipe(IN PUSBPORT_DEVICE_HANDLE DeviceHandle, IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_PIPE_HANDLE PipeHandle)
BOOLEAN NTAPI USBPORT_EndpointHasQueuedTransfers(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_ENDPOINT Endpoint, IN PULONG TransferCount)
NTSTATUS NTAPI USBPORT_ReopenPipe(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_ENDPOINT Endpoint)
MPSTATUS NTAPI MiniportOpenEndpoint(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_ENDPOINT Endpoint)
VOID NTAPI MiniportCloseEndpoint(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_ENDPOINT Endpoint)
NTSTATUS NTAPI USBPORT_OpenPipe(IN PDEVICE_OBJECT FdoDevice, IN PUSBPORT_DEVICE_HANDLE DeviceHandle, IN PUSBPORT_PIPE_HANDLE PipeHandle, IN OUT PUSBD_STATUS UsbdStatus)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define IsListEmpty(ListHead)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define RtlCompareMemory(s1, s2, l)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeReleaseSpinLock(sl, irql)
#define KeAcquireSpinLock(sl, irql)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
_Outptr_ PUSB_DEVICE_HANDLE * NewDeviceHandle
_Inout_ PUSB_DEVICE_HANDLE OldDeviceHandle
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE HubDeviceHandle
#define USBD_MARK_DEVICE_BUSY
_Inout_ PUSB_DEVICE_HANDLE DeviceHandle
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT PortStatus
_In_ PUSB_DEVICE_HANDLE _In_ ULONG TtCount
#define USBD_KEEP_DEVICE_DATA
_In_ PUSB_DEVICE_HANDLE _Out_ PUSHORT DeviceAddress
NTSYSAPI void WINAPI DbgBreakPoint(void)
#define LOW_REALTIME_PRIORITY
VOID NTAPI MmBuildMdlForNonPagedPool(IN PMDL Mdl)
#define ExFreePoolWithTag(_P, _T)
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
_Must_inspect_result_ _Out_ PNDIS_STATUS _Out_ PNDIS_HANDLE ConfigurationHandle
#define RTL_SIZEOF_THROUGH_FIELD(type, field)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define KeAcquireSpinLockAtDpcLevel(SpinLock)
#define KeReleaseSpinLockFromDpcLevel(SpinLock)
LONG NTAPI KeReleaseSemaphore(IN PKSEMAPHORE Semaphore, IN KPRIORITY Increment, IN LONG Adjustment, IN BOOLEAN Wait)
const KSDEVICE_DESCRIPTOR DeviceDescriptor
base of all file and directory entries
struct _LIST_ENTRY * Flink
struct _URB_CONTROL_TRANSFER UrbControlTransfer
struct _URB_HEADER UrbHeader
PDEVICE_OBJECT RootHubPdo
ULONG Bandwidth[USB2_FRAMES]
PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor
LIST_ENTRY InterfaceHandleList
USHORT TotalMaxPacketSize
PUSBPORT_DEVICE_HANDLE DeviceHandle
KSPIN_LOCK EndpointSpinLock
USBPORT_ENDPOINT_PROPERTIES EndpointProperties
USBPORT_PIPE_HANDLE PipeHandle[1]
USB_INTERFACE_DESCRIPTOR InterfaceDescriptor
union _USB_DEFAULT_PIPE_SETUP_PACKET::_wValue wValue
BM_REQUEST_TYPE bmRequestType
static VOID ErrorExit(LPTSTR lpszMessage)
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_DEVICE_NOT_CONNECTED
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_DEVICE_DATA_ERROR
#define STATUS_INSUFFICIENT_RESOURCES
#define BMREQUEST_TO_INTERFACE
struct _USB_CONFIGURATION_DESCRIPTOR * PUSB_CONFIGURATION_DESCRIPTOR
#define USB_REQUEST_GET_DESCRIPTOR
#define USB_ENDPOINT_DESCRIPTOR_TYPE
struct _USB_INTERFACE_DESCRIPTOR * PUSB_INTERFACE_DESCRIPTOR
#define USB_DEVICE_DESCRIPTOR_TYPE
#define BMREQUEST_TO_OTHER
struct _USB_DEVICE_DESCRIPTOR USB_DEVICE_DESCRIPTOR
#define BMREQUEST_HOST_TO_DEVICE
#define USB_REQUEST_SET_CONFIGURATION
#define BMREQUEST_STANDARD
#define USB_DEVICE_CLASS_HUB
struct _USB_ENDPOINT_DESCRIPTOR * PUSB_ENDPOINT_DESCRIPTOR
#define USB_REQUEST_SET_ADDRESS
#define USB_ENDPOINT_TYPE_MASK
#define USB_INTERFACE_DESCRIPTOR_TYPE
#define BMREQUEST_DEVICE_TO_HOST
#define USB_REQUEST_SET_INTERFACE
#define USB_PORT_STATUS_HIGH_SPEED
#define USB_PORT_STATUS_LOW_SPEED
#define USB_REQUEST_RESET_TT
#define USB_REQUEST_CLEAR_TT_BUFFER
VOID NTAPI USB2_InitTT(IN PUSB2_HC_EXTENSION HcExtension, IN PUSB2_TT Tt)
VOID NTAPI USBPORT_UpdateAllocatedBwTt(IN PUSB2_TT_EXTENSION TtExtension)
struct _USBD_INTERFACE_INFORMATION * PUSBD_INTERFACE_INFORMATION
struct _USBD_PIPE_INFORMATION USBD_PIPE_INFORMATION
#define USB_DEFAULT_DEVICE_ADDRESS
#define USBD_STATUS_SET_CONFIG_FAILED
struct _USBD_INTERFACE_INFORMATION USBD_INTERFACE_INFORMATION
#define USBD_STATUS_INVALID_PIPE_FLAGS
#define USBD_ERROR(Status)
#define USBD_STATUS_SUCCESS
PVOID USBD_INTERFACE_HANDLE
#define USBD_PF_CHANGE_MAX_PACKET
#define USB_DEFAULT_MAX_PACKET
#define URB_FUNCTION_CONTROL_TRANSFER
#define USBD_TRANSFER_DIRECTION
#define USBD_STATUS_INSUFFICIENT_RESOURCES
#define USBD_SHORT_TRANSFER_OK
#define USBD_STATUS_INTERFACE_NOT_FOUND
#define USBD_SUCCESS(Status)
#define USBD_STATUS_INVALID_CONFIGURATION_DESCRIPTOR
#define USBD_PF_VALID_MASK
#define USBD_STATUS_BUFFER_TOO_SMALL
_In_ PVOID _In_ LONG InterfaceNumber
#define USBPORT_ENDPOINT_ACTIVE
#define USB_MINIPORT_FLAGS_USB2
#define USBPORT_ENDPOINT_RUN
#define TOTAL_USB11_BUS_BANDWIDTH
USBD_STATUS NTAPI USBPORT_AllocateTransfer(IN PDEVICE_OBJECT FdoDevice, IN PURB Urb, IN PUSBPORT_DEVICE_HANDLE DeviceHandle, IN PIRP Irp, IN PRKEVENT Event)
VOID NTAPI USBPORT_FlushMapTransfers(IN PDEVICE_OBJECT FdoDevice)
NTSTATUS NTAPI USBPORT_Wait(IN PVOID MiniPortExtension, IN ULONG Milliseconds)
NTSTATUS NTAPI USBPORT_USBDStatusToNtStatus(IN PURB Urb, IN USBD_STATUS USBDStatus)
#define PIPE_HANDLE_FLAG_CLOSED
struct _USBPORT_PIPE_HANDLE USBPORT_PIPE_HANDLE
#define ENDPOINT_FLAG_ABORTING
#define PIPE_HANDLE_FLAG_NULL_PACKET_SIZE
#define DEVICE_HANDLE_FLAG_REMOVED
#define USB2_TT_EXTENSION_FLAG_DELETED
#define DEVICE_HANDLE_FLAG_ROOTHUB
USBD_STATUS * PUSBD_STATUS
#define DEVICE_HANDLE_FLAG_USB2HUB
#define ENDPOINT_FLAG_NUKE
#define USBD_FLAG_ALLOCATED_MDL
static int Link(const char **args)
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
_In_ WDFUSBINTERFACE _In_ UCHAR _Out_opt_ PWDF_USB_PIPE_INFORMATION PipeInfo
_In_ WDFUSBINTERFACE _In_ UCHAR _Out_ PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor
_Must_inspect_result_ _In_ WDFUSBDEVICE _Out_writes_bytes_to_opt_ ConfigDescriptorLength PVOID ConfigDescriptor
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _In_ PWDF_USB_CONTROL_SETUP_PACKET SetupPacket
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
_Must_inspect_result_ _In_ ULONG Flags
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql