INSSBuffer.GetLength (C#)

The GetLength method retrieves the size, in bytes, of an allocated buffer.


void INSSBuffer.GetLength(
  ref uint pdwLength
);

Reference to an uint containing the size of the allocated buffer in bytes.

This method does not return a value.

If this method fails, it throws an exception.

Number

Description

0x80070057

pdwLength is null.

You can use the IWMSBufferAllocatorIWMSBufferAllocator Object (C#) to allocate the buffer.

// Declare variables.
IntPtr pbBuffer;
uint pdwLength;
byte[] Bytes;

// Retrieve a pointer to the buffer and convert it to an array of bytes.
// The pBuffer pointer is user-defined.
pBuffer.GetBuffer(pbBuffer);
pBuffer.GetLength(pdwLength);
Bytes = Array.CreateInstance(GetType(byte), Convert.ToInt32(pdwLength));
Marshal.Copy(pPlsBuf, Bytes, 0, Convert.ToInt32(pdwLength));


Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

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

Show: