wined3d: Consistently use Map/Unmap for mapping resources.

This commit is contained in:
Henri Verbeet 2010-10-14 13:04:02 +02:00 committed by Alexandre Julliard
parent 0d4e0bc9ba
commit 95469309d6
21 changed files with 166 additions and 188 deletions

View File

@ -284,7 +284,8 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(LPDIRECT3DCUBETEXTURE8
iface, FaceType, Level, pLockedRect, pRect, Flags);
wined3d_mutex_lock();
hr = IWineD3DCubeTexture_LockRect(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES) FaceType, Level, (WINED3DLOCKED_RECT *) pLockedRect, pRect, Flags);
hr = IWineD3DCubeTexture_Map(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES)FaceType,
Level, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock();
return hr;
@ -297,7 +298,7 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_UnlockRect(LPDIRECT3DCUBETEXTURE
TRACE("iface %p, face %#x, level %u.\n", iface, FaceType, Level);
wined3d_mutex_lock();
hr = IWineD3DCubeTexture_UnlockRect(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES) FaceType, Level);
hr = IWineD3DCubeTexture_Unmap(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES)FaceType, Level);
wined3d_mutex_unlock();
return hr;

View File

@ -233,7 +233,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D
}
}
hr = IWineD3DSurface_LockRect(This->wineD3DSurface, (WINED3DLOCKED_RECT *) pLockedRect, pRect, Flags);
hr = IWineD3DSurface_Map(This->wineD3DSurface, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock();
return hr;
@ -246,7 +246,7 @@ static HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface)
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
hr = IWineD3DSurface_UnlockRect(This->wineD3DSurface);
hr = IWineD3DSurface_Unmap(This->wineD3DSurface);
wined3d_mutex_unlock();
switch(hr)

View File

@ -281,7 +281,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_LockRect(LPDIRECT3DTEXTURE8 iface, U
iface, Level, pLockedRect, pRect, Flags);
wined3d_mutex_lock();
hr = IWineD3DTexture_LockRect(This->wineD3DTexture, Level, (WINED3DLOCKED_RECT *) pLockedRect, pRect, Flags);
hr = IWineD3DTexture_Map(This->wineD3DTexture, Level, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock();
return hr;
@ -294,7 +294,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_UnlockRect(LPDIRECT3DTEXTURE8 iface,
TRACE("iface %p, level %u.\n", iface, Level);
wined3d_mutex_lock();
hr = IWineD3DTexture_UnlockRect(This->wineD3DTexture, Level);
hr = IWineD3DTexture_Unmap(This->wineD3DTexture, Level);
wined3d_mutex_unlock();
return hr;

View File

@ -205,7 +205,8 @@ static HRESULT WINAPI IDirect3DVolume8Impl_LockBox(LPDIRECT3DVOLUME8 iface, D3DL
iface, pLockedVolume, pBox, Flags);
wined3d_mutex_lock();
hr = IWineD3DVolume_LockBox(This->wineD3DVolume, (WINED3DLOCKED_BOX *) pLockedVolume, (CONST WINED3DBOX *) pBox, Flags);
hr = IWineD3DVolume_Map(This->wineD3DVolume, (WINED3DLOCKED_BOX *)pLockedVolume,
(const WINED3DBOX *)pBox, Flags);
wined3d_mutex_unlock();
return hr;
@ -218,7 +219,7 @@ static HRESULT WINAPI IDirect3DVolume8Impl_UnlockBox(LPDIRECT3DVOLUME8 iface) {
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
hr = IWineD3DVolume_UnlockBox(This->wineD3DVolume);
hr = IWineD3DVolume_Unmap(This->wineD3DVolume);
wined3d_mutex_unlock();
return hr;

View File

@ -281,7 +281,8 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTUR
iface, Level, pLockedVolume, pBox, Flags);
wined3d_mutex_lock();
hr = IWineD3DVolumeTexture_LockBox(This->wineD3DVolumeTexture, Level, (WINED3DLOCKED_BOX *) pLockedVolume, (CONST WINED3DBOX *) pBox, Flags);
hr = IWineD3DVolumeTexture_Map(This->wineD3DVolumeTexture, Level,
(WINED3DLOCKED_BOX *)pLockedVolume, (const WINED3DBOX *)pBox, Flags);
wined3d_mutex_unlock();
return hr;
@ -294,7 +295,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(LPDIRECT3DVOLUMETEXT
TRACE("iface %p, level %u.\n", iface, Level);
wined3d_mutex_lock();
hr = IWineD3DVolumeTexture_UnlockBox(This->wineD3DVolumeTexture, Level);
hr = IWineD3DVolumeTexture_Unmap(This->wineD3DVolumeTexture, Level);
wined3d_mutex_unlock();
return hr;

View File

@ -323,7 +323,8 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_LockRect(LPDIRECT3DCUBETEXTURE9
iface, FaceType, Level, pLockedRect, pRect, Flags);
wined3d_mutex_lock();
hr = IWineD3DCubeTexture_LockRect(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES) FaceType, Level, (WINED3DLOCKED_RECT *) pLockedRect, pRect, Flags);
hr = IWineD3DCubeTexture_Map(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES)FaceType,
Level, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock();
return hr;
@ -336,7 +337,7 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_UnlockRect(LPDIRECT3DCUBETEXTURE
TRACE("iface %p, face %#x, level %u.\n", iface, FaceType, Level);
wined3d_mutex_lock();
hr = IWineD3DCubeTexture_UnlockRect(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES) FaceType, Level);
hr = IWineD3DCubeTexture_Unmap(This->wineD3DCubeTexture, (WINED3DCUBEMAP_FACES)FaceType, Level);
wined3d_mutex_unlock();
return hr;

View File

@ -272,7 +272,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_LockRect(LPDIRECT3DSURFACE9 iface, D
TRACE("iface %p, locked_rect %p, rect %p, flags %#x.\n", iface, pLockedRect, pRect, Flags);
wined3d_mutex_lock();
hr = IWineD3DSurface_LockRect(This->wineD3DSurface, (WINED3DLOCKED_RECT *) pLockedRect, pRect, Flags);
hr = IWineD3DSurface_Map(This->wineD3DSurface, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock();
return hr;
@ -285,7 +285,7 @@ static HRESULT WINAPI IDirect3DSurface9Impl_UnlockRect(LPDIRECT3DSURFACE9 iface)
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
hr = IWineD3DSurface_UnlockRect(This->wineD3DSurface);
hr = IWineD3DSurface_Unmap(This->wineD3DSurface);
wined3d_mutex_unlock();
switch(hr)

View File

@ -319,7 +319,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_LockRect(LPDIRECT3DTEXTURE9 iface, U
iface, Level, pLockedRect, pRect, Flags);
wined3d_mutex_lock();
hr = IWineD3DTexture_LockRect(This->wineD3DTexture, Level, (WINED3DLOCKED_RECT *) pLockedRect, pRect, Flags);
hr = IWineD3DTexture_Map(This->wineD3DTexture, Level, (WINED3DLOCKED_RECT *)pLockedRect, pRect, Flags);
wined3d_mutex_unlock();
return hr;
@ -332,7 +332,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_UnlockRect(LPDIRECT3DTEXTURE9 iface,
TRACE("iface %p, level %u.\n", iface, Level);
wined3d_mutex_lock();
hr = IWineD3DTexture_UnlockRect(This->wineD3DTexture, Level);
hr = IWineD3DTexture_Unmap(This->wineD3DTexture, Level);
wined3d_mutex_unlock();
return hr;

View File

@ -212,7 +212,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_LockBox(LPDIRECT3DVOLUME9 iface, D3DL
wined3d_mutex_lock();
hr = IWineD3DVolume_LockBox(This->wineD3DVolume, (WINED3DLOCKED_BOX *)pLockedVolume,
hr = IWineD3DVolume_Map(This->wineD3DVolume, (WINED3DLOCKED_BOX *)pLockedVolume,
(const WINED3DBOX *)pBox, Flags);
wined3d_mutex_unlock();
@ -228,7 +228,7 @@ static HRESULT WINAPI IDirect3DVolume9Impl_UnlockBox(LPDIRECT3DVOLUME9 iface) {
wined3d_mutex_lock();
hr = IWineD3DVolume_UnlockBox(This->wineD3DVolume);
hr = IWineD3DVolume_Unmap(This->wineD3DVolume);
wined3d_mutex_unlock();

View File

@ -348,8 +348,8 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_LockBox(LPDIRECT3DVOLUMETEXTUR
wined3d_mutex_lock();
hr = IWineD3DVolumeTexture_LockBox(This->wineD3DVolumeTexture, Level, (WINED3DLOCKED_BOX *)pLockedVolume,
(const WINED3DBOX *)pBox, Flags);
hr = IWineD3DVolumeTexture_Map(This->wineD3DVolumeTexture, Level,
(WINED3DLOCKED_BOX *)pLockedVolume, (const WINED3DBOX *)pBox, Flags);
wined3d_mutex_unlock();
@ -364,7 +364,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_UnlockBox(LPDIRECT3DVOLUMETEXT
wined3d_mutex_lock();
hr = IWineD3DVolumeTexture_UnlockBox(This->wineD3DVolumeTexture, Level);
hr = IWineD3DVolumeTexture_Unmap(This->wineD3DVolumeTexture, Level);
wined3d_mutex_unlock();

View File

@ -679,11 +679,8 @@ static HRESULT WINAPI ddraw_surface7_Lock(IDirectDrawSurface7 *iface,
}
}
hr = IWineD3DSurface_LockRect(This->WineD3DSurface,
&LockedRect,
Rect,
Flags);
if(hr != D3D_OK)
hr = IWineD3DSurface_Map(This->WineD3DSurface, &LockedRect, Rect, Flags);
if (FAILED(hr))
{
LeaveCriticalSection(&ddraw_cs);
switch(hr)
@ -744,8 +741,8 @@ static HRESULT WINAPI ddraw_surface7_Unlock(IDirectDrawSurface7 *iface, RECT *pR
TRACE("iface %p, rect %s.\n", iface, wine_dbgstr_rect(pRect));
EnterCriticalSection(&ddraw_cs);
hr = IWineD3DSurface_UnlockRect(This->WineD3DSurface);
if(SUCCEEDED(hr))
hr = IWineD3DSurface_Unmap(This->WineD3DSurface);
if (SUCCEEDED(hr))
{
This->surface_desc.lpSurface = NULL;
}
@ -3297,7 +3294,7 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
/* Copy the main memory texture into the surface that corresponds
* to the OpenGL texture object. */
hr = IWineD3DSurface_LockRect(src_surface->WineD3DSurface, &src_rect, NULL, 0);
hr = IWineD3DSurface_Map(src_surface->WineD3DSurface, &src_rect, NULL, 0);
if (FAILED(hr))
{
ERR("Failed to lock source surface, hr %#x.\n", hr);
@ -3305,11 +3302,11 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
return D3DERR_TEXTURE_LOAD_FAILED;
}
hr = IWineD3DSurface_LockRect(dst_surface->WineD3DSurface, &dst_rect, NULL, 0);
hr = IWineD3DSurface_Map(dst_surface->WineD3DSurface, &dst_rect, NULL, 0);
if (FAILED(hr))
{
ERR("Failed to lock destination surface, hr %#x.\n", hr);
IWineD3DSurface_UnlockRect(src_surface->WineD3DSurface);
IWineD3DSurface_Unmap(src_surface->WineD3DSurface);
LeaveCriticalSection(&ddraw_cs);
return D3DERR_TEXTURE_LOAD_FAILED;
}
@ -3319,8 +3316,8 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
else
memcpy(dst_rect.pBits, src_rect.pBits, src_rect.Pitch * src_desc->dwHeight);
IWineD3DSurface_UnlockRect(src_surface->WineD3DSurface);
IWineD3DSurface_UnlockRect(dst_surface->WineD3DSurface);
IWineD3DSurface_Unmap(src_surface->WineD3DSurface);
IWineD3DSurface_Unmap(dst_surface->WineD3DSurface);
}
if (src_surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_MIPMAP)

View File

@ -358,7 +358,7 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_GetCubeMapSurface(IWineD3DCubeText
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DCubeTextureImpl_LockRect(IWineD3DCubeTexture *iface,
static HRESULT WINAPI IWineD3DCubeTextureImpl_Map(IWineD3DCubeTexture *iface,
WINED3DCUBEMAP_FACES face, UINT level, WINED3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
{
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
@ -373,10 +373,10 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_LockRect(IWineD3DCubeTexture *ifac
return WINED3DERR_INVALIDCALL;
}
return IWineD3DSurface_LockRect(surface, locked_rect, rect, flags);
return IWineD3DSurface_Map(surface, locked_rect, rect, flags);
}
static HRESULT WINAPI IWineD3DCubeTextureImpl_UnlockRect(IWineD3DCubeTexture *iface,
static HRESULT WINAPI IWineD3DCubeTextureImpl_Unmap(IWineD3DCubeTexture *iface,
WINED3DCUBEMAP_FACES face, UINT level)
{
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
@ -391,7 +391,7 @@ static HRESULT WINAPI IWineD3DCubeTextureImpl_UnlockRect(IWineD3DCubeTexture *if
return WINED3DERR_INVALIDCALL;
}
return IWineD3DSurface_UnlockRect(surface);
return IWineD3DSurface_Unmap(surface);
}
static HRESULT WINAPI IWineD3DCubeTextureImpl_AddDirtyRect(IWineD3DCubeTexture *iface,
@ -446,8 +446,8 @@ static const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl =
/* IWineD3DCubeTexture */
IWineD3DCubeTextureImpl_GetLevelDesc,
IWineD3DCubeTextureImpl_GetCubeMapSurface,
IWineD3DCubeTextureImpl_LockRect,
IWineD3DCubeTextureImpl_UnlockRect,
IWineD3DCubeTextureImpl_Map,
IWineD3DCubeTextureImpl_Unmap,
IWineD3DCubeTextureImpl_AddDirtyRect
};

View File

@ -4918,22 +4918,23 @@ static HRESULT IWineD3DDeviceImpl_UpdateVolume(IWineD3DDevice *iface,
/* TODO: Implement direct loading into the gl volume instead of using memcpy and
* dirtification to improve loading performance.
*/
hr = IWineD3DVolume_LockBox(pSourceVolume, &src, NULL, WINED3DLOCK_READONLY);
if(FAILED(hr)) return hr;
hr = IWineD3DVolume_LockBox(pDestinationVolume, &dst, NULL, WINED3DLOCK_DISCARD);
if(FAILED(hr)) {
IWineD3DVolume_UnlockBox(pSourceVolume);
return hr;
hr = IWineD3DVolume_Map(pSourceVolume, &src, NULL, WINED3DLOCK_READONLY);
if (FAILED(hr)) return hr;
hr = IWineD3DVolume_Map(pDestinationVolume, &dst, NULL, WINED3DLOCK_DISCARD);
if (FAILED(hr))
{
IWineD3DVolume_Unmap(pSourceVolume);
return hr;
}
memcpy(dst.pBits, src.pBits, ((IWineD3DVolumeImpl *) pDestinationVolume)->resource.size);
hr = IWineD3DVolume_UnlockBox(pDestinationVolume);
if(FAILED(hr)) {
IWineD3DVolume_UnlockBox(pSourceVolume);
} else {
hr = IWineD3DVolume_UnlockBox(pSourceVolume);
}
hr = IWineD3DVolume_Unmap(pDestinationVolume);
if (FAILED(hr))
IWineD3DVolume_Unmap(pSourceVolume);
else
hr = IWineD3DVolume_Unmap(pSourceVolume);
return hr;
}
@ -5827,7 +5828,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
*/
This->cursorWidth = s->currentDesc.Width;
This->cursorHeight = s->currentDesc.Height;
if (SUCCEEDED(IWineD3DSurface_LockRect(cursor_image, &rect, NULL, WINED3DLOCK_READONLY)))
if (SUCCEEDED(IWineD3DSurface_Map(cursor_image, &rect, NULL, WINED3DLOCK_READONLY)))
{
const struct wined3d_gl_info *gl_info = &This->adapter->gl_info;
const struct wined3d_format *format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM);
@ -5847,7 +5848,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
mem = HeapAlloc(GetProcessHeap(), 0, width * height * bpp);
for(i = 0; i < height; i++)
memcpy(&mem[width * bpp * i], &bits[rect.Pitch * i], width * bpp);
IWineD3DSurface_UnlockRect(cursor_image);
IWineD3DSurface_Unmap(cursor_image);
context = context_acquire(This, NULL);
@ -5903,7 +5904,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
* chunks. */
DWORD *maskBits = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
(s->currentDesc.Width * s->currentDesc.Height / 8));
IWineD3DSurface_LockRect(cursor_image, &lockedRect, NULL,
IWineD3DSurface_Map(cursor_image, &lockedRect, NULL,
WINED3DLOCK_NO_DIRTY_UPDATE | WINED3DLOCK_READONLY);
TRACE("width: %u height: %u.\n", s->currentDesc.Width, s->currentDesc.Height);
@ -5912,7 +5913,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice *ifa
cursorInfo.yHotspot = YHotSpot;
cursorInfo.hbmMask = CreateBitmap(s->currentDesc.Width, s->currentDesc.Height, 1, 1, maskBits);
cursorInfo.hbmColor = CreateBitmap(s->currentDesc.Width, s->currentDesc.Height, 1, 32, lockedRect.pBits);
IWineD3DSurface_UnlockRect(cursor_image);
IWineD3DSurface_Unmap(cursor_image);
/* Create our cursor and clean up. */
cursor = CreateIconIndirect(&cursorInfo);
SetCursor(cursor);

View File

@ -1268,11 +1268,6 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, const RECT *rect, v
return;
}
/* Activate the surface. Set it up for blitting now, although not necessarily needed for LockRect.
* Certain graphics drivers seem to dislike some enabled states when reading from opengl, the blitting usage
* should help here. Furthermore unlockrect will need the context set up for blitting. The context manager will find
* context->last_was_blit set on the unlock.
*/
context = context_acquire(device, This);
context_apply_blit_state(context, device);
gl_info = context->gl_info;
@ -1285,10 +1280,9 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, const RECT *rect, v
*/
if (surface_is_offscreen(This))
{
/* Locking the primary render target which is not on a swapchain(=offscreen render target).
* Read from the back buffer
*/
TRACE("Locking offscreen render target\n");
/* Mapping the primary render target which is not on a swapchain.
* Read from the back buffer. */
TRACE("Mapping offscreen render target.\n");
glReadBuffer(device->offscreenBuffer);
srcIsUpsideDown = TRUE;
}
@ -1296,7 +1290,7 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, const RECT *rect, v
{
/* Onscreen surfaces are always part of a swapchain */
GLenum buffer = surface_get_gl_buffer(This);
TRACE("Locking %#x buffer\n", buffer);
TRACE("Mapping %#x buffer.\n", buffer);
glReadBuffer(buffer);
checkGLcall("glReadBuffer");
srcIsUpsideDown = FALSE;
@ -1647,7 +1641,9 @@ static void surface_prepare_system_memory(IWineD3DSurfaceImpl *This)
}
}
static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags) {
static HRESULT WINAPI IWineD3DSurfaceImpl_Map(IWineD3DSurface *iface,
WINED3DLOCKED_RECT *pLockedRect, const RECT *pRect, DWORD Flags)
{
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
IWineD3DDeviceImpl *device = This->resource.device;
const RECT *pass_rect = pRect;
@ -1746,7 +1742,7 @@ lock_end:
}
}
return IWineD3DBaseSurfaceImpl_LockRect(iface, pLockedRect, pRect, Flags);
return IWineD3DBaseSurfaceImpl_Map(iface, pLockedRect, pRect, Flags);
}
static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fmt, GLenum type, UINT bpp, const BYTE *mem) {
@ -1846,7 +1842,8 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fm
context_release(context);
}
static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
static HRESULT WINAPI IWineD3DSurfaceImpl_Unmap(IWineD3DSurface *iface)
{
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
IWineD3DDeviceImpl *device = This->resource.device;
BOOL fullsurface;
@ -1917,13 +1914,16 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
break;
}
if(!fullsurface) {
/* Partial rectangle tracking is not commonly implemented, it is only done for render targets. Overwrite
* the flags to bring them back into a sane state. INSYSMEM was set before to tell LoadLocation where
* to read the rectangle from. Indrawable is set because all modifications from the partial sysmem copy
* are written back to the drawable, thus the surface is merged again in the drawable. The sysmem copy is
* not fully up to date because only a subrectangle was read in LockRect.
*/
if (!fullsurface)
{
/* Partial rectangle tracking is not commonly implemented, it is
* only done for render targets. Overwrite the flags to bring
* them back into a sane state. INSYSMEM was set before to tell
* surface_load_location() where to read the rectangle from.
* Indrawable is set because all modifications from the partial
* sysmem copy are written back to the drawable, thus the surface
* is merged again in the drawable. The sysmem copy is not fully
* up to date because only a subrectangle was read in Map(). */
This->Flags &= ~SFLAG_INSYSMEM;
This->Flags |= SFLAG_INDRAWABLE;
}
@ -2031,19 +2031,17 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
This->resource.allocatedMemory = This->dib.bitmap_data;
}
/* Lock the surface */
hr = IWineD3DSurface_LockRect(iface,
&lock,
NULL,
0);
/* Map the surface */
hr = IWineD3DSurface_Map(iface, &lock, NULL, 0);
if(This->Flags & SFLAG_PBO) {
/* Sync the DIB with the PBO. This can't be done earlier because LockRect activates the allocatedMemory */
/* Sync the DIB with the PBO. This can't be done earlier because Map()
* activates the allocatedMemory. */
if (This->Flags & SFLAG_PBO)
memcpy(This->dib.bitmap_data, This->resource.allocatedMemory, This->dib.bitmap_size);
}
if(FAILED(hr)) {
ERR("IWineD3DSurface_LockRect failed with hr = %08x\n", hr);
if (FAILED(hr))
{
ERR("IWineD3DSurface_Map failed, hr %#x.\n", hr);
/* keep the dib section */
return hr;
}
@ -2105,7 +2103,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC
}
/* we locked first, so unlock now */
IWineD3DSurface_UnlockRect(iface);
IWineD3DSurface_Unmap(iface);
This->Flags &= ~SFLAG_DCINUSE;
@ -2649,8 +2647,10 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *M
/* Now free the old memory if any */
HeapFree(GetProcessHeap(), 0, release);
} else if(This->Flags & SFLAG_USERPTR) {
/* LockRect and GetDC will re-create the dib section and allocated memory */
}
else if (This->Flags & SFLAG_USERPTR)
{
/* Map and GetDC will re-create the dib section and allocated memory. */
This->resource.allocatedMemory = NULL;
/* HeapMemory should be NULL already */
if (This->resource.heapMemory)
@ -4732,8 +4732,8 @@ const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl =
IWineD3DBaseSurfaceImpl_GetType,
/* IWineD3DSurface */
IWineD3DBaseSurfaceImpl_GetDesc,
IWineD3DSurfaceImpl_LockRect,
IWineD3DSurfaceImpl_UnlockRect,
IWineD3DSurfaceImpl_Map,
IWineD3DSurfaceImpl_Unmap,
IWineD3DSurfaceImpl_GetDC,
IWineD3DSurfaceImpl_ReleaseDC,
IWineD3DSurfaceImpl_Flip,

View File

@ -823,16 +823,18 @@ static IWineD3DSurfaceImpl *surface_convert_format(IWineD3DSurfaceImpl *source,
memset(&lock_src, 0, sizeof(lock_src));
memset(&lock_dst, 0, sizeof(lock_dst));
hr = IWineD3DSurface_LockRect((IWineD3DSurface *) source, &lock_src, NULL, WINED3DLOCK_READONLY);
if(FAILED(hr)) {
ERR("Failed to lock the source surface\n");
hr = IWineD3DSurface_Map((IWineD3DSurface *)source, &lock_src, NULL, WINED3DLOCK_READONLY);
if (FAILED(hr))
{
ERR("Failed to lock the source surface.\n");
IWineD3DSurface_Release(ret);
return NULL;
}
hr = IWineD3DSurface_LockRect(ret, &lock_dst, NULL, WINED3DLOCK_READONLY);
if(FAILED(hr)) {
hr = IWineD3DSurface_Map(ret, &lock_dst, NULL, WINED3DLOCK_READONLY);
if (FAILED(hr))
{
ERR("Failed to lock the dest surface\n");
IWineD3DSurface_UnlockRect((IWineD3DSurface *) source);
IWineD3DSurface_Unmap((IWineD3DSurface *)source);
IWineD3DSurface_Release(ret);
return NULL;
}
@ -840,8 +842,8 @@ static IWineD3DSurfaceImpl *surface_convert_format(IWineD3DSurfaceImpl *source,
conv->convert(lock_src.pBits, lock_dst.pBits, lock_src.Pitch, lock_dst.Pitch,
source->currentDesc.Width, source->currentDesc.Height);
IWineD3DSurface_UnlockRect(ret);
IWineD3DSurface_UnlockRect((IWineD3DSurface *) source);
IWineD3DSurface_Unmap(ret);
IWineD3DSurface_Unmap((IWineD3DSurface *)source);
return (IWineD3DSurfaceImpl *) ret;
}
@ -1093,7 +1095,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *D
if (src == This)
{
IWineD3DSurface_LockRect(iface, &dlock, NULL, 0);
IWineD3DSurface_Map(iface, &dlock, NULL, 0);
slock = dlock;
sEntry = This->resource.format;
dEntry = sEntry;
@ -1113,7 +1115,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *D
goto release;
}
}
IWineD3DSurface_LockRect((IWineD3DSurface *)src, &slock, NULL, WINED3DLOCK_READONLY);
IWineD3DSurface_Map((IWineD3DSurface *)src, &slock, NULL, WINED3DLOCK_READONLY);
sEntry = src->resource.format;
}
else
@ -1121,9 +1123,9 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *D
sEntry = dEntry;
}
if (DestRect)
IWineD3DSurface_LockRect(iface, &dlock, &xdst, 0);
IWineD3DSurface_Map(iface, &dlock, &xdst, 0);
else
IWineD3DSurface_LockRect(iface, &dlock, NULL, 0);
IWineD3DSurface_Map(iface, &dlock, NULL, 0);
}
if (!DDBltFx || !(DDBltFx->dwDDFX)) Flags &= ~WINEDDBLT_DDFX;
@ -1523,8 +1525,8 @@ error:
}
release:
IWineD3DSurface_UnlockRect(iface);
if (src && src != This) IWineD3DSurface_UnlockRect((IWineD3DSurface *)src);
IWineD3DSurface_Unmap(iface);
if (src && src != This) IWineD3DSurface_Unmap((IWineD3DSurface *)src);
/* Release the converted surface if any */
if (src && src_surface != (IWineD3DSurface *)src) IWineD3DSurface_Release((IWineD3DSurface *)src);
return ret;
@ -1624,8 +1626,8 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dst
UnionRect(&lock_union, &lock_src, &lock_dst);
/* Lock the union of the two rectangles */
ret = IWineD3DSurface_LockRect(iface, &dlock, &lock_union, 0);
if(ret != WINED3D_OK) goto error;
ret = IWineD3DSurface_Map(iface, &dlock, &lock_union, 0);
if (FAILED(ret)) goto error;
pitch = dlock.Pitch;
slock.Pitch = dlock.Pitch;
@ -1638,10 +1640,10 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dst
}
else
{
ret = IWineD3DSurface_LockRect(src_surface, &slock, &lock_src, WINED3DLOCK_READONLY);
if(ret != WINED3D_OK) goto error;
ret = IWineD3DSurface_LockRect(iface, &dlock, &lock_dst, 0);
if(ret != WINED3D_OK) goto error;
ret = IWineD3DSurface_Map(src_surface, &slock, &lock_src, WINED3DLOCK_READONLY);
if (FAILED(ret)) goto error;
ret = IWineD3DSurface_Map(iface, &dlock, &lock_dst, 0);
if (FAILED(ret)) goto error;
sbuf = slock.pBits;
dbuf = dlock.pBits;
@ -1795,18 +1797,19 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dst
error:
if (src == This)
{
IWineD3DSurface_UnlockRect(iface);
IWineD3DSurface_Unmap(iface);
}
else
{
IWineD3DSurface_UnlockRect(iface);
IWineD3DSurface_UnlockRect(src_surface);
IWineD3DSurface_Unmap(iface);
IWineD3DSurface_Unmap(src_surface);
}
return ret;
}
HRESULT WINAPI IWineD3DBaseSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags)
HRESULT WINAPI IWineD3DBaseSurfaceImpl_Map(IWineD3DSurface *iface,
WINED3DLOCKED_RECT *pLockedRect, const RECT *pRect, DWORD Flags)
{
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;

View File

@ -109,26 +109,8 @@ static void WINAPI IWineGDISurfaceImpl_UnLoad(IWineD3DSurface *iface)
ERR("(%p): Please report to wine-devel\n", iface);
}
/*****************************************************************************
* IWineD3DSurface::LockRect, GDI version
*
* Locks the surface and returns a pointer to the surface memory
*
* Params:
* pLockedRect: Address to return the locking info at
* pRect: Rectangle to lock
* Flags: Some flags
*
* Returns:
* WINED3D_OK on success
* WINED3DERR_INVALIDCALL on errors
*
*****************************************************************************/
static HRESULT WINAPI
IWineGDISurfaceImpl_LockRect(IWineD3DSurface *iface,
WINED3DLOCKED_RECT* pLockedRect,
CONST RECT* pRect,
DWORD Flags)
static HRESULT WINAPI IWineGDISurfaceImpl_Map(IWineD3DSurface *iface,
WINED3DLOCKED_RECT *pLockedRect, const RECT *pRect, DWORD Flags)
{
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
@ -149,29 +131,17 @@ IWineGDISurfaceImpl_LockRect(IWineD3DSurface *iface,
This->resource.allocatedMemory = This->dib.bitmap_data;
}
return IWineD3DBaseSurfaceImpl_LockRect(iface, pLockedRect, pRect, Flags);
return IWineD3DBaseSurfaceImpl_Map(iface, pLockedRect, pRect, Flags);
}
/*****************************************************************************
* IWineD3DSurface::UnlockRect, GDI version
*
* Unlocks a surface. This implementation doesn't do much, except updating
* the window if the front buffer is unlocked
*
* Returns:
* WINED3D_OK on success
* WINED3DERR_INVALIDCALL on failure
*
*****************************************************************************/
static HRESULT WINAPI
IWineGDISurfaceImpl_UnlockRect(IWineD3DSurface *iface)
static HRESULT WINAPI IWineGDISurfaceImpl_Unmap(IWineD3DSurface *iface)
{
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
TRACE("(%p)\n", This);
if (!(This->Flags & SFLAG_LOCKED))
{
WARN("trying to Unlock an unlocked surf@%p\n", This);
WARN("Trying to unmap unmapped surfaces %p.\n", iface);
return WINEDDERR_NOTLOCKED;
}
@ -278,13 +248,11 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
/* Should have a DIB section already */
/* Lock the surface */
hr = IWineD3DSurface_LockRect(iface,
&lock,
NULL,
0);
if(FAILED(hr)) {
ERR("IWineD3DSurface_LockRect failed with hr = %08x\n", hr);
/* Map the surface. */
hr = IWineD3DSurface_Map(iface, &lock, NULL, 0);
if (FAILED(hr))
{
ERR("IWineD3DSurface_Map failed, hr %#x.\n", hr);
/* keep the dib section */
return hr;
}
@ -338,7 +306,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC
}
/* we locked first, so unlock now */
IWineD3DSurface_UnlockRect(iface);
IWineD3DSurface_Unmap(iface);
This->Flags &= ~SFLAG_DCINUSE;
@ -466,8 +434,10 @@ static HRESULT WINAPI IWineGDISurfaceImpl_SetMem(IWineD3DSurface *iface, void *M
/* Now free the old memory if any */
HeapFree(GetProcessHeap(), 0, release);
} else if(This->Flags & SFLAG_USERPTR) {
/* LockRect and GetDC will re-create the dib section and allocated memory */
}
else if(This->Flags & SFLAG_USERPTR)
{
/* Map() and GetDC() will re-create the dib section and allocated memory. */
This->resource.allocatedMemory = NULL;
This->Flags &= ~SFLAG_USERPTR;
}
@ -504,8 +474,8 @@ const IWineD3DSurfaceVtbl IWineGDISurface_Vtbl =
IWineD3DBaseSurfaceImpl_GetType,
/* IWineD3DSurface */
IWineD3DBaseSurfaceImpl_GetDesc,
IWineGDISurfaceImpl_LockRect,
IWineGDISurfaceImpl_UnlockRect,
IWineGDISurfaceImpl_Map,
IWineGDISurfaceImpl_Unmap,
IWineGDISurfaceImpl_GetDC,
IWineGDISurfaceImpl_ReleaseDC,
IWineGDISurfaceImpl_Flip,

View File

@ -376,7 +376,7 @@ static HRESULT WINAPI IWineD3DTextureImpl_GetSurfaceLevel(IWineD3DTexture *iface
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DTextureImpl_LockRect(IWineD3DTexture *iface,
static HRESULT WINAPI IWineD3DTextureImpl_Map(IWineD3DTexture *iface,
UINT level, WINED3DLOCKED_RECT *locked_rect, const RECT *rect, DWORD flags)
{
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
@ -391,10 +391,10 @@ static HRESULT WINAPI IWineD3DTextureImpl_LockRect(IWineD3DTexture *iface,
return WINED3DERR_INVALIDCALL;
}
return IWineD3DSurface_LockRect(surface, locked_rect, rect, flags);
return IWineD3DSurface_Map(surface, locked_rect, rect, flags);
}
static HRESULT WINAPI IWineD3DTextureImpl_UnlockRect(IWineD3DTexture *iface, UINT level)
static HRESULT WINAPI IWineD3DTextureImpl_Unmap(IWineD3DTexture *iface, UINT level)
{
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
IWineD3DSurface *surface;
@ -407,7 +407,7 @@ static HRESULT WINAPI IWineD3DTextureImpl_UnlockRect(IWineD3DTexture *iface, UIN
return WINED3DERR_INVALIDCALL;
}
return IWineD3DSurface_UnlockRect(surface);
return IWineD3DSurface_Unmap(surface);
}
static HRESULT WINAPI IWineD3DTextureImpl_AddDirtyRect(IWineD3DTexture *iface, const RECT *dirty_rect)
@ -460,8 +460,8 @@ static const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
/* IWineD3DTexture */
IWineD3DTextureImpl_GetLevelDesc,
IWineD3DTextureImpl_GetSurfaceLevel,
IWineD3DTextureImpl_LockRect,
IWineD3DTextureImpl_UnlockRect,
IWineD3DTextureImpl_Map,
IWineD3DTextureImpl_Unmap,
IWineD3DTextureImpl_AddDirtyRect
};

View File

@ -205,7 +205,9 @@ static void WINAPI IWineD3DVolumeImpl_GetDesc(IWineD3DVolume *iface, WINED3DVOLU
desc->Depth = volume->currentDesc.Depth;
}
static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DLOCKED_BOX* pLockedVolume, CONST WINED3DBOX* pBox, DWORD Flags) {
static HRESULT WINAPI IWineD3DVolumeImpl_Map(IWineD3DVolume *iface,
WINED3DLOCKED_BOX *pLockedVolume, const WINED3DBOX *pBox, DWORD Flags)
{
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
FIXME("(%p) : pBox=%p stub\n", This, pBox);
@ -257,7 +259,8 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DL
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DVolumeImpl_UnlockBox(IWineD3DVolume *iface) {
static HRESULT WINAPI IWineD3DVolumeImpl_Unmap(IWineD3DVolume *iface)
{
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
if (!This->locked)
{
@ -321,8 +324,8 @@ static const IWineD3DVolumeVtbl IWineD3DVolume_Vtbl =
IWineD3DVolumeImpl_GetType,
/* IWineD3DVolume */
IWineD3DVolumeImpl_GetDesc,
IWineD3DVolumeImpl_LockBox,
IWineD3DVolumeImpl_UnlockBox,
IWineD3DVolumeImpl_Map,
IWineD3DVolumeImpl_Unmap,
/* Internal interface */
IWineD3DVolumeImpl_LoadTexture,
};

View File

@ -293,7 +293,7 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetVolumeLevel(IWineD3DVolumeTex
return WINED3D_OK;
}
static HRESULT WINAPI IWineD3DVolumeTextureImpl_LockBox(IWineD3DVolumeTexture *iface,
static HRESULT WINAPI IWineD3DVolumeTextureImpl_Map(IWineD3DVolumeTexture *iface,
UINT level, WINED3DLOCKED_BOX *locked_box, const WINED3DBOX *box, DWORD flags)
{
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
@ -308,10 +308,10 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_LockBox(IWineD3DVolumeTexture *i
return WINED3DERR_INVALIDCALL;
}
return IWineD3DVolume_LockBox(volume, locked_box, box, flags);
return IWineD3DVolume_Map(volume, locked_box, box, flags);
}
static HRESULT WINAPI IWineD3DVolumeTextureImpl_UnlockBox(IWineD3DVolumeTexture *iface, UINT level)
static HRESULT WINAPI IWineD3DVolumeTextureImpl_Unmap(IWineD3DVolumeTexture *iface, UINT level)
{
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
IWineD3DVolume *volume;
@ -324,7 +324,7 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_UnlockBox(IWineD3DVolumeTexture
return WINED3DERR_INVALIDCALL;
}
return IWineD3DVolume_UnlockBox(volume);
return IWineD3DVolume_Unmap(volume);
}
static HRESULT WINAPI IWineD3DVolumeTextureImpl_AddDirtyBox(IWineD3DVolumeTexture *iface, const WINED3DBOX *dirty_box)
@ -378,8 +378,8 @@ static const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl =
/* volume texture */
IWineD3DVolumeTextureImpl_GetLevelDesc,
IWineD3DVolumeTextureImpl_GetVolumeLevel,
IWineD3DVolumeTextureImpl_LockBox,
IWineD3DVolumeTextureImpl_UnlockBox,
IWineD3DVolumeTextureImpl_Map,
IWineD3DVolumeTextureImpl_Unmap,
IWineD3DVolumeTextureImpl_AddDirtyBox
};

View File

@ -2203,7 +2203,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *d
const RECT *src_rect, DWORD flags, const WINEDDBLTFX *fx, WINED3DTEXTUREFILTERTYPE filter) DECLSPEC_HIDDEN;
HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dstx, DWORD dsty,
IWineD3DSurface *Source, const RECT *rsrc, DWORD trans) DECLSPEC_HIDDEN;
HRESULT WINAPI IWineD3DBaseSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED3DLOCKED_RECT *pLockedRect,
HRESULT WINAPI IWineD3DBaseSurfaceImpl_Map(IWineD3DSurface *iface, WINED3DLOCKED_RECT *pLockedRect,
const RECT *pRect, DWORD Flags) DECLSPEC_HIDDEN;
const void *WINAPI IWineD3DBaseSurfaceImpl_GetData(IWineD3DSurface *iface) DECLSPEC_HIDDEN;

View File

@ -2377,12 +2377,12 @@ interface IWineD3DSurface : IWineD3DResource
void GetDesc(
[out] WINED3DSURFACE_DESC *desc
);
HRESULT LockRect(
HRESULT Map(
[out] WINED3DLOCKED_RECT *locked_rect,
[in] const RECT *rect,
[in] DWORD flags
);
HRESULT UnlockRect(
HRESULT Unmap(
);
HRESULT GetDC(
[out] HDC *dc
@ -2490,12 +2490,12 @@ interface IWineD3DVolume : IWineD3DResource
void GetDesc(
[out] WINED3DVOLUME_DESC *desc
);
HRESULT LockBox(
HRESULT Map(
[out] WINED3DLOCKED_BOX *locked_box,
[in] const WINED3DBOX *box,
[in] DWORD flags
);
HRESULT UnlockBox(
HRESULT Unmap(
);
HRESULT LoadTexture(
[in] int gl_level,
@ -2551,13 +2551,13 @@ interface IWineD3DTexture : IWineD3DBaseTexture
[in] UINT level,
[out] IWineD3DSurface **surface
);
HRESULT LockRect(
HRESULT Map(
[in] UINT level,
[out] WINED3DLOCKED_RECT *locked_rect,
[in] const RECT *rect,
[in] DWORD flags
);
HRESULT UnlockRect(
HRESULT Unmap(
[in] UINT level
);
HRESULT AddDirtyRect(
@ -2581,14 +2581,14 @@ interface IWineD3DCubeTexture : IWineD3DBaseTexture
[in] UINT level,
[out] IWineD3DSurface **surface
);
HRESULT LockRect(
HRESULT Map(
[in] WINED3DCUBEMAP_FACES face,
[in] UINT level,
[out] WINED3DLOCKED_RECT *locked_rect,
[in] const RECT *rect,
[in] DWORD flags
);
HRESULT UnlockRect(
HRESULT Unmap(
[in] WINED3DCUBEMAP_FACES face,
[in] UINT level
);
@ -2613,13 +2613,13 @@ interface IWineD3DVolumeTexture : IWineD3DBaseTexture
[in] UINT level,
[out] IWineD3DVolume **volume
);
HRESULT LockBox(
HRESULT Map(
[in] UINT level,
[out] WINED3DLOCKED_BOX *locked_box,
[in] const WINED3DBOX *box,
[in] DWORD flags
);
HRESULT UnlockBox(
HRESULT Unmap(
[in] UINT level
);
HRESULT AddDirtyBox(