=== w864 (32 bit device) === device.c:5409: Test failed: pBits not cleared on double lock. device.c:5410: Test failed: Pitch not cleared on double lock. device: unhandled exception c0000005 at 742814C8
I've tested your tests on two of my Windows 7 machines, one with a Nvidia Geforce 650M, and another with an AMD X1600. Both behave just like the testbot. I guess this means your original implementation of just not touching the output locked_rect was correct all along.
Volume::Lock clears pBits and both pitches on a failed lock in all failure cases (resource not lockable, misaligned box, already locked, otherwise incorrect box). I haven't tested d3d8 yet. As far as I can see surfaces keep locked_rect untouched in all error conditions. I also haven't tested Windows XP yet because my Visual Studio 2012 generated .exe files don't run there any more :-\ .
Cheers, Stefan