ReactOS 0.4.17-dev-1281-g065abb3
UcxUsbdHandle Class Reference

#include <clientif.h>

Collaboration diagram for UcxUsbdHandle:

Public Member Functions

 _IRQL_requires_ (PASSIVE_LEVEL) static NTSTATUS CreateFromQuery(_In_ UcxRootHub *RootHub
 
VOID Unregister ()
 
NTSTATUS AllocateXrb (_In_ ULONG Size, _In_ ULONG Type, _Outptr_ UcxXrbPreamble **Xrb)
 
VOID TrackXrb (_In_ UcxXrbPreamble *Xrb)
 

Static Public Member Functions

static UcxUsbdHandle * FromClientHandle (_In_ USBD_CLIENT_HANDLE Handle)
 

Public Attributes

_In_ UcxUsbDevice * Device
 
_In_ UcxUsbDevice _Inout_ PUSBD_CLIENT_INTERFACE Interface
 
ULONG m_ContractVersion
 
PDEVICE_OBJECT m_ClientDeviceObject
 
ULONG m_PoolTag
 
PVOID m_ClientContext
 
UcxUsbDevice * m_Device
 
UcxController * m_Controller
 
WDFMEMORY m_Memory
 
WDFDEVICE m_RootHubPdo
 
UcxRootHub * m_RootHub
 
LIST_ENTRY m_DeviceLink
 
BOOLEAN m_Orphaned
 
BOOLEAN m_Unregistered
 
BOOLEAN m_VerifierEnabled
 
ULONG m_VerifierFailRegistration
 
ULONG m_VerifierFailChainedMdl
 
ULONG m_VerifierFailStaticStreamSupport
 
ULONG m_VerifierStaticStreamCountOverride
 
ULONG m_VerifierFailEnableStaticStreams
 
ULONG m_VerifierFailSecureTransfer
 
ULONG m_VerifierFailEndpointOffload
 
BOOLEAN m_StreamsGranted
 
BOOLEAN m_ChainedMdlGranted
 
ULONG m_GrantedStreams
 
BOOLEAN m_TrackXrbs
 
KSPIN_LOCK m_XrbLock
 
LIST_ENTRY m_XrbList
 

Detailed Description

One client's USBD registration; outlives the USB device it was made against.

Definition at line 14 of file clientif.h.

Member Function Documentation

◆ _IRQL_requires_()

UcxUsbdHandle::_IRQL_requires_ ( PASSIVE_LEVEL  )

◆ AllocateXrb()

NTSTATUS UcxUsbdHandle::AllocateXrb ( _In_ ULONG  Size,
_In_ ULONG  Type,
_Outptr_ UcxXrbPreamble **  Xrb 
)

Definition at line 663 of file clientif.cpp.

667{
669 UcxXrbPreamble* Xrb;
670 WDFMEMORY Memory;
673
674 *XrbOut = NULL;
675
677 Attributes.ParentObject = m_Memory;
678
679 Status = WdfMemoryCreate(&Attributes, NonPagedPool, m_PoolTag, Size, &Memory, &Buffer);
680 if (!NT_SUCCESS(Status))
681 {
682 DPRINT1("XRB allocation of %lu bytes for handle %p failed 0x%lx\n", Size, this, Status);
683 return Status;
684 }
685
686 /* Both released by the free call, which may come after unregister */
690
691 Xrb = (UcxXrbPreamble*)Buffer;
693 Xrb->TotalSize = Size;
695 Xrb->Handle = this;
696 Xrb->State = UCX_XRB_IDLE;
697 Xrb->Type = Type;
698 Xrb->Memory = Memory;
699
700 *XrbOut = Xrb;
701 return STATUS_SUCCESS;
702}
Type
Definition: Type.h:7
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
Definition: bufpool.h:45
ULONG m_PoolTag
Definition: clientif.h:51
ULONG m_ContractVersion
Definition: clientif.h:49
WDFMEMORY m_Memory
Definition: clientif.h:57
#define UCX_XRB_SIGNATURE
Definition: clientxrb.h:11
#define UCX_XRB_IDLE
Definition: clientxrb.h:18
_In_ ULONG Attributes
Definition: dispmprt.h:1077
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define NonPagedPool
Definition: env_spec_w32.h:307
Status
Definition: gdiplustypes.h:24
#define STATUS_SUCCESS
Definition: shellext.h:65
ULONG Signature
Definition: clientxrb.h:47
ULONG ContractVersion
Definition: clientxrb.h:35
ULONG TotalSize
Definition: clientxrb.h:34
WDFMEMORY Memory
Definition: clientxrb.h:40
UcxUsbdHandle * Handle
Definition: clientxrb.h:39
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG _In_ _Out_ WDFMEMORY * Memory
Definition: wdfmemory.h:169
FORCEINLINE VOID WDF_OBJECT_ATTRIBUTES_INIT(_Out_ PWDF_OBJECT_ATTRIBUTES Attributes)
Definition: wdfobject.h:147
#define WdfObjectReference(Handle)
Definition: wdfobject.h:803

◆ FromClientHandle()

static UcxUsbdHandle * UcxUsbdHandle::FromClientHandle ( _In_ USBD_CLIENT_HANDLE  Handle)
inlinestatic

◆ TrackXrb()

VOID UcxUsbdHandle::TrackXrb ( _In_ UcxXrbPreamble *  Xrb)

Definition at line 724 of file clientif.cpp.

726{
727 if (!m_TrackXrbs)
728 return;
729
730 SpinLockGuard Guard(&m_XrbLock);
731 InsertTailList(&m_XrbList, &Xrb->TrackingLink);
732}
KSPIN_LOCK m_XrbLock
Definition: clientif.h:86
BOOLEAN m_TrackXrbs
Definition: clientif.h:85
LIST_ENTRY m_XrbList
Definition: clientif.h:87
#define InsertTailList(ListHead, Entry)

◆ Unregister()

VOID UcxUsbdHandle::Unregister ( )

Definition at line 589 of file clientif.cpp.

590{
591 WDFMEMORY Memory = m_Memory;
592
593 if (!m_Orphaned)
594 {
595 {
597
600 }
601
603 }
604
606
607 /* Deleting the storage deletes every XRB still allocated under it */
611}
#define InterlockedDecrement
Definition: armddk.h:52
LONG m_UsbdInterfaceCount
Definition: hostctl.h:349
KSPIN_LOCK m_UsbdHandleLock
Definition: devobj.h:274
UcxController * m_Controller
Definition: clientif.h:56
UcxUsbDevice * m_Device
Definition: clientif.h:53
BOOLEAN m_Orphaned
Definition: clientif.h:65
LIST_ENTRY m_DeviceLink
Definition: clientif.h:62
PDEVICE_OBJECT m_ClientDeviceObject
Definition: clientif.h:50
BOOLEAN m_Unregistered
Definition: clientif.h:68
#define TRUE
Definition: types.h:120
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
FORCEINLINE VOID NTAPI UcxClearListEntry(_Out_ PLIST_ENTRY Entry)
Definition: ucxutil.h:84
WdfObjectDelete(String)
#define WdfObjectDereference(Handle)
Definition: wdfobject.h:826
#define ObDereferenceObject
Definition: obfuncs.h:203

Referenced by UcxClientUnregister().

Member Data Documentation

◆ Device

_In_ UcxUsbDevice* UcxUsbdHandle::Device

Definition at line 22 of file clientif.h.

Referenced by _IRQL_requires_().

◆ Interface

_In_ UcxUsbDevice _Inout_ PUSBD_CLIENT_INTERFACE UcxUsbdHandle::Interface

Definition at line 23 of file clientif.h.

◆ m_ChainedMdlGranted

BOOLEAN UcxUsbdHandle::m_ChainedMdlGranted

Definition at line 81 of file clientif.h.

◆ m_ClientContext

PVOID UcxUsbdHandle::m_ClientContext

Definition at line 52 of file clientif.h.

◆ m_ClientDeviceObject

PDEVICE_OBJECT UcxUsbdHandle::m_ClientDeviceObject

Definition at line 50 of file clientif.h.

Referenced by UcxXrbCheckOnSubmit(), and Unregister().

◆ m_ContractVersion

ULONG UcxUsbdHandle::m_ContractVersion

Definition at line 49 of file clientif.h.

Referenced by AllocateXrb().

◆ m_Controller

UcxController* UcxUsbdHandle::m_Controller

Definition at line 56 of file clientif.h.

Referenced by Unregister().

◆ m_Device

UcxUsbDevice* UcxUsbdHandle::m_Device

Definition at line 53 of file clientif.h.

Referenced by Unregister().

◆ m_DeviceLink

LIST_ENTRY UcxUsbdHandle::m_DeviceLink

Definition at line 62 of file clientif.h.

Referenced by Unregister().

◆ m_GrantedStreams

ULONG UcxUsbdHandle::m_GrantedStreams

Definition at line 82 of file clientif.h.

◆ m_Memory

WDFMEMORY UcxUsbdHandle::m_Memory

Definition at line 57 of file clientif.h.

Referenced by AllocateXrb(), and Unregister().

◆ m_Orphaned

BOOLEAN UcxUsbdHandle::m_Orphaned

Definition at line 65 of file clientif.h.

Referenced by Unregister().

◆ m_PoolTag

ULONG UcxUsbdHandle::m_PoolTag

Definition at line 51 of file clientif.h.

Referenced by AllocateXrb().

◆ m_RootHub

UcxRootHub* UcxUsbdHandle::m_RootHub

Definition at line 59 of file clientif.h.

◆ m_RootHubPdo

WDFDEVICE UcxUsbdHandle::m_RootHubPdo

Definition at line 58 of file clientif.h.

◆ m_StreamsGranted

BOOLEAN UcxUsbdHandle::m_StreamsGranted

Definition at line 80 of file clientif.h.

◆ m_TrackXrbs

BOOLEAN UcxUsbdHandle::m_TrackXrbs

Definition at line 85 of file clientif.h.

Referenced by TrackXrb().

◆ m_Unregistered

BOOLEAN UcxUsbdHandle::m_Unregistered

Definition at line 68 of file clientif.h.

Referenced by Unregister().

◆ m_VerifierEnabled

BOOLEAN UcxUsbdHandle::m_VerifierEnabled

Definition at line 70 of file clientif.h.

◆ m_VerifierFailChainedMdl

ULONG UcxUsbdHandle::m_VerifierFailChainedMdl

Definition at line 72 of file clientif.h.

◆ m_VerifierFailEnableStaticStreams

ULONG UcxUsbdHandle::m_VerifierFailEnableStaticStreams

Definition at line 75 of file clientif.h.

◆ m_VerifierFailEndpointOffload

ULONG UcxUsbdHandle::m_VerifierFailEndpointOffload

Definition at line 77 of file clientif.h.

◆ m_VerifierFailRegistration

ULONG UcxUsbdHandle::m_VerifierFailRegistration

Definition at line 71 of file clientif.h.

◆ m_VerifierFailSecureTransfer

ULONG UcxUsbdHandle::m_VerifierFailSecureTransfer

Definition at line 76 of file clientif.h.

◆ m_VerifierFailStaticStreamSupport

ULONG UcxUsbdHandle::m_VerifierFailStaticStreamSupport

Definition at line 73 of file clientif.h.

◆ m_VerifierStaticStreamCountOverride

ULONG UcxUsbdHandle::m_VerifierStaticStreamCountOverride

Definition at line 74 of file clientif.h.

◆ m_XrbList

LIST_ENTRY UcxUsbdHandle::m_XrbList

Definition at line 87 of file clientif.h.

Referenced by TrackXrb().

◆ m_XrbLock

KSPIN_LOCK UcxUsbdHandle::m_XrbLock

Definition at line 86 of file clientif.h.

Referenced by TrackXrb().


The documentation for this class was generated from the following files: