TSDuck v3.46-4819
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::SChannelBuffer Class Reference

SChannel input/output buffers and their descriptors (Windows-specific). More...

#include <tsSChannelBuffer.h>

Public Member Functions

 SChannelBuffer (size_t max_buffers)
 Constructor.
 
void add (unsigned long type, void *buffer=nullptr, size_t bufsize=0)
 Add the description of a new buffer.
 
size_t currentSize () const
 Get the current number of used buffers.
 
::SecBufferDesc * desc ()
 Get the address of the buffer descriptor, typically for an SChannel call.
 
void freeContextBuffer ()
 Properly free and clear TLS buffers, when allocated by InitializeSecurityContext or AcceptSecurityContext.
 
::SecBuffer * get (unsigned long type)
 Search the first buffer of a given type.
 
size_t maxSize () const
 Get the maximum number of buffers.
 
void reset ()
 Reset the list of buffers, before a sequence of add();.
 
void resize (size_t max_buffers)
 Resize the number of buffers.
 
size_t totalBufferSize () const
 Get the total size in bytes of used buffers.
 

Static Public Member Functions

static const Names & TypeNames ()
 Get names for SChannel buffer bytes.
 

Detailed Description

SChannel input/output buffers and their descriptors (Windows-specific).

This class encapsulates an array of SecBuffer and its associated SecBufferDesc.

Constructor & Destructor Documentation

◆ SChannelBuffer()

ts::SChannelBuffer::SChannelBuffer ( size_t  max_buffers)

Constructor.

Parameters
[in]max_buffersMaximum number of input/output buffers.

Member Function Documentation

◆ resize()

void ts::SChannelBuffer::resize ( size_t  max_buffers)

Resize the number of buffers.

All previously returned SecBuffer addresses are invalidated.

Parameters
[in]max_buffersMaximum number of input/output buffers.

◆ maxSize()

size_t ts::SChannelBuffer::maxSize ( ) const
inline

Get the maximum number of buffers.

Returns
The maximum number of buffers.

◆ currentSize()

size_t ts::SChannelBuffer::currentSize ( ) const
inline

Get the current number of used buffers.

Returns
The current number of buffers.

◆ totalBufferSize()

size_t ts::SChannelBuffer::totalBufferSize ( ) const

Get the total size in bytes of used buffers.

Returns
The total size in bytes of used buffers.

◆ add()

void ts::SChannelBuffer::add ( unsigned long  type,
void *  buffer = nullptr,
size_t  bufsize = 0 
)

Add the description of a new buffer.

Throw std::out_of_range if there is no more free buffer.

Parameters
[in]typeThe channel type.
[in]bufferBuffer address.
[in]bufsizeBuffer size in bytes.

◆ desc()

::SecBufferDesc * ts::SChannelBuffer::desc ( )
inline

Get the address of the buffer descriptor, typically for an SChannel call.

Returns
Address of the buffer descriptor.

◆ get()

::SecBuffer * ts::SChannelBuffer::get ( unsigned long  type)

Search the first buffer of a given type.

Parameters
[in]typeThe channel type to search.
Returns
Address of the first buffer of type type or the null pointer if there is none.

◆ TypeNames()

static const Names & ts::SChannelBuffer::TypeNames ( )
static

Get names for SChannel buffer bytes.

Returns
A constant reference to the Names instance.

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