IDirectDraw2::DuplicateSurface
HRESULT DuplicateSurface(LPDIRECTDRAWSURFACE lpDDSurface,
LPLPDIRECTDRAWSURFACE FAR * lplpDupDDSurface);
Duplicates a DirectDrawSurface object.
·Returns DD_OK if successful, or one of the following error values otherwise:
lpDDSurface
Address of the DirectDrawSurface structure to be duplicated.
lplpDupDDSurface
Address of the DirectDrawSurface pointer that points to the newly created duplicate DirectDrawSurface structure.
This method creates a new DirectDrawSurface object that points to the same surface memory as an existing DirectDrawSurface object. This duplicate can be used just like the original object. The surface memory is released after the last object referencing it is released. A primary surface, 3D surface, or implicitly created surface cannot be duplicated.