INSSBuffer::GetBufferAndLength

banner art

Previous Next

INSSBuffer::GetBufferAndLength

The GetBufferAndLength method retrieves the allocated buffer and the length of the data segment that can be loaded into it.

Syntax

  HRESULT GetBufferAndLength(
  BYTE**  ppdwBuffer,
  DWORD*  pdwLength
);

Parameters

ppdwBuffer

[out] Pointer to a pointer to the allocated buffer.

pdwLength

[out] Pointer to a DWORD containing the size of the allocated buffer in bytes.

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Return code Number Description
E_INVALIDARG 0x80070057 One or both parameters is NULL.

Remarks

You can use the IWMSBufferAllocator interface to allocate the buffer.

Example Code

#include <windows.h>
#include "wmsserver.h"

// Declare variables.
BYTE *pbBuffer = NULL;
DWORD cbBuffer = 0;

// Retrieve a pointer to the buffer and the length of
// the buffer. The pBuffer pointer is user-defined.
hr = pBuffer->GetBufferAndLength( &pbBuffer, &cbBuffer );
if (FAILED(hr)) goto EXIT;

EXIT:
    // TODO: Release temporary objects.

Requirements

Header: Include wmsbuffer.h, wmsserver.h.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003, Enterprise Edition; Windows Server 2003, Datacenter Edition; Windows Server 2008.

See Also

Previous Next