ReactOS 0.4.15-dev-7918-g2a2556c
fxusbinterfaceapi.cpp File Reference
#include "fxusbpch.hpp"
#include "FxUsbInterfaceAPI.tmh"
Include dependency graph for fxusbinterfaceapi.cpp:

Go to the source code of this file.

Functions

_Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS WDFAPI WDFEXPORT(WdfUsbInterfaceSelectSetting)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxObjectHandleGetPtrAndGlobals (GetFxDriverGlobals(DriverGlobals), UsbInterface, FX_TYPE_USB_INTERFACE,(PVOID *) &pUsbInterface, &pFxDriverGlobals)
 
 FxPointerNotNull (pFxDriverGlobals, Params)
 
 if (!NT_SUCCESS(status))
 
 if (Params->Size !=sizeof(WDF_USB_INTERFACE_SELECT_SETTING_PARAMS))
 
 if (Params->Type !=WdfUsbInterfaceSelectSettingTypeSetting)
 
 switch (Params->Type)
 
 __drv_maxIRQL (DISPATCH_LEVEL) BYTE WDFAPI WDFEXPORT(WdfUsbInterfaceGetInterfaceNumber)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxObjectHandleGetPtr (GetFxDriverGlobals(DriverGlobals), UsbInterface, FX_TYPE_USB_INTERFACE,(PVOID *) &pUsbInterface)
 
return pUsbInterface GetInterfaceNumber ()
 
return pUsbInterface GetNumEndpoints (SettingIndex)
 
 FxPointerNotNull (pFxDriverGlobals, EndpointInfo)
 
 if (EndpointInfo->Size !=sizeof(WDF_USB_PIPE_INFORMATION))
 
pUsbInterface GetEndpointInformation (SettingIndex, EndpointIndex, EndpointInfo)
 
return pUsbInterface GetNumSettings ()
 
 FxPointerNotNull (pFxDriverGlobals, InterfaceDescriptor)
 
pUsbInterface GetDescriptor (InterfaceDescriptor, SettingIndex)
 
return pUsbInterface GetConfiguredSettingIndex ()
 
return pUsbInterface GetNumConfiguredPipes ()
 
 if (PipeInfo !=NULL &&PipeInfo->Size !=sizeof(WDF_USB_PIPE_INFORMATION))
 
return pUsbInterface GetConfiguredPipe (PipeIndex, PipeInfo)
 

Variables

_Must_inspect_result_ __in WDFUSBINTERFACE UsbInterface
 
_Must_inspect_result_ __in WDFUSBINTERFACE __in_opt PWDF_OBJECT_ATTRIBUTES PipesAttributes
 
_Must_inspect_result_ __in WDFUSBINTERFACE __in_opt PWDF_OBJECT_ATTRIBUTES __in PWDF_USB_INTERFACE_SELECT_SETTING_PARAMS Params
 
PFX_DRIVER_GLOBALS pFxDriverGlobals
 
FxUsbInterfacepUsbInterface
 
NTSTATUS status = FxVerifierCheckIrqlLevel(pFxDriverGlobals, PASSIVE_LEVEL)
 
__in WDFUSBINTERFACE __in UCHAR SettingIndex
 
__in WDFUSBINTERFACE __in UCHAR __in UCHAR EndpointIndex
 
__in WDFUSBINTERFACE __in UCHAR __in UCHAR __out PWDF_USB_PIPE_INFORMATION EndpointInfo
 
__in WDFUSBINTERFACE __in UCHAR __out PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor
 
__in WDFUSBINTERFACE __in UCHAR PipeIndex
 
__in WDFUSBINTERFACE __in UCHAR __out_opt PWDF_USB_PIPE_INFORMATION PipeInfo
 

Function Documentation

◆ __drv_maxIRQL() [1/2]

__drv_maxIRQL ( DISPATCH_LEVEL  )

◆ __drv_maxIRQL() [2/2]

_Must_inspect_result_ __drv_maxIRQL ( PASSIVE_LEVEL  )

◆ FxObjectHandleGetPtr()

FxObjectHandleGetPtr ( GetFxDriverGlobals(DriverGlobals ,
UsbInterface  ,
FX_TYPE_USB_INTERFACE  ,
(PVOID *) &  pUsbInterface 
)

◆ FxObjectHandleGetPtrAndGlobals()

FxObjectHandleGetPtrAndGlobals ( GetFxDriverGlobals(DriverGlobals ,
UsbInterface  ,
FX_TYPE_USB_INTERFACE  ,
(PVOID *) &  pUsbInterface,
pFxDriverGlobals 
)

◆ FxPointerNotNull() [1/3]

FxPointerNotNull ( pFxDriverGlobals  ,
EndpointInfo   
)

◆ FxPointerNotNull() [2/3]

FxPointerNotNull ( pFxDriverGlobals  ,
InterfaceDescriptor   
)

◆ FxPointerNotNull() [3/3]

FxPointerNotNull ( pFxDriverGlobals  ,
Params   
)

◆ GetConfiguredPipe()

return pUsbInterface GetConfiguredPipe ( PipeIndex  ,
PipeInfo   
)

◆ GetConfiguredSettingIndex()

return pUsbInterface GetConfiguredSettingIndex ( )

◆ GetDescriptor()

pUsbInterface GetDescriptor ( InterfaceDescriptor  ,
SettingIndex   
)

◆ GetEndpointInformation()

pUsbInterface GetEndpointInformation ( SettingIndex  ,
EndpointIndex  ,
EndpointInfo   
)

◆ GetInterfaceNumber()

return pUsbInterface GetInterfaceNumber ( )

◆ GetNumConfiguredPipes()

return pUsbInterface GetNumConfiguredPipes ( )

◆ GetNumEndpoints()

return pUsbInterface GetNumEndpoints ( SettingIndex  )

◆ GetNumSettings()

return pUsbInterface GetNumSettings ( )

◆ if() [1/5]

if ( NT_SUCCESSstatus)

Definition at line 78 of file fxusbinterfaceapi.cpp.

78 {
79 return status;
80 }
NTSTATUS status

◆ if() [2/5]

Definition at line 279 of file fxusbinterfaceapi.cpp.

279 {
282 "EndpointInfo Size %d incorrect, expected %d, %!STATUS!",
286 return;
287 }
#define TRACINGIOTARGET
Definition: dbgtrace.h:72
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
FxVerifierDbgBreakPoint(pFxDriverGlobals)
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_In_ WDFUSBINTERFACE _In_ UCHAR _In_ UCHAR _Out_ PWDF_USB_PIPE_INFORMATION EndpointInfo
Definition: wdfusb.h:2429

◆ if() [3/5]

Definition at line 82 of file fxusbinterfaceapi.cpp.

82 {
86 "Params size %d, expected %d %!STATUS!", Params->Size,
88 return status;
89 }
Definition: ps.c:97
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:308

◆ if() [4/5]

Definition at line 99 of file fxusbinterfaceapi.cpp.

99 {
100 FX_VERIFY_WITH_NAME(INTERNAL, TRAPMSG("UMDF may only select settings by index."),
101 DriverGlobals->DriverName);
102 }
FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK(ERROR_STRING_HW_ACCESS_NOT_ALLOWED,(pDevice->IsDirectHardwareAccessAllowed()==TRUE)), DriverGlobals->DriverName)
DriverGlobals

◆ if() [5/5]

Definition at line 481 of file fxusbinterfaceapi.cpp.

481 {
483
486 "PipeInfo Size %d incorrect, expected %d, %!STATUS!",
488
490
491 return NULL;
492 }
#define NULL
Definition: types.h:112
_In_ WDFUSBINTERFACE _In_ UCHAR _Out_opt_ PWDF_USB_PIPE_INFORMATION PipeInfo
Definition: wdfusb.h:2543

◆ switch()

switch ( Params->  Type)

Definition at line 105 of file fxusbinterfaceapi.cpp.

105 {
107 if (Params->Types.Descriptor.InterfaceDescriptor == NULL) {
111 "InterfaceDescriptor passed in is NULL %!STATUS!", status);
112
113 }
114 else {
117 Params->Types.Descriptor.InterfaceDescriptor
118 );
119 }
120 break;
121
125 Params->Types.Interface.SettingIndex
126 );
127 break;
128
130 if (Params->Types.Urb.Urb == NULL ||
131 Params->Types.Urb.Urb->UrbHeader.Function != URB_FUNCTION_SELECT_INTERFACE ||
132 (Params->Types.Urb.Urb->UrbHeader.Length <
133 sizeof(struct _URB_SELECT_INTERFACE) - sizeof(USBD_PIPE_INFORMATION)) ) {
137 "URB or URB fields passed in are invalid Urb 0x%p %!STATUS!",
138 Params->Types.Urb.Urb, status);
139
140 }
141 else {
143 Params->Types.Urb.Urb);
144 }
145 break;
146
147 default:
149 break;
150 }
_Must_inspect_result_ NTSTATUS SelectSettingByIndex(__in PWDF_OBJECT_ATTRIBUTES PipesAttributes, __in UCHAR SettingIndex)
_Must_inspect_result_ NTSTATUS SelectSettingByDescriptor(__in PWDF_OBJECT_ATTRIBUTES PipesAttributes, __in PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor)
_Must_inspect_result_ NTSTATUS SelectSetting(__in PWDF_OBJECT_ATTRIBUTES PipesAttributes, __in PURB Urb)
FxUsbInterface * pUsbInterface
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define URB_FUNCTION_SELECT_INTERFACE
Definition: usb.h:87
@ WdfUsbInterfaceSelectSettingTypeUrb
Definition: wdfusb.h:138
@ WdfUsbInterfaceSelectSettingTypeDescriptor
Definition: wdfusb.h:136
@ WdfUsbInterfaceSelectSettingTypeSetting
Definition: wdfusb.h:137
_Must_inspect_result_ _In_ WDFUSBINTERFACE _In_opt_ PWDF_OBJECT_ATTRIBUTES PipesAttributes
Definition: wdfusb.h:2390

Variable Documentation

◆ EndpointIndex

Definition at line 242 of file fxusbinterfaceapi.cpp.

◆ EndpointInfo

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 244 of file fxusbinterfaceapi.cpp.

◆ InterfaceDescriptor

Initial value:

Definition at line 338 of file fxusbinterfaceapi.cpp.

◆ Params

◆ pFxDriverGlobals

PFX_DRIVER_GLOBALS pFxDriverGlobals

Definition at line 65 of file fxusbinterfaceapi.cpp.

Referenced by if(), and switch().

◆ PipeIndex

__in WDFUSBINTERFACE __in UCHAR PipeIndex

Definition at line 447 of file fxusbinterfaceapi.cpp.

◆ PipeInfo

Initial value:

Definition at line 449 of file fxusbinterfaceapi.cpp.

◆ PipesAttributes

◆ pUsbInterface

FxUsbInterface* pUsbInterface

Definition at line 66 of file fxusbinterfaceapi.cpp.

Referenced by __drv_maxIRQL(), and switch().

◆ SettingIndex

__in WDFUSBINTERFACE __in UCHAR SettingIndex
Initial value:

Definition at line 201 of file fxusbinterfaceapi.cpp.

◆ status

◆ UsbInterface

__in WDFUSBINTERFACE UsbInterface
Initial value:

Definition at line 40 of file fxusbinterfaceapi.cpp.