File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,7 @@ QuicRecvBufferInitialize(
273
273
{
274
274
CXPLAT_DBG_ASSERT (AllocBufferLength != 0 || RecvMode == QUIC_RECV_BUF_MODE_APP_OWNED );
275
275
CXPLAT_DBG_ASSERT (VirtualBufferLength != 0 || RecvMode == QUIC_RECV_BUF_MODE_APP_OWNED );
276
+ CXPLAT_DBG_ASSERT (PreallocatedChunk == NULL || RecvMode != QUIC_RECV_BUF_MODE_APP_OWNED );
276
277
CXPLAT_DBG_ASSERT ((AllocBufferLength & (AllocBufferLength - 1 )) == 0 ); // Power of 2
277
278
CXPLAT_DBG_ASSERT ((VirtualBufferLength & (VirtualBufferLength - 1 )) == 0 ); // Power of 2
278
279
CXPLAT_DBG_ASSERT (AllocBufferLength <= VirtualBufferLength );
Original file line number Diff line number Diff line change @@ -105,7 +105,8 @@ typedef struct QUIC_RECV_BUFFER {
105
105
//
106
106
// Initialize a QUIC_RECV_BUFFER.
107
107
// Can only fail if PreallocatedChunk == NULL && RecvMode != QUIC_RECV_BUF_MODE_APP_OWNED.
108
- // PreallocatedChunk is owned by the caller and must be freed afte the buffer is uninitialized.
108
+ // PreallocatedChunk ownership is given to the receive buffer.
109
+ // PreallocatedChunk must be null if RecvMode == QUIC_RECV_BUF_MODE_APP_OWNED.
109
110
//
110
111
_IRQL_requires_max_ (DISPATCH_LEVEL )
111
112
QUIC_STATUS
Original file line number Diff line number Diff line change @@ -312,6 +312,11 @@ TEST_P(WithMode, Alloc)
312
312
TEST_P (WithMode, AllocWithChunk)
313
313
{
314
314
RecvBuffer RecvBuf;
315
+ const auto Mode = GetParam ();
316
+ if (Mode == QUIC_RECV_BUF_MODE_APP_OWNED) {
317
+ // App-owned mode doesn't support preallocated chunks
318
+ return ;
319
+ }
315
320
ASSERT_EQ (QUIC_STATUS_SUCCESS, RecvBuf.Initialize (GetParam (), true ));
316
321
}
317
322
You can’t perform that action at this time.
0 commit comments