Partager via


IDirectDrawSurface::Unlock (Windows Embedded CE 6.0)

1/6/2010

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

An example showing the use of this function can be found in the topic How to use DirectDraw.

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
Windows Embedded CE Windows Embedded CE 6.0 and later

See Also

Reference

IDirectDrawSurface
IDirectDrawSurface::Lock