ReactOS  0.4.15-dev-3177-gd6a0299
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]

_Must_inspect_result_ __drv_maxIRQL ( PASSIVE_LEVEL  )

◆ __drv_maxIRQL() [2/2]

__drv_maxIRQL ( DISPATCH_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  ,
Params   
)

◆ FxPointerNotNull() [2/3]

FxPointerNotNull ( pFxDriverGlobals  ,
EndpointInfo   
)

◆ FxPointerNotNull() [3/3]

FxPointerNotNull ( pFxDriverGlobals  ,
InterfaceDescriptor   
)

◆ 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 82 of file fxusbinterfaceapi.cpp.

82  {
86  "Params size %d, expected %d %!STATUS!", Params->Size,
88  return status;
89  }
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:306
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
NTSTATUS status
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define TRACINGIOTARGET
Definition: dbgtrace.h:72
Definition: ps.c:97

◆ if() [3/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  }
DriverGlobals
FX_VERIFY_WITH_NAME(DRIVER(BadArgument, TODO), CHECK(ERROR_STRING_HW_ACCESS_NOT_ALLOWED,(pDevice->IsDirectHardwareAccessAllowed()==TRUE)), DriverGlobals->DriverName)

◆ if() [4/5]

Definition at line 279 of file fxusbinterfaceapi.cpp.

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

◆ if() [5/5]

Definition at line 481 of file fxusbinterfaceapi.cpp.

481  {
483 
486  "PipeInfo Size %d incorrect, expected %d, %!STATUS!",
487  PipeInfo->Size, sizeof(WDF_USB_PIPE_INFORMATION), status);
488 
490 
491  return NULL;
492  }
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
PFX_DRIVER_GLOBALS pFxDriverGlobals
_In_ WDFUSBINTERFACE _In_ UCHAR _Out_opt_ PWDF_USB_PIPE_INFORMATION PipeInfo
Definition: wdfusb.h:2538
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
#define TRACINGIOTARGET
Definition: dbgtrace.h:72
FxVerifierDbgBreakPoint(pFxDriverGlobals)
Definition: ps.c:97

◆ 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  }
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:306
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ NTSTATUS SelectSettingByDescriptor(__in PWDF_OBJECT_ATTRIBUTES PipesAttributes, __in PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor)
_Must_inspect_result_ NTSTATUS SelectSettingByIndex(__in PWDF_OBJECT_ATTRIBUTES PipesAttributes, __in UCHAR SettingIndex)
PFX_DRIVER_GLOBALS pFxDriverGlobals
_Must_inspect_result_ NTSTATUS SelectSetting(__in PWDF_OBJECT_ATTRIBUTES PipesAttributes, __in PURB Urb)
_Must_inspect_result_ _In_ WDFUSBINTERFACE _In_opt_ PWDF_OBJECT_ATTRIBUTES PipesAttributes
Definition: wdfusb.h:2388
#define URB_FUNCTION_SELECT_INTERFACE
Definition: usb.h:87
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
FxUsbInterface * pUsbInterface
#define TRACINGIOTARGET
Definition: dbgtrace.h:72
Definition: ps.c:97

Variable Documentation

◆ EndpointIndex

Definition at line 238 of file fxusbinterfaceapi.cpp.

◆ EndpointInfo

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

Definition at line 265 of file fxusbinterfaceapi.cpp.

◆ InterfaceDescriptor

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

Definition at line 353 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 445 of file fxusbinterfaceapi.cpp.

◆ PipeInfo

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

Definition at line 468 of file fxusbinterfaceapi.cpp.

◆ PipesAttributes

◆ pUsbInterface

FxUsbInterface* pUsbInterface

Definition at line 66 of file fxusbinterfaceapi.cpp.

Referenced by switch().

◆ SettingIndex

__in WDFUSBINTERFACE __in UCHAR SettingIndex
Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 218 of file fxusbinterfaceapi.cpp.

◆ status

◆ UsbInterface

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

Definition at line 40 of file fxusbinterfaceapi.cpp.