IDirectDrawSurface::Unlock (Compact 2013)

3/26/2014

This method notifies DirectDraw that the direct surface manipulations are complete.

Syntax

HRESULT Unlock(
  LPRECT lpRect
); 

Parameters

  • lpRect
    Address of the RECT structure that was used to lock the surface in the corresponding call to the IDirectDrawSurface::Lock method. This parameter can be NULL only if the entire surface was locked by passing NULL in the lpDestRect parameter of the corresponding call to the IDirectDrawSurface::Lock method.

Return Value

If the method succeeds, the return value is DD_OK.

If the method fails, the return value may be one of the following error values:

DDERR_GENERIC

DDERR_INVALIDOBJECT

DDERR_INVALIDPARAMS

DDERR_INVALIDRECT

DDERR_NOTLOCKED

DDERR_SURFACELOST

For more information on these error codes, see DirectDraw Return Values.

Sample Code

Remarks

Because it is possible to call IDirectDrawSurface::Lock multiple times for the same surface with different destination rectangles, the pointer in lpRect links the calls to the IDirectDrawSurface::Lock and IDirectDrawSurface::Unlock methods.

Requirements

Header

ddraw.h

Library

ddraw.lib

See Also

Reference

IDirectDrawSurface
DirectDraw Reference
DirectDraw Interfaces
IDirectDrawSurface::Lock

Other Resources

DirectDraw