wined3d: Move a part of LockRect to the base class.