ReactOS 0.4.17-dev-1281-g065abb3
pipeio.cpp File Reference
#include "ucx01000.h"
#include <debug.h>
Include dependency graph for pipeio.cpp:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

static NTSTATUS NTAPI UcxFailStreamsUrb (_In_ PIRP Irp, _In_ PURB Urb, _In_ NTSTATUS Status)
 
static NTSTATUS NTAPI UcxCreateStaticStreams (_In_ UcxEndpoint *Endpoint, _In_ ULONG Count, _Outptr_ UcxStaticStreams **StreamsOut)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 10 of file pipeio.cpp.

Function Documentation

◆ UcxCreateStaticStreams()

static NTSTATUS NTAPI UcxCreateStaticStreams ( _In_ UcxEndpoint *  Endpoint,
_In_ ULONG  Count,
_Outptr_ UcxStaticStreams **  StreamsOut 
)
static

Definition at line 112 of file pipeio.cpp.

116{
117 BOOLEAN Verifying = Endpoint->m_Controller->m_DriverVerifierEnabled;
119 UcxStaticStreams* Streams;
120 ULONG Index;
122
123 *StreamsOut = NULL;
124
125 RtlZeroMemory(&Init, sizeof(Init));
126 Init.Endpoint = Endpoint->m_Handle;
127 Init.StreamCount = Count;
128
129 Status = Endpoint->m_Callbacks.StaticStreamsAdd(Endpoint->m_Handle, Count, &Init);
130 if (!NT_SUCCESS(Status))
131 {
132 DPRINT1("Endpoint %p HCD streams add failed 0x%lx\n", Endpoint->m_Handle, Status);
133 if (Init.Created != NULL)
134 WdfObjectDelete(Init.Created);
135 return Status;
136 }
137
138 /* A success without a streams object is a controller driver bug */
139 if (Init.Created == NULL)
140 {
141 DPRINT1("Endpoint %p HCD streams add created no streams object\n", Endpoint->m_Handle);
142 UcxVerifierBreak(Verifying);
144 }
145
146 Streams = UcxStaticStreams::FromHandle(Init.Created);
147 Streams->m_Init = NULL;
148
150 for (Index = 0; NT_SUCCESS(Status) && Index < Count; Index++)
151 {
152 if (!Streams->Stream(Index)->Filled)
154 }
155
156 if (!NT_SUCCESS(Status))
157 {
158 DPRINT1("Endpoint %p HCD did not set every stream, %lu set calls for %lu streams\n",
159 Endpoint->m_Handle, Init.SetInfoCalls, Count);
160 UcxVerifierBreak(Verifying);
161 WdfObjectDelete(Init.Created);
162 return Status;
163 }
164
165 *StreamsOut = Streams;
166 return STATUS_SUCCESS;
167}
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
static UcxStaticStreams * FromHandle(_In_ UCXSSTREAMS Handle)
Definition: pipe.cpp:523
UcxStream * Stream(_In_ ULONG Index)
Definition: pipe.h:373
UcxStaticStreamsInit * m_Init
Definition: pipe.h:385
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:24
_In_ UCXHUB_DEVICE_CONTEXT _In_ UCXENDPOINT Endpoint
Definition: hubucx.h:238
#define STATUS_INTERNAL_ERROR
Definition: ntstatus.h:559
#define STATUS_SUCCESS
Definition: shellext.h:65
BOOLEAN Filled
Definition: pipe.h:344
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
FORCEINLINE VOID NTAPI UcxVerifierBreak(_In_ BOOLEAN Verifying)
Definition: ucxutil.h:168
USHORT Count
Definition: userreq.cpp:200
WdfObjectDelete(String)
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by UcxEndpoint::OpenStaticStreams().

◆ UcxFailStreamsUrb()

static NTSTATUS NTAPI UcxFailStreamsUrb ( _In_ PIRP  Irp,
_In_ PURB  Urb,
_In_ NTSTATUS  Status 
)
static

Fails a streams URB on the submitting thread.

Definition at line 100 of file pipeio.cpp.

104{
106}
NTSTATUS NTAPI UcxCompleteUrb(_In_ PIRP Irp, _In_ PURB Urb, _In_ NTSTATUS Status, _In_ USBD_STATUS UsbdStatus)
Definition: clientxrb.cpp:23
_In_ PIRP Irp
Definition: kse.h:79
USBD_STATUS NTAPI UcxNtStatusToUsbdStatus(_In_ NTSTATUS Status)
Definition: urbroute.cpp:53
_In_opt_ PUSB_CONFIGURATION_DESCRIPTOR _Inout_ PUSBD_INTERFACE_LIST_ENTRY _Outptr_ PURB * Urb
Definition: usbdlib.h:333

Referenced by UcxEndpoint::CloseStaticStreams(), and UcxEndpoint::OpenStaticStreams().