ReactOS 0.4.16-dev-1875-g3000d45
fxusbinterfaceapi.cpp File Reference
#include "fxusbpch.hpp"
Include dependency graph for fxusbinterfaceapi.cpp:

Go to the source code of this file.

Functions

_Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS WDFAPI NTAPI 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 NTAPI 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 81 of file fxusbinterfaceapi.cpp.

81 {
82 return status;
83 }
NTSTATUS status

◆ if() [2/5]

Definition at line 285 of file fxusbinterfaceapi.cpp.

285 {
288 "EndpointInfo Size %d incorrect, expected %d, %!STATUS!",
292 return;
293 }
#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 85 of file fxusbinterfaceapi.cpp.

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

◆ if() [4/5]

Definition at line 102 of file fxusbinterfaceapi.cpp.

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

◆ if() [5/5]

Definition at line 492 of file fxusbinterfaceapi.cpp.

492 {
494
497 "PipeInfo Size %d incorrect, expected %d, %!STATUS!",
499
501
502 return NULL;
503 }
#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 108 of file fxusbinterfaceapi.cpp.

108 {
110 if (Params->Types.Descriptor.InterfaceDescriptor == NULL) {
114 "InterfaceDescriptor passed in is NULL %!STATUS!", status);
115
116 }
117 else {
120 Params->Types.Descriptor.InterfaceDescriptor
121 );
122 }
123 break;
124
128 Params->Types.Interface.SettingIndex
129 );
130 break;
131
133 if (Params->Types.Urb.Urb == NULL ||
134 Params->Types.Urb.Urb->UrbHeader.Function != URB_FUNCTION_SELECT_INTERFACE ||
135 (Params->Types.Urb.Urb->UrbHeader.Length <
136 sizeof(struct _URB_SELECT_INTERFACE) - sizeof(USBD_PIPE_INFORMATION)) ) {
140 "URB or URB fields passed in are invalid Urb 0x%p %!STATUS!",
141 Params->Types.Urb.Urb, status);
142
143 }
144 else {
146 Params->Types.Urb.Urb);
147 }
148 break;
149
150 default:
152 break;
153 }
_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 248 of file fxusbinterfaceapi.cpp.

◆ EndpointInfo

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

Definition at line 250 of file fxusbinterfaceapi.cpp.

◆ InterfaceDescriptor

Initial value:

Definition at line 346 of file fxusbinterfaceapi.cpp.

◆ Params

◆ pFxDriverGlobals

PFX_DRIVER_GLOBALS pFxDriverGlobals

Definition at line 68 of file fxusbinterfaceapi.cpp.

Referenced by if(), and switch().

◆ PipeIndex

__in WDFUSBINTERFACE __in UCHAR PipeIndex

Definition at line 458 of file fxusbinterfaceapi.cpp.

◆ PipeInfo

Initial value:

Definition at line 460 of file fxusbinterfaceapi.cpp.

◆ PipesAttributes

◆ pUsbInterface

FxUsbInterface* pUsbInterface

Definition at line 69 of file fxusbinterfaceapi.cpp.

Referenced by __drv_maxIRQL(), and switch().

◆ SettingIndex

__in WDFUSBINTERFACE __in UCHAR SettingIndex
Initial value:

Definition at line 206 of file fxusbinterfaceapi.cpp.

◆ status

◆ UsbInterface

__in WDFUSBINTERFACE UsbInterface
Initial value:

Definition at line 43 of file fxusbinterfaceapi.cpp.