Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SetPrivateData Method

IDirectDrawSurface7::SetPrivateData method

Associates data with the surface that is intended for use by the application, not by DirectDraw. Data is passed by value, and multiple sets of data can be associated with a single surface.

Syntax


HRESULT SetPrivateData(
  [in] REFGUID guidTag,
  [in] LPVOID  lpData,
  [in] DWORD   cbSize,
  [in] DWORD   dwFlags
);

Parameters

guidTag [in]

Reference to (C++) or address of (C) the globally unique identifier that identifies the private data to be set.

lpData [in]

A pointer to a buffer that contains the data to be associated with the surface.

cbSize [in]

The size value of the buffer at lpData, in bytes.

dwFlags [in]

A value that can be set to one of the following flags. These flags describe the type of data being passed or request that the data be invalidated when the surface changes.

(none)

If no flags are specified, DirectDraw allocates memory to hold the data within the buffer and copies the data into the new buffer. The buffer allocated by DirectDraw is automatically freed, as appropriate.

DDSPD_IUNKNOWNPOINTER

The data at lpData is a pointer to an IUnknown interface. DirectDraw automatically calls the IUnknown::AddRef method of this interface. When this data is no longer needed, DirectDraw automatically calls the IUnknown::Release method of this interface.

DDSPD_VOLATILE

The buffer at lpData is only valid while the surface remains unchanged. If the surface's contents change, subsequent calls to the IDirectDrawSurface7::GetPrivateData method return DDERR_EXPIRED.

Return value

If the method succeeds, the return value is DD_OK.

If it fails, the method can return one of the following error values:

  • DDERR_INVALIDOBJECT
  • DDERR_INVALIDPARAMS
  • DDERR_OUTOFMEMORY

Remarks

DirectDraw does not manage the memory at lpData. If this buffer was dynamically allocated, the caller must free the memory.

You must use LoadLibrary to explicitly link to Ddraw.dll and then use GetProcAddress to access the SetPrivateData method.

Requirements

Header

Ddraw.h

Library

Ddraw.lib

DLL

Ddraw.dll

See also

IDirectDrawSurface7

 

 

Community Additions

ADD
Show:
© 2015 Microsoft