29#include "FxUsbDevice.tmh"
32#if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
33#define UCHAR_MAX (0xff)
67 __in USBD_HANDLE USBDHandle
104#if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
107#elif (FX_CORE_MODE == FX_CORE_USER_MODE)
128#if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
185 __in USBD_HANDLE USBDHandle
278#if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
284#elif (FX_CORE_MODE == FX_CORE_USER_MODE)
324 if (pDescriptor ==
NULL) {
343 __in USBD_HANDLE USBDHandle,
348 m_USBDHandle(USBDHandle)
397#if (FX_CORE_MODE == FX_CORE_USER_MODE)
410#if ((FX_CORE_MODE)==(FX_CORE_KERNEL_MODE))
419#if (FX_CORE_MODE == FX_CORE_USER_MODE)
421 IWudfDeviceStack* devstack =
NULL;
424 devstack =
device->GetDeviceStackInterface();
598#define STOP_TAG (PVOID) 'pots'
607 ULONG iPipe, iInterface;
624 AcquireInterfaceIterationLock();
689 ReleaseInterfaceIterationLock();
700 ULONG iPipe, iInterface;
717 AcquireInterfaceIterationLock();
787 ReleaseInterfaceIterationLock();
820 ULONG iPipe, intfIndex;
827 AcquireInterfaceIterationLock();
893 ReleaseInterfaceIterationLock();
905 UCHAR iInterface, numFound;
928 "Validation of the config descriptor failed due to a bad common descriptor header, %!STATUS!",
956 "Validation of interface descriptors in config descriptor failed, %!STATUS!",
983 "Could not allocate memory for %d interfaces, %!STATUS!",
1007 while (pInterfaceDescriptor !=
NULL &&
1008 iInterface < m_ConfigDescriptor->bNumInterfaces) {
1014 pInterfaceDescriptor->bInterfaceNumber) ==
FALSE) {
1020 pInterfaceDescriptor);
1026 "Could not allocate memory for interface object #%d, %!STATUS!",
1047#if (FX_CORE_MODE == FX_CORE_USER_MODE)
1054 pInterfaceDescriptor->bNumEndpoints);
1069 pInterfaceDescriptor->bLength),
1097 "Config descriptor indicated there were %d interfaces, but did not "
1098 "find any interface descriptors in config descriptor %p, %!STATUS!",
1104 "Config descriptor indicated there were 0 interfaces, but an interface "
1105 "descriptor was found");
1112 "Config descriptor indicated there were %d interfaces, only found "
1144 status = syncRequest.Initialize();
1147 "Failed to initialize FxSyncRequest");
1206#if (FX_CORE_MODE == FX_CORE_USER_MODE)
1212#elif (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
1241 "Failed to initialize FxSyncRequest");
1292 if (*ConfigDescriptorLength < m_ConfigDescriptor->wTotalLength) {
1328 ULONG numInterfaces;
1333 configurationDescriptor =
Params->Types.Descriptor.ConfigurationDescriptor;
1334 interfaceDescriptors =
Params->Types.Descriptor.InterfaceDescriptors;
1335 numInterfaces =
Params->Types.Descriptor.NumInterfaceDescriptors;
1337 for (
i = 0;
i < numInterfaces;
i++) {
1338 if (interfaceDescriptors[
i] ==
NULL) {
1346 status = RtlULongAdd(numInterfaces, 1, &
size);
1359 if (pInterfaces ==
NULL) {
1364 "Could not allocate array of USBD_INTERFACE_LIST_ENTRY, %!STATUS!",
1372 for (
i = 0;
i < numInterfaces;
i++) {
1376 if (configurationDescriptor ==
NULL) {
1392 configurationDescriptor,
1477 if (NumConfiguredInterfaces !=
NULL) {
1478 *NumConfiguredInterfaces = 0;
1487 "Failed to initialize FxSyncRequest");
1517 if (pPipeInfo ==
NULL) {
1521 "Could not internal allocate tracking info for selecting a config on "
1539 pCur = (
PUCHAR) &Urb->UrbSelectConfiguration.Interface;
1540 pEnd = ((
PUCHAR) Urb) + Urb->UrbSelectConfiguration.Hdr.Length;
1551 "WDFUSBDEVICE supports a maximum of %d pipes per interface, "
1552 "USBD_INTERFACE_INFORMATION %p specified %d, %!STATUS!",
1562 "Could not find an instance of an interface descriptor with "
1563 "InterfaceNumber %d, %!STATUS!",
1574 if (numPipes > maxNumPipes) {
1575 maxNumPipes = (
USHORT) numPipes;
1596 if (ppPipes ==
NULL) {
1600 "Could not allocate memory for Pipes "
1601 "InterfaceNumber %d, %!STATUS!",
1613 pPipeInfo[intfIndex].
Pipes = ppPipes;
1614 pPipeInfo[intfIndex].
NumPipes = numPipes;
1616 for (iPipe = 0; iPipe < numPipes; iPipe++) {
1620 if (ppPipes[iPipe] ==
NULL) {
1624 "Could not allocate a pipe object, %!STATUS!",
status);
1628 pPipe = ppPipes[iPipe];
1633 "Could not Init the pipe object, %!STATUS!",
status);
1641 "Could not commit the pipe object, %!STATUS!",
status);
1678 if (pSelectUrb ==
NULL) {
1682 "Could not allocate a select interface URB, %!STATUS!",
status);
1703 m_ConfigHandle = Urb->UrbSelectConfiguration.ConfigurationHandle;
1708 pIface = &Urb->UrbSelectConfiguration.Interface;
1745 pCur = (
PUCHAR) &Urb->UrbSelectConfiguration.Interface;
1747 pEnd = ((
PUCHAR) Urb) + Urb->UrbSelectConfiguration.Hdr.Length;
1755#pragma prefast(suppress: __WARNING_UNUSED_POINTER_ASSIGNMENT, "pIface is used in the for loop in many places. It looks like a false positive")
1774 irp =
request.m_TrueRequest->GetSubmitFxIrp();
1777 request.m_TrueRequest->ClearFieldsForReuse();
1787 "USB core failed Select Interface URB, %!STATUS!",
1823 if (NumConfiguredInterfaces !=
NULL) {
1824 *NumConfiguredInterfaces = intfIndex;
1830 "USB core failed Select Configuration, %!STATUS!",
status);
1834 if (pSelectUrb !=
NULL) {
1839 if (pPipeInfo !=
NULL) {
1848 if (pPipeInfo[intfIndex].Pipes !=
NULL) {
1852 for (iPipe = 0; iPipe < pPipeInfo[intfIndex].
NumPipes; iPipe++) {
1853 if (pPipeInfo[intfIndex].Pipes[iPipe] !=
NULL) {
1855 pPipeInfo[intfIndex].
Pipes[iPipe] =
NULL;
1893 "Failed to initialize FxSyncRequest");
1909#pragma prefast(suppress: __WARNING_BUFFER_OVERFLOW, "this annotation change in usb.h is communicated to usb team");
1911#pragma prefast(suppress: __WARNING_BUFFER_OVERFLOW, "this annotation change in usb.h is communicated to usb team");
1942 status = RtlULongAdd(NumInterfaces, 1, &
size);
1952 for (
i = 0;
i < NumInterfaces;
i++) {
1953 if (InterfaceDescriptors[
i] ==
NULL) {
1964 if (pInterfaces ==
NULL) {
1969 "Could not allocate array of USBD_INTERFACE_LIST_ENTRY, %!STATUS!",
1977 for (
i = 0;
i < NumInterfaces;
i++) {
1981 if (ConfigurationDescriptor ==
NULL) {
1986 ConfigurationDescriptor,
2065 AcquireInterfaceIterationLock();
2068 for (iPipe = 0; iPipe <
UsbInterface->m_NumberOfConfiguredPipes; iPipe++) {
2084 for (iPipe = 0; iPipe <
UsbInterface->m_NumberOfConfiguredPipes; iPipe++) {
2091 ReleaseInterfaceIterationLock();
2100 ULONG iInterface, iPipe;
2155 "Urb must be parented to FxDevice or an IoAllocated Request");
2189 "USBDEVICE Must have been created with Client Contract Version Info, %!STATUS!",
2273 "Urb must be parented to FxDevice or IoAllocated Request");
2307 "USBDEVICE Must have been created with Client Contract Version Info, %!STATUS!",
2397 isObjectDisposedOnRemove =
TRUE;
2404 if (
request->IsAllocatedFromIo()) {
2406 isObjectDisposedOnRemove =
TRUE;
2430 return isObjectDisposedOnRemove;
2465 if (
Request->IsAllocatedFromIo()) {
struct outqueuenode * head
MdDeviceObject __inline GetDeviceObject(VOID)
virtual VOID Stop(__in WDF_IO_TARGET_SENT_IO_ACTION Action)
_Must_inspect_result_ NTSTATUS SubmitSync(__in FxRequestBase *Request, __in_opt PWDF_REQUEST_SEND_OPTIONS Options=NULL, __out_opt PULONG Action=NULL)
_Must_inspect_result_ NTSTATUS SubmitSyncRequestIgnoreTargetState(__in FxRequestBase *Request, __in_opt PWDF_REQUEST_SEND_OPTIONS RequestOptions)
_Must_inspect_result_ NTSTATUS Init(__in CfxDeviceBase *Device)
virtual BOOLEAN Dispose(VOID)
WDF_IO_TARGET_STATE m_State
VOID CompletePendedRequest(__in FxRequestBase *Request)
VOID CompletePendedRequestList(__in PLIST_ENTRY RequestListHead)
_Must_inspect_result_ NTSTATUS FormatInternalIoctlOthersRequest(__in FxRequestBase *Request, __in ULONG Ioctl, __in FxRequestBuffer *Buffers)
static VOID _CancelSentRequests(__in PSINGLE_LIST_ENTRY RequestListHead)
VOID SubmitPendedRequest(__in FxRequestBase *Request)
_Must_inspect_result_ NTSTATUS FormatIoctlRequest(__in FxRequestBase *Request, __in ULONG Ioctl, __in BOOLEAN Internal, __in FxRequestBuffer *InputBuffer, __in FxRequestBuffer *OutputBuffer, __in_opt FxFileObject *FileObject=NULL)
virtual VOID Purge(__in WDF_IO_TARGET_PURGE_IO_ACTION Action)
virtual _Must_inspect_result_ NTSTATUS Start(VOID)
virtual VOID WaitForSentIoToComplete(VOID)
VOID Reuse(__in NTSTATUS Status=STATUS_SUCCESS)
virtual PVOID GetBuffer(VOID)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
CfxDeviceBase * m_DeviceBase
__drv_restoresIRQL KIRQL __in BOOLEAN Unlock
virtual BOOLEAN Dispose(VOID)
VOID DeleteFromFailedCreate(VOID)
VOID MarkDisposeOverride(__in FxObjectLockState State=ObjectLock)
_Must_inspect_result_ NTSTATUS Commit(__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out_opt WDFOBJECT *ObjectHandle, __in_opt FxObject *Parent=NULL, __in BOOLEAN AssignDriverAsDefaultParent=TRUE)
static __inline FxRequestBase * _FromListEntry(__in PLIST_ENTRY Entry)
__inline FxIoTarget * GetTarget(VOID)
_Must_inspect_result_ NTSTATUS CreateInterfaces(VOID)
virtual VOID Purge(__in WDF_IO_TARGET_PURGE_IO_ACTION Action)
virtual BOOLEAN Dispose(VOID)
WINUSB_INTERFACE_HANDLE m_WinUsbHandle
VOID PipesGotoRemoveState(__in BOOLEAN ForceRemovePipes)
USBD_PIPE_HANDLE m_ControlPipe
VOID GetInformation(__out PWDF_USB_DEVICE_INFORMATION Information)
_Must_inspect_result_ NTSTATUS SelectConfig(__in PWDF_OBJECT_ATTRIBUTES PipesAttributes, __in PURB Urb, __in FX_URB_TYPE FxUrbType, __out_opt PUCHAR NumConfiguredInterfaces)
virtual VOID Stop(__in WDF_IO_TARGET_SENT_IO_ACTION Action)
VOID CleanupInterfacePipesAndDelete(__in FxUsbInterface *UsbInterface)
USB_DEVICE_DESCRIPTOR m_DeviceDescriptor
_Must_inspect_result_ NTSTATUS FormatCycleRequest(__in FxRequestBase *Request)
virtual _Must_inspect_result_ NTSTATUS Start(VOID)
_Must_inspect_result_ NTSTATUS IsConnected(VOID)
PINTERFACE_DEREFERENCE m_BusInterfaceDereference
PUSB_BUSIFFN_QUERY_BUS_TIME m_QueryBusTime
USBD_VERSION_INFORMATION m_UsbdVersionInformation
_Must_inspect_result_ NTSTATUS GetPortStatus(__out PULONG PortStatus)
IWudfFile * m_pHostTargetFile
VOID RemoveDeletedInterface(__in FxUsbInterface *Interface)
ULONG GetDefaultMaxTransferSize(VOID)
BOOLEAN IsObjectDisposedOnRemove(__in FxObject *Object)
FxUsbDevice(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
static VOID _CleanupPipesRequests(__in PLIST_ENTRY PendHead, __in PSINGLE_LIST_ENTRY SentHead)
__checkReturn NTSTATUS CreateUrb(__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out WDFMEMORY *UrbMemory, __deref_opt_out_bcount(sizeof(URB)) PURB *Urb)
_Must_inspect_result_ NTSTATUS CyclePort(VOID)
FxUsbInterface * GetInterfaceFromIndex(__in UCHAR InterfaceIndex)
_Must_inspect_result_ NTSTATUS GetConfigDescriptor(__out PVOID ConfigDescriptor, __inout PUSHORT ConfigDescriptorLength)
PUSB_CONFIGURATION_DESCRIPTOR m_ConfigDescriptor
_Must_inspect_result_ NTSTATUS SelectConfigInterfaces(__in PWDF_OBJECT_ATTRIBUTES PipesAttributes, __in PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, __in_ecount(NumInterfaces) PUSB_INTERFACE_DESCRIPTOR *InterfaceDescriptors, __in ULONG NumInterfaces)
ULONG m_HcdPortCapabilities
__checkReturn NTSTATUS CreateIsochUrb(__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG NumberOfIsochPackets, __out WDFMEMORY *UrbMemory, __deref_opt_out_bcount(GET_ISOCH_URB_SIZE(NumberOfIsochPackets)) PURB *Urb)
PVOID m_BusInterfaceContext
_Must_inspect_result_ NTSTATUS GetInterfaceNumberFromInterface(__in WDFUSBINTERFACE UsbInterface, __out PUCHAR InterfaceNumber)
FX_URB_TYPE GetFxUrbTypeForRequest(__in FxRequestBase *Request)
_Must_inspect_result_ NTSTATUS Deconfig(VOID)
FxUsbInterface ** m_Interfaces
FxUsbInterface * GetInterfaceFromNumber(__in UCHAR InterfaceNumber)
_Must_inspect_result_ NTSTATUS SelectConfigDescriptor(__in PWDF_OBJECT_ATTRIBUTES PipeAttributes, __in PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS Params)
USBD_CONFIGURATION_HANDLE m_ConfigHandle
BOOLEAN m_MismatchedInterfacesInConfigDescriptor
FxUsbPipe ** m_ConfiguredPipes
VOID FormatSelectSettingUrb(__in_bcount(GET_SELECT_INTERFACE_REQUEST_SIZE(NumEndpoints)) PURB Urb, __in USHORT NumEndpoints, __in UCHAR SettingNumber)
VOID CleanUpAndDelete(__in BOOLEAN ClearDestroyCallback)
VOID SetConfiguredPipes(__in FxUsbPipe **ppPipes)
UCHAR GetInterfaceNumber(VOID)
BOOLEAN IsInterfaceConfigured(VOID)
UCHAR m_NumberOfConfiguredPipes
VOID SetInfo(__in PUSBD_INTERFACE_INFORMATION Interface)
VOID SetNumConfiguredPipes(__in UCHAR NumberOfPipes)
VOID GotoPurgeState(__in WDF_IO_TARGET_PURGE_IO_ACTION Action, __in PLIST_ENTRY PendedRequestListHead, __in PSINGLE_LIST_ENTRY SentRequestListHead, __out PBOOLEAN Wait, __in BOOLEAN LockSelf)
virtual VOID GotoStopState(__in WDF_IO_TARGET_SENT_IO_ACTION Action, __in PSINGLE_LIST_ENTRY SentRequestListHead, __out PBOOLEAN Wait, __in BOOLEAN LockSelf)
virtual VOID GotoRemoveState(__in WDF_IO_TARGET_STATE NewState, __in PLIST_ENTRY PendedRequestListHead, __in PSINGLE_LIST_ENTRY SentRequestListHead, __in BOOLEAN Lock, __out PBOOLEAN Wait)
virtual VOID WaitForSentIoToComplete(VOID)
virtual _Must_inspect_result_ NTSTATUS GotoStartState(__in PLIST_ENTRY RequestListHead, __in BOOLEAN Lock=TRUE)
virtual BOOLEAN Dispose(VOID)
FxUsbUrb(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USBD_HANDLE USBDHandle, __in_bcount(BufferSize) PVOID Buffer, __in size_t BufferSize)
virtual size_t GetBufferSize(VOID)=0
virtual PVOID GetBuffer(VOID)=0
static __inline VOID MxUnlockPages(__in PMDL Mdl)
static __inline KIRQL MxGetCurrentIrql()
#define NT_SUCCESS(StatCode)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *)&pDevice, &pFxDriverGlobals)
PFX_DRIVER_GLOBALS pFxDriverGlobals
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), Fdo, FX_TYPE_DEVICE,(PVOID *)&pFdo)
__inline BOOLEAN FxObjectCheckType(__in FxObject *Object, __in WDFTYPE Type)
#define FxPointerNotNull(FxDriverGlobals, Ptr)
VOID __inline FxMdlFree(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PMDL Mdl)
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
#define FX_REQUEST_NUM_OTHER_PARAMS
@ FX_RCT_USB_CONTROL_REQUEST
@ FX_RCT_USB_STRING_REQUEST
@ FX_TYPE_IO_TARGET_USB_DEVICE
enum _FX_URB_TYPE FX_URB_TYPE
FxUsbInterface * pUsbInterface
return pUsbInterface GetInterfaceNumber()
_Must_inspect_result_ NTSTATUS __inline FxValidateObjectAttributesForParentHandle(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
_Must_inspect_result_ NTSTATUS FxValidateObjectAttributes(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT PortStatus
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
#define _Must_inspect_result_
#define __deref_opt_out_bcount(size)
#define STATUS_DEVICE_DOES_NOT_EXIST
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_BUFFER_OVERFLOW
#define TRACE_LEVEL_WARNING
#define TRACE_LEVEL_ERROR
virtual VOID ReleaseAndRestore(__in FxRequestBase *Request)
WDF_REQUEST_COMPLETION_PARAMS m_CompletionParams
IFxMemory * m_RequestMemory
_URB_CONTROL_TRANSFER * m_Urb
~FxUsbDeviceControlContext(VOID)
virtual VOID ReleaseAndRestore(__in FxRequestBase *Request)
FxUsbDeviceControlContext(__in FX_URB_TYPE FxUrbType)
USBD_STATUS GetUsbdStatus(VOID)
_URB_CONTROL_TRANSFER m_UrbLegacy
virtual VOID CopyParameters(__in FxRequestBase *Request)
__checkReturn NTSTATUS AllocateUrb(__in USBD_HANDLE USBDHandle)
virtual VOID Dispose(VOID)
virtual VOID Dispose(VOID)
FxUsbDeviceStringContext(__in FX_URB_TYPE FxUrbType)
VOID SetUrbInfo(__in UCHAR StringIndex, __in USHORT LangID)
PUSB_STRING_DESCRIPTOR m_StringDescriptor
ULONG m_StringDescriptorLength
virtual VOID CopyParameters(__in FxRequestBase *Request)
_Must_inspect_result_ NTSTATUS AllocateDescriptor(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in size_t BufferSize)
USBD_STATUS GetUsbdStatus(VOID)
~FxUsbDeviceStringContext(VOID)
__checkReturn NTSTATUS AllocateUrb(__in USBD_HANDLE USBDHandle)
_URB_CONTROL_DESCRIPTOR_REQUEST m_UrbLegacy
_URB_CONTROL_DESCRIPTOR_REQUEST * m_Urb
VOID SetUsbType(__in WDF_USB_REQUEST_TYPE Type)
WDF_USB_REQUEST_COMPLETION_PARAMS m_UsbParameters
virtual VOID CopyParameters(__in FxRequestBase *Request)
struct _SINGLE_LIST_ENTRY * Next
struct _UMURB_CONTROL_TRANSFER UmUrbControlTransfer
struct _UMURB_DESCRIPTOR_REQUEST UmUrbDescriptorRequest
ULONG TransferBufferLength
ULONG TransferBufferLength
struct _URB_SELECT_INTERFACE UrbSelectInterface
PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor
struct _WDF_USB_REQUEST_COMPLETION_PARAMS::@3903::@3905 DeviceControlTransfer
union _WDF_USB_REQUEST_COMPLETION_PARAMS::@3903 Parameters
struct _WDF_USB_REQUEST_COMPLETION_PARAMS::@3903::@3904 DeviceString
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_DEVICE_DATA_ERROR
#define STATUS_INSUFFICIENT_RESOURCES
struct _USB_STRING_DESCRIPTOR * PUSB_STRING_DESCRIPTOR
struct _USB_INTERFACE_DESCRIPTOR * PUSB_INTERFACE_DESCRIPTOR
#define USB_STRING_DESCRIPTOR_TYPE
struct _USB_STRING_DESCRIPTOR USB_STRING_DESCRIPTOR
#define USB_INTERFACE_DESCRIPTOR_TYPE
struct _USB_COMMON_DESCRIPTOR USB_COMMON_DESCRIPTOR
struct _USBD_INTERFACE_INFORMATION * PUSBD_INTERFACE_INFORMATION
#define USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE
#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE
#define UsbBuildSelectConfigurationRequest(urb, length, configurationDescriptor)
#define GET_SELECT_INTERFACE_REQUEST_SIZE(totalPipes)
struct _USBD_INTERFACE_LIST_ENTRY * PUSBD_INTERFACE_LIST_ENTRY
#define GET_ISO_URB_SIZE(n)
_In_ PVOID _In_ LONG InterfaceNumber
#define IOCTL_INTERNAL_USB_CYCLE_PORT
#define USBD_PORT_ENABLED
#define USBD_PORT_CONNECTED
#define IOCTL_INTERNAL_USB_GET_PORT_STATUS
NTSTATUS USBD_UrbAllocate(_In_ USBD_HANDLE USBDHandle, _Outptr_result_bytebuffer_(sizeof(URB)) PURB *Urb)
NTSTATUS USBD_IsochUrbAllocate(_In_ USBD_HANDLE USBDHandle, _In_ ULONG NumberOfIsochPacket, _Outptr_result_bytebuffer_(sizeof(struct _URB_ISOCH_TRANSFER)+(NumberOfIsochPackets *sizeof(USBD_ISO_PACKET_DESCRIPTOR)) - sizeof(USBD_ISO_PACKET_DESCRIPTOR)) PURB *Urb)
VOID USBD_CloseHandle(_In_ USBD_HANDLE USBDHandle)
VOID USBD_UrbFree(_In_ USBD_HANDLE USBDHandle, _In_ PURB Urb)
PUSB_COMMON_DESCRIPTOR FxUsbFindDescriptorType(__in PVOID Buffer, __in size_t BufferLength, __in PVOID Start, __in LONG DescriptorType)
NTSTATUS FxUsbValidateDescriptorType(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PUSB_CONFIGURATION_DESCRIPTOR ConfigDescriptor, __in PVOID Start, __in PVOID End, __in LONG DescriptorType, __in size_t SizeToValidate, __in FxUsbValidateDescriptorOp Op, __in ULONG MaximumNumDescriptorsToValidate)
NTSTATUS FxUsbValidateConfigDescriptorHeaders(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PUSB_CONFIGURATION_DESCRIPTOR ConfigDescriptor, __in size_t ConfigDescriptorLength)
PURB FxUsbCreateConfigRequest(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PUSB_CONFIGURATION_DESCRIPTOR ConfigDesc, __in PUSBD_INTERFACE_LIST_ENTRY InterfaceList, __in ULONG DefaultMaxPacketSize)
VOID FxFormatUsbRequest(__in FxRequestBase *Request, __in PURB Urb, __in FX_URB_TYPE FxUrbType, __drv_when(FxUrbType==FxUrbTypeUsbdAllocated, __in) __drv_when(FxUrbType !=FxUrbTypeUsbdAllocated, __in_opt) USBD_HANDLE UsbdHandle)
@ FxUsbValidateDescriptorOpAtLeast
BOOLEAN __inline FxBitArraySet(__inout_xcount((BitNumber/sizeof(UCHAR))+1) PUCHAR BitArray, __in UCHAR BitNumber)
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
FORCEINLINE LONGLONG WDF_REL_TIMEOUT_IN_SEC(_In_ ULONGLONG Time)
#define WDF_PTR_ADD_OFFSET(_ptr, _offset)
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
enum _WDF_IO_TARGET_PURGE_IO_ACTION WDF_IO_TARGET_PURGE_IO_ACTION
@ WdfIoTargetLeaveSentIoPending
enum _WDF_IO_TARGET_SENT_IO_ACTION WDF_IO_TARGET_SENT_IO_ACTION
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
FORCEINLINE VOID WDF_REQUEST_SEND_OPTIONS_INIT(_Out_ PWDF_REQUEST_SEND_OPTIONS Options, _In_ ULONG Flags)
@ WDF_REQUEST_SEND_OPTION_IGNORE_TARGET_STATE
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
FORCEINLINE VOID WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT(_Inout_ PWDF_REQUEST_SEND_OPTIONS Options, _In_ LONGLONG Timeout)
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
#define STATUS_WDF_PARENT_NOT_SPECIFIED
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
#define WDF_NO_OBJECT_ATTRIBUTES
_In_ WDFUSBINTERFACE UsbInterface
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_ WDFREQUEST _In_ WDFMEMORY UrbMemory
_Must_inspect_result_ _In_ WDFUSBDEVICE _Out_writes_bytes_to_opt_ ConfigDescriptorLength PVOID ConfigDescriptor
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ ULONG NumberOfIsochPackets
_Must_inspect_result_ _In_ WDFUSBDEVICE _Out_writes_bytes_to_opt_ ConfigDescriptorLength PVOID _Inout_ PUSHORT ConfigDescriptorLength
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR StringIndex
@ WdfUsbRequestTypeDeviceString
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
_In_ WDFUSBDEVICE _In_ UCHAR InterfaceIndex
_Must_inspect_result_ _In_ WDFUSBINTERFACE _In_opt_ PWDF_OBJECT_ATTRIBUTES PipesAttributes
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList