HRESULT PageLock(DWORD dwFlags);
Prevents a system memory surface from being paged out while a blit using DMA transfers to or from system memory is in progress. 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.
Note The performance of the operating system could be negatively affected if too much memory is locked.
·Returns DD_OK if successful, or one of the following error values otherwise:
DDERR_CANTPAGELOCK | DDERR_INVALIDOBJECT |
DDERR_INVALIDPARAMS | 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 lock 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.