35 USBD_HANDLE UsbdHandle
58 Request->VerifierSetFormatted();
70 USBD_HANDLE UsbdHandle
79 "FormatUrbRequest: Target %p, Request %p, "
80 "setting target failed, %!STATUS!",
92 if (pContext ==
NULL) {
122 while (
pCur < pEnd) {
131 "USB Configuration packet contains bad data, expected "
132 "at least %d remaining bytes in config descriptor at "
133 "offset %I64d, total size is %I64d",
146 "USB Configuration packet contains bad data, descriptor at offset "
147 "%I64d specified bLength %d, only %I64d bytes remaining in config "
148 "descriptor, total size is %I64d",
155 if (pDescriptor->
bLength == 0) {
158 "USB Configuration packet contains bad data, descriptor at offset "
159 "%I64d contains bLength == 0, this is due to a broken device or driver",
187 while (
pCur < pEnd) {
213 __in size_t SizeToValidate,
215 __in ULONG MaximumNumDescriptorsToValidate
254 if (pDescriptor->
bLength != SizeToValidate) {
257 "USB Configuration packet contains bad data, found descriptor "
258 "#%d of type %d at offset %I64d, expected bLength of %I64d, found %d",
260 SizeToValidate, pDescriptor->bLength
266 if (pDescriptor->
bLength < SizeToValidate) {
269 "USB Configuration packet contains bad data, found descriptor "
270 "#%d of type %d at offset %I64d, expected minimum bLength of %I64d, "
273 SizeToValidate, pDescriptor->bLength
295 if (MaximumNumDescriptorsToValidate > 0 &&
i == MaximumNumDescriptorsToValidate) {
332 ConfigDesc->wTotalLength,
339 if (usbInterface !=
NULL) {
340 found = usbInterface;
358 }
while (usbInterface!=
NULL);
407 while (
pList->InterfaceDescriptor !=
NULL) {
412 pList->InterfaceDescriptor->bNumEndpoints),
417 "InterfaceList %p, NumEndPoints 0x%x, "
418 "Integer overflow while calculating interface size, %!STATUS!",
420 pList->InterfaceDescriptor->bNumEndpoints,
453 pInterfaceDesc =
pList->InterfaceDescriptor;
456#pragma prefast(suppress: __WARNING_BUFFER_OVERFLOW, "Esp:675");
470 pList->Interface = pInterfaceInfo;
484#if (FX_CORE_MODE == FX_CORE_USER_MODE)
489 __in IWudfFile* HostFile,
513 FX_VERIFY(INTERNAL, CHECK_NOT_NULL(Urb));
515 FX_VERIFY(INTERNAL, CHECK_NOT_NULL(HostFile));
517 IWudfIoIrp* pIoIrp =
NULL;
526 Request->ClearFieldsForReuse();
532 pIoIrp->SetTypeForNextStackLocation(UMINT::WdfRequestInternalIoctl);
541 pIoIrp->SetOtherParametersForNextStackLocation((
PVOID*)&Urb,
546 pIoIrp->SetFileForNextIrpStackLocation(HostFile);
552 Request->VerifierSetFormatted();
558 __in WINUSB_INTERFACE_HANDLE WinUsbHandle,
566 UmUrb->UmUrbDescriptorRequest.Hdr.InterfaceHandle = WinUsbHandle;
571 UmUrb->UmUrbDescriptorRequest.Index = 0;
572 UmUrb->UmUrbDescriptorRequest.LanguageID = 0;
573 UmUrb->UmUrbDescriptorRequest.BufferLength =
BufferLength;
574 UmUrb->UmUrbDescriptorRequest.Buffer =
Buffer;
580 __in WINUSB_INTERFACE_HANDLE WinUsbHandle,
587 UmUrb->UmUrbControlTransfer.Hdr.InterfaceHandle = WinUsbHandle;
591 UmUrb->UmUrbControlTransfer.TransferBufferLength =
BufferLength;
592 UmUrb->UmUrbControlTransfer.TransferBuffer =
Buffer;
598 __in WINUSB_INTERFACE_HANDLE WinUsbHandle,
605 UmUrb->UmUrbDeviceInformation.Hdr.InterfaceHandle = WinUsbHandle;
609 UmUrb->UmUrbDeviceInformation.InformationType = DEVICE_SPEED;
610 UmUrb->UmUrbDeviceInformation.BufferLength =
BufferLength;
611 UmUrb->UmUrbDeviceInformation.Buffer =
Buffer;
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
VOID SetMajorFunction(__in UCHAR MajorFunction)
VOID SetParameterIoctlCode(__in ULONG DeviceIoControlCode)
PIO_STACK_LOCATION GetNextIrpStackLocation(VOID)
VOID ClearNextStackLocation(VOID)
VOID SetNextStackParameterOthersArgument1(__in PVOID Argument1)
VOID Reuse(__in NTSTATUS Status=STATUS_SUCCESS)
#define NT_SUCCESS(StatCode)
#define __drv_when(cond, annotes)
FX_VERIFY(INTERNAL, CHECK_NOT_NULL(LoaderInterface->pIWudfHost))
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
return pRequest Reuse(ReuseParams)
enum _FX_URB_TYPE FX_URB_TYPE
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
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 GLint GLint j
#define __in_xcount(size)
#define TRACE_LEVEL_VERBOSE
#define TRACE_LEVEL_ERROR
virtual VOID StoreAndReferenceMemory(__in FxRequestBuffer *Buffer)
struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration
struct _URB_HEADER UrbHeader
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
#define UMURB_FUNCTION_CONTROL_TRANSFER
#define IOCTL_INETRNAL_USB_SUBMIT_UMURB
#define UMURB_FUNCTION_GET_DEVICE_INFORMATION
#define UMURB_FUNCTION_GET_DESCRIPTOR
#define USB_CONFIGURATION_DESCRIPTOR_TYPE
struct _USB_INTERFACE_DESCRIPTOR * PUSB_INTERFACE_DESCRIPTOR
struct _USB_COMMON_DESCRIPTOR * PUSB_COMMON_DESCRIPTOR
#define USB_INTERFACE_DESCRIPTOR_TYPE
struct _USBD_INTERFACE_INFORMATION * PUSBD_INTERFACE_INFORMATION
#define URB_FUNCTION_SELECT_CONFIGURATION
#define GET_USBD_INTERFACE_SIZE(numEndpoints)
_In_ ULONG _In_ PVOID _In_ LONG DescriptorType
_In_ PUSBD_INTERFACE_LIST_ENTRY InterfaceList
_In_ PVOID _In_ LONG _In_ LONG AlternateSetting
_In_ PVOID _In_ LONG InterfaceNumber
#define IOCTL_INTERNAL_USB_SUBMIT_URB
VOID USBD_AssignUrbToIoStackLocation(_In_ USBD_HANDLE USBDHandle, _In_ PIO_STACK_LOCATION IoStackLocation, _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)
VOID FxUsbUmInitInformationUrb(__inout PUMURB UmUrb, __in WINUSB_INTERFACE_HANDLE WinUsbHandle, __in ULONG BufferLength, __in PVOID Buffer)
NTSTATUS FxFormatUrbRequest(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxIoTarget *Target, __in FxRequestBase *Request, __in FxRequestBuffer *Buffer, __in FX_URB_TYPE FxUrbType, __drv_when(FxUrbType==FxUrbTypeUsbdAllocated, __in) __drv_when(FxUrbType !=FxUrbTypeUsbdAllocated, __in_opt) USBD_HANDLE UsbdHandle)
PUSB_INTERFACE_DESCRIPTOR FxUsbParseConfigurationDescriptor(__in PUSB_CONFIGURATION_DESCRIPTOR ConfigDesc, __in UCHAR InterfaceNumber, __in UCHAR AlternateSetting)
VOID FxUsbUmInitDescriptorUrb(__inout PUMURB UmUrb, __in WINUSB_INTERFACE_HANDLE WinUsbHandle, __in UCHAR DescriptorType, __in ULONG BufferLength, __in PVOID Buffer)
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)
VOID FxUsbUmFormatRequest(__in FxRequestBase *Request, __in_xcount(Urb->Length) PUMURB_HEADER Urb, __in IWudfFile *HostFile, __in BOOLEAN Reuse)
VOID FxUsbUmInitControlTransferUrb(__inout PUMURB UmUrb, __in WINUSB_INTERFACE_HANDLE WinUsbHandle, __in ULONG BufferLength, __in PVOID Buffer)
FxUsbValidateDescriptorOp
@ FxUsbValidateDescriptorOpAtLeast
@ FxUsbValidateDescriptorOpEqual
#define WDF_PTR_ADD_OFFSET(_ptr, _offset)
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_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 _Out_writes_bytes_to_opt_ ConfigDescriptorLength PVOID _Inout_ PUSHORT ConfigDescriptorLength
#define IRP_MJ_INTERNAL_DEVICE_CONTROL