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");
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()) {
__drv_restoresIRQL KIRQL __in BOOLEAN Unlock
_URB_CONTROL_DESCRIPTOR_REQUEST m_UrbLegacy
IFxMemory * m_RequestMemory
FORCEINLINE VOID WDF_REQUEST_SEND_OPTIONS_INIT(_Out_ PWDF_REQUEST_SEND_OPTIONS Options, _In_ ULONG Flags)
#define STATUS_DEVICE_DOES_NOT_EXIST
_Must_inspect_result_ NTSTATUS CreateInterfaces(VOID)
enum _WDF_IO_TARGET_PURGE_IO_ACTION WDF_IO_TARGET_PURGE_IO_ACTION
struct _UMURB_CONTROL_TRANSFER UmUrbControlTransfer
struct _WDF_USB_REQUEST_COMPLETION_PARAMS::@3706::@3708 DeviceControlTransfer
FX_URB_TYPE GetFxUrbTypeForRequest(__in FxRequestBase *Request)
#define _Must_inspect_result_
_In_ WDFUSBDEVICE _In_ UCHAR InterfaceIndex
FxUsbInterface * GetInterfaceFromIndex(__in UCHAR InterfaceIndex)
virtual VOID CopyParameters(__in FxRequestBase *Request)
#define UsbBuildSelectConfigurationRequest(urb, length, configurationDescriptor)
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ NTSTATUS GetConfigDescriptor(__out PVOID ConfigDescriptor, __inout PUSHORT ConfigDescriptorLength)
VOID CompletePendedRequestList(__in PLIST_ENTRY RequestListHead)
_URB_CONTROL_DESCRIPTOR_REQUEST * m_Urb
MdDeviceObject __inline GetDeviceObject(VOID)
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
_Must_inspect_result_ NTSTATUS Commit(__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out_opt WDFOBJECT *ObjectHandle, __in_opt FxObject *Parent=NULL, __in BOOLEAN AssignDriverAsDefaultParent=TRUE)
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
__checkReturn NTSTATUS CreateUrb(__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out WDFMEMORY *UrbMemory, __deref_opt_out_bcount(sizeof(URB)) PURB *Urb)
VOID SetUrbInfo(__in UCHAR StringIndex, __in USHORT LangID)
#define WDF_PTR_ADD_OFFSET(_ptr, _offset)
struct outqueuenode * head
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)
#define USBD_PORT_ENABLED
#define STATUS_INVALID_PARAMETER
_Must_inspect_result_ NTSTATUS SelectConfig(__in PWDF_OBJECT_ATTRIBUTES PipesAttributes, __in PURB Urb, __in FX_URB_TYPE FxUrbType, __out_opt PUCHAR NumConfiguredInterfaces)
virtual BOOLEAN Dispose(VOID)
virtual _Must_inspect_result_ NTSTATUS GotoStartState(__in PLIST_ENTRY RequestListHead, __in BOOLEAN Lock=TRUE)
return pUsbInterface GetInterfaceNumber()
__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)
struct _USBD_INTERFACE_LIST_ENTRY * PUSBD_INTERFACE_LIST_ENTRY
_Must_inspect_result_ NTSTATUS FormatInternalIoctlOthersRequest(__in FxRequestBase *Request, __in ULONG Ioctl, __in FxRequestBuffer *Buffers)
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
_Must_inspect_result_ _In_ WDFUSBDEVICE _Out_writes_bytes_to_opt_ ConfigDescriptorLength PVOID _Inout_ PUSHORT ConfigDescriptorLength
#define GET_SELECT_INTERFACE_REQUEST_SIZE(totalPipes)
struct _USBD_INTERFACE_INFORMATION * PUSBD_INTERFACE_INFORMATION
#define FX_REQUEST_NUM_OTHER_PARAMS
struct _USB_COMMON_DESCRIPTOR USB_COMMON_DESCRIPTOR
#define STATUS_INVALID_DEVICE_REQUEST
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR StringIndex
FxUsbPipe ** m_ConfiguredPipes
BOOLEAN __inline FxBitArraySet(__inout_xcount((BitNumber/sizeof(UCHAR))+1) PUCHAR BitArray, __in UCHAR BitNumber)
_Must_inspect_result_ NTSTATUS SubmitSync(__in FxRequestBase *Request, __in_opt PWDF_REQUEST_SEND_OPTIONS Options=NULL, __out_opt PULONG Action=NULL)
VOID SetNumConfiguredPipes(__in UCHAR NumberOfPipes)
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), Fdo, FX_TYPE_DEVICE,(PVOID *)&pFdo)
_Must_inspect_result_ NTSTATUS GetPortStatus(__out PULONG PortStatus)
VOID SetConfiguredPipes(__in FxUsbPipe **ppPipes)
struct _USB_INTERFACE_DESCRIPTOR * PUSB_INTERFACE_DESCRIPTOR
ULONG GetDefaultMaxTransferSize(VOID)
VOID CompletePendedRequest(__in FxRequestBase *Request)
virtual VOID Purge(__in WDF_IO_TARGET_PURGE_IO_ACTION Action)
#define USB_STRING_DESCRIPTOR_TYPE
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
PUSB_COMMON_DESCRIPTOR FxUsbFindDescriptorType(__in PVOID Buffer, __in size_t BufferLength, __in PVOID Start, __in LONG DescriptorType)
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
GLenum GLenum GLsizei const GLuint GLboolean enabled
enum _FX_URB_TYPE FX_URB_TYPE
virtual VOID CopyParameters(__in FxRequestBase *Request)
WDF_IO_TARGET_STATE m_State
#define STATUS_BUFFER_TOO_SMALL
FxUsbInterface * pUsbInterface
GLsizei GLsizei GLuint * obj
BOOLEAN IsObjectDisposedOnRemove(__in FxObject *Object)
enum _WDF_IO_TARGET_SENT_IO_ACTION WDF_IO_TARGET_SENT_IO_ACTION
WINUSB_INTERFACE_HANDLE m_WinUsbHandle
VOID FormatSelectSettingUrb(__in_bcount(GET_SELECT_INTERFACE_REQUEST_SIZE(NumEndpoints)) PURB Urb, __in USHORT NumEndpoints, __in UCHAR SettingNumber)
WDFIOTARGET GetHandle(VOID)
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)
_Must_inspect_result_ NTSTATUS SubmitSyncRequestIgnoreTargetState(__in FxRequestBase *Request, __in_opt PWDF_REQUEST_SEND_OPTIONS RequestOptions)
#define GET_ISO_URB_SIZE(n)
UCHAR m_NumberOfConfiguredPipes
VOID SetInfo(__in PUSBD_INTERFACE_INFORMATION Interface)
PINTERFACE_DEREFERENCE m_BusInterfaceDereference
USBD_STATUS GetUsbdStatus(VOID)
VOID SetUsbType(__in WDF_USB_REQUEST_TYPE Type)
GLenum GLuint GLenum GLsizei length
struct _USB_STRING_DESCRIPTOR USB_STRING_DESCRIPTOR
_Must_inspect_result_ NTSTATUS __inline FxValidateObjectAttributesForParentHandle(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
VOID MarkDisposeOverride(__in FxObjectLockState State=ObjectLock)
VOID USBD_CloseHandle(_In_ USBD_HANDLE USBDHandle)
union _WDF_USB_REQUEST_COMPLETION_PARAMS::@3706 Parameters
virtual VOID ReleaseAndRestore(__in FxRequestBase *Request)
#define USB_INTERFACE_DESCRIPTOR_TYPE
_Must_inspect_result_ NTSTATUS SelectConfigDescriptor(__in PWDF_OBJECT_ATTRIBUTES PipeAttributes, __in PWDF_USB_DEVICE_SELECT_CONFIG_PARAMS Params)
USBD_PIPE_HANDLE m_ControlPipe
_Must_inspect_result_ _In_ WDFUSBDEVICE _Out_writes_bytes_to_opt_ ConfigDescriptorLength PVOID ConfigDescriptor
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
FxUsbDeviceControlContext(__in FX_URB_TYPE FxUrbType)
_Must_inspect_result_ NTSTATUS FormatCycleRequest(__in FxRequestBase *Request)
virtual VOID Dispose(VOID)
#define IOCTL_INTERNAL_USB_CYCLE_PORT
FxUsbInterface * GetInterfaceFromNumber(__in UCHAR InterfaceNumber)
_In_ PVOID _In_ LONG InterfaceNumber
virtual VOID GotoRemoveState(__in WDF_IO_TARGET_STATE NewState, __in PLIST_ENTRY PendedRequestListHead, __in PSINGLE_LIST_ENTRY SentRequestListHead, __in BOOLEAN Lock, __out PBOOLEAN Wait)
VOID CleanUpAndDelete(__in BOOLEAN ClearDestroyCallback)
UCHAR GetInterfaceNumber(VOID)
PFX_DRIVER_GLOBALS pFxDriverGlobals
virtual VOID Stop(__in WDF_IO_TARGET_SENT_IO_ACTION Action)
_In_ WDFUSBINTERFACE UsbInterface
#define NT_SUCCESS(StatCode)
ULONG m_StringDescriptorLength
USBD_STATUS GetUsbdStatus(VOID)
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
virtual VOID GotoStopState(__in WDF_IO_TARGET_SENT_IO_ACTION Action, __in PSINGLE_LIST_ENTRY SentRequestListHead, __out PBOOLEAN Wait, __in BOOLEAN LockSelf)
PUSB_CONFIGURATION_DESCRIPTOR m_ConfigDescriptor
static __inline KIRQL MxGetCurrentIrql()
__inline FxIoTarget * GetTarget(VOID)
struct _UMURB_DESCRIPTOR_REQUEST UmUrbDescriptorRequest
ULONG m_HcdPortCapabilities
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
ULONG TransferBufferLength
VOID PipesGotoRemoveState(__in BOOLEAN ForceRemovePipes)
FxUsbDeviceStringContext(__in FX_URB_TYPE FxUrbType)
#define STATUS_UNSUCCESSFUL
static VOID _CleanupPipesRequests(__in PLIST_ENTRY PendHead, __in PSINGLE_LIST_ENTRY SentHead)
PVOID m_BusInterfaceContext
struct _SINGLE_LIST_ENTRY * Next
VOID USBD_UrbFree(_In_ USBD_HANDLE USBDHandle, _In_ PURB Urb)
FxUsbInterface ** m_Interfaces
_Must_inspect_result_ NTSTATUS FxValidateObjectAttributes(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in ULONG Flags=FX_VALIDATE_OPTION_NONE_SPECIFIED)
VOID __inline FxMdlFree(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PMDL Mdl)
VOID CleanupInterfacePipesAndDelete(__in FxUsbInterface *UsbInterface)
_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)
_Must_inspect_result_ _In_ WDFUSBINTERFACE _In_opt_ PWDF_OBJECT_ATTRIBUTES PipesAttributes
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ ULONG NumberOfIsochPackets
CfxDeviceBase * m_DeviceBase
virtual BOOLEAN Dispose(VOID)
virtual _Must_inspect_result_ NTSTATUS Start(VOID)
VOID RemoveDeletedInterface(__in FxUsbInterface *Interface)
virtual VOID Purge(__in WDF_IO_TARGET_PURGE_IO_ACTION Action)
virtual _Must_inspect_result_ NTSTATUS Start(VOID)
NTSTATUS FxUsbValidateConfigDescriptorHeaders(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PUSB_CONFIGURATION_DESCRIPTOR ConfigDescriptor, __in size_t ConfigDescriptorLength)
WDF_USB_REQUEST_COMPLETION_PARAMS m_UsbParameters
#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE
_Outptr_ PUSB_DEVICE_HANDLE _In_ PUSB_DEVICE_HANDLE _In_ USHORT PortStatus
virtual VOID CopyParameters(__in FxRequestBase *Request)
_Must_inspect_result_ NTSTATUS Init(__in CfxDeviceBase *Device)
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
virtual VOID WaitForSentIoToComplete(VOID)
_Must_inspect_result_ NTSTATUS AllocateDescriptor(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in size_t BufferSize)
PURB FxUsbCreateConfigRequest(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PUSB_CONFIGURATION_DESCRIPTOR ConfigDesc, __in PUSBD_INTERFACE_LIST_ENTRY InterfaceList, __in ULONG DefaultMaxPacketSize)
__checkReturn NTSTATUS AllocateUrb(__in USBD_HANDLE USBDHandle)
#define TRACE_LEVEL_ERROR
#define TRACE_LEVEL_WARNING
#define USBD_PORT_CONNECTED
BOOLEAN m_MismatchedInterfacesInConfigDescriptor
_Must_inspect_result_ __in WDFKEY __in PCUNICODE_STRING __in ULONG __in ULONG __in_ecount(ValueLength) PVOID Value)
_URB_CONTROL_TRANSFER * m_Urb
#define USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE
FORCEINLINE LONGLONG WDF_REL_TIMEOUT_IN_SEC(_In_ ULONGLONG Time)
FxUsbDevice(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
virtual BOOLEAN Dispose(VOID)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
BOOLEAN IsInterfaceConfigured(VOID)
struct _USB_STRING_DESCRIPTOR * PUSB_STRING_DESCRIPTOR
#define STATUS_BUFFER_OVERFLOW
PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor
static __inline VOID MxUnlockPages(__in PMDL Mdl)
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
_Must_inspect_result_ NTSTATUS CyclePort(VOID)
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
__checkReturn NTSTATUS AllocateUrb(__in USBD_HANDLE USBDHandle)
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
#define InitializeListHead(ListHead)
WDF_REQUEST_COMPLETION_PARAMS m_CompletionParams
PUSB_BUSIFFN_QUERY_BUS_TIME m_QueryBusTime
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define __deref_opt_out_bcount(size)
#define STATUS_WDF_PARENT_NOT_SPECIFIED
VOID Reuse(__in NTSTATUS Status=STATUS_SUCCESS)
_Must_inspect_result_ NTSTATUS GetInterfaceNumberFromInterface(__in WDFUSBINTERFACE UsbInterface, __out PUCHAR InterfaceNumber)
#define IOCTL_INTERNAL_USB_GET_PORT_STATUS
#define WDF_NO_OBJECT_ATTRIBUTES
static VOID _CancelSentRequests(__in PSINGLE_LIST_ENTRY RequestListHead)
VOID SubmitPendedRequest(__in FxRequestBase *Request)
_URB_CONTROL_TRANSFER m_UrbLegacy
VOID DeleteFromFailedCreate(VOID)
_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)
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
virtual VOID ReleaseAndRestore(__in FxRequestBase *Request)
USBD_CONFIGURATION_HANDLE m_ConfigHandle
USB_DEVICE_DESCRIPTOR m_DeviceDescriptor
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *)&pDevice, &pFxDriverGlobals)
#define RtlZeroMemory(Destination, Length)
IWudfFile * m_pHostTargetFile
#define RtlCopyMemory(Destination, Source, Length)
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_ WDFREQUEST _In_ WDFMEMORY UrbMemory
PUSB_STRING_DESCRIPTOR m_StringDescriptor
static __inline FxRequestBase * _FromListEntry(__in PLIST_ENTRY Entry)
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)
USBD_VERSION_INFORMATION m_UsbdVersionInformation
FORCEINLINE VOID WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT(_Inout_ PWDF_REQUEST_SEND_OPTIONS Options, _In_ LONGLONG Timeout)
FxUsbUrb(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in USBD_HANDLE USBDHandle, __in_bcount(BufferSize) PVOID Buffer, __in size_t BufferSize)
virtual BOOLEAN Dispose(VOID)
VOID GetInformation(__out PWDF_USB_DEVICE_INFORMATION Information)
_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
_Must_inspect_result_ NTSTATUS IsConnected(VOID)
NTSTATUS USBD_UrbAllocate(_In_ USBD_HANDLE USBDHandle, _Outptr_result_bytebuffer_(sizeof(URB)) PURB *Urb)
~FxUsbDeviceControlContext(VOID)
struct _WDF_USB_REQUEST_COMPLETION_PARAMS::@3706::@3707 DeviceString
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
~FxUsbDeviceStringContext(VOID)
static SERVICE_STATUS status
VOID NTAPI KeFlushQueuedDpcs(VOID)
virtual size_t GetBufferSize(VOID)=0
ULONG TransferBufferLength
virtual PVOID GetBuffer(VOID)
_Must_inspect_result_ NTSTATUS Deconfig(VOID)
virtual VOID Dispose(VOID)
struct _URB_SELECT_INTERFACE UrbSelectInterface
virtual VOID Stop(__in WDF_IO_TARGET_SENT_IO_ACTION Action)
#define STATUS_DEVICE_DATA_ERROR
virtual PVOID GetBuffer(VOID)=0
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
#define FxPointerNotNull(FxDriverGlobals, Ptr)
__inline BOOLEAN FxObjectCheckType(__in FxObject *Object, __in WDFTYPE Type)
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
virtual VOID WaitForSentIoToComplete(VOID)
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)