AudRecordLib
Public Member Functions
ManagedDataBufferWrap Class Reference

#include <DataBufferWrap.h>

List of all members.

Public Member Functions

 ManagedDataBufferWrap (AudRecordCLI::IDataBuffer^ pBuffer)
HRESULT WINAPI QueryInterface (REFIID riid, PVOID *ppv)
ULONG WINAPI AddRef ()
ULONG WINAPI Release ()
HRESULT WINAPI GetLength (DWORD *pLength)
HRESULT WINAPI SetLength (DWORD newLength)
HRESULT WINAPI GetMaxLength (DWORD *pMaxLen)
HRESULT WINAPI GetBuffer (BYTE **ppBuffer)
HRESULT WINAPI GetBufferAndLength (BYTE **ppDataBuffer, DWORD *pLength)

Detailed Description

Despite its name, this is a native object. It wraps an IDataBuffer when a INSSBuffer needs to be passed to a native function. This is usually where an IDataBuffer is returned from an ITargetSink method


Constructor & Destructor Documentation

ManagedDataBufferWrap::ManagedDataBufferWrap ( AudRecordCLI::IDataBuffer pBuffer)

Constructs a native wrapper around the managed IDataBuffer

Parameters:
pBufferThe managed data buffer to track via a GCHandle

Member Function Documentation

ULONG WINAPI ManagedDataBufferWrap::AddRef ( )

Increments the objects reference count

Returns:
The new reference count
HRESULT WINAPI ManagedDataBufferWrap::GetBuffer ( BYTE **  ppBuffer)

Gets a pointer to the managed buffer and unpacks the reutrned IntPtr to a BYTE pointer that is returned in the parameter

Parameters:
[out]ppBufferA pointer that receives the data buffer pointer
Returns:
S_OK on success, E_POINTER if ppDataBuffer is NULL, or E_FAIL if the managed GetBuffer returns IntPtr::Zero
HRESULT WINAPI ManagedDataBufferWrap::GetBufferAndLength ( BYTE **  ppDataBuffer,
DWORD *  pLength 
)

Gets a pointer to the managed buffer and unpacks the reutrned IntPtr to a BYTE pointer that is returned in the parameter

Parameters:
[out]ppDataBufferA pointer that receives the data buffer pointer
[out]pLengthPointer that holds the size of the buffer on return
Returns:
S_OK on success, E_POINTER if either parameter is NULL, or E_FAIL if the managed GetBufferAndLength returns IntPtr::Zero
HRESULT WINAPI ManagedDataBufferWrap::GetLength ( DWORD *  pLength)

Queries the current number of bytes used in the buffer, set by a previous call to SetLength

Parameters:
[out]pLengthNumber of bytes used
Returns:
S_OK on success, E_POINTER if pLen is null
HRESULT WINAPI ManagedDataBufferWrap::GetMaxLength ( DWORD *  pMaxLen)

Queries the maximum number of bytes that can be used in the buffer.

Parameters:
[out]pMaxLenNumber of bytes used that can be used
Returns:
S_OK on success, E_POINTER if pLen is null
HRESULT WINAPI ManagedDataBufferWrap::QueryInterface ( REFIID  iid,
PVOID *  ppv 
)

Returns a pointer to an interface on the current object

Parameters:
iidIdentifier of the interface to return
[out]ppvPointer to a pointer that receives the interface, or NULL
Returns:
S_OK on success, E_POINTER or E_NOINtERFACE on failure
ULONG WINAPI ManagedDataBufferWrap::Release ( )

Drecreases the objects reference count

If the ref count reaches zero, the object is destroyed

Returns:
The new reference count
HRESULT WINAPI ManagedDataBufferWrap::SetLength ( DWORD  newLength)

Updates the number of bytes used in this buffer. Simply forwards the value to the managed IDataBuffer::SetLength()

Parameters:
newLengthThe new value of the number of bytes used
Returns:
Always S_OK

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Defines