In theory, there is no difference between theory and practice. In practice, theory and practice don't even relate.
Since the problem showed up only with the emulator, and since it showed up very rarely and in a very nondeterministic fashion, and since it didn't show up when disabling the code optimization for at
least the "winceLockFile" function, it looks a lot like a very weird
Device Emulator bug. I agree, that the reasoning for the change is rather weak.
Unfortunately, I most probably won't be able to spend more time to find and create a test case scenario that demonstrates the problem on the Device Emulator, since I already spent 3-4 days figuring out the problem in the first place. But with the Device Emulator being closed source, I'm stuck to the code that I have a chance to change in order to work around the problem.
But this would be exactly my reasoning: Why not add an #ifndef to disable the test code that can change the value of PENDING_BYTE. It could be enabled by default, but you could add another #define and we're done.
We would not ask to remove the functionality, instead we'd ask to make it optional.
On a desktop computer there is not too much need to do optimization anymore, but my expericence with Win Mobile devices speak a different language: Less code instructions => faster code. Replacing PENDING_BYTE by a const value will reduce memory access on the device. I was also thinking about whether we need locking on a WinCE based app at all, since usually there is only one thread accessing the DB, but that is another topic.
(There is quite a number of calls to the locking / unlocking functions)