Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/tests/surface.c:
check_release((IUnknown *)newsurf, 1); check_release((IUnknown *)tex, 0);
/* Test updating subarea of compressed texture. */
hr = IDirect3DDevice9_CreateTexture(device, 32, 16, 1, 0, D3DFMT_DXT5, D3DPOOL_SYSTEMMEM, &tex, NULL);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirect3DTexture9_GetSurfaceLevel(tex, 0, &newsurf);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);
SetRect(&destrect, 0, 0, 4, 8);
SetRect(&rect, 0, 0, 4, 8);
memset(buffer, 0x40, 4 * 8 * 4);
I know this is just a test but it seems nicer to put a sizeof(buffer) as the third argument here.