IDirectDrawSurface2::PageUnlock

HRESULT PageUnlock(DWORD dwFlags);

Unlocks a system memory surface, allowing it to be paged out. A lock count is maintained for each surface and is incremented each time IDirectDrawSurface2::PageLock is called for that surface. The count is decremented when IDirectDrawSurface2::PageUnlock is called. When the count reaches 0, the memory is unlocked and can then be paged by the operating system.

·Returns DD_OK if successful, or one of the following error values otherwise:

DDERR_CANTPAGEUNLOCK DDERR_INVALIDOBJECT
DDERR_INVALIDPARAMS DDERR_NOTPAGELOCKED
DDERR_SURFACELOST  

dwFlags

This parameter is not used at this time and must be set to 0.

This method only works on system memory surfaces; it will not page unlock a display memory surface or an emulated primary surface. If this method is called on a display memory surface, it will do nothing except return DD_OK.

To ensure COM compliance, this method is not a part of the IDirectDrawSurface interface, but belongs to the IDirectDrawSurface2 interface. To use this method, you must first query for the IDirectDrawSurface2 interface. For more information, see IDirectDrawSurface2 Interface.