Monday, June 12, 2017

Windows 10 1703 sometimes sends messages in response to PeekMessage

I spent rather a lot of time last week debugging a third-party application that froze up in some places on Windows 10 1703 but worked perfectly on previous versions. Long story short, this application calls PeekMessage many times on every trip around its message loop. As of version 1703, it appears that the window message 0x738 is occasionally sent in the internals of PeekMessage. That message goes into the queue, so GetMessage returns immediately, and the loop goes around again. That pegs the CPU at 100% and stops things from proceeding as they should.

The solution was to patch that component to check whether the message ID is 0x738 and if it is, ignore the message by jumping back to right before the GetMessage invocation.

No comments:

Post a Comment