Is PeekMessage supposed to SetLastError at all? Because that's what happens in the game, and the value 0xffffffff is read much later in an unrelated code, causing the crash.
OK, so the actual problem is the new SetLastError behavior, and I think this is a reasonable concern. About how a proper fix should look like, I will have to defer to someone with more experience in the win32u internals design.