Do I read this correctly that a double unlockrect call on a surface fails, while a double unlockrect call on a texture succeeds? From the context of the patch its a bit hard to read.
Here are some more test suggestions:
-> Create a texture, retrieve its surface, and call LockRect/ UnlockRect on the surface. Does this show the surface or texture behavior
-> What happens if you have a texture, retrieve a surface and mix locks on the surface and texture?
-> What is the d3d9 behavior?