]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Apparently MsgWaitForMultipleObjects doesn't always return the
authorSimon Tatham <anakin@pobox.com>
Mon, 28 Aug 2006 19:09:28 +0000 (19:09 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 28 Aug 2006 19:09:28 +0000 (19:09 +0000)
values one might expect, which means that GetMessage() was
occasionally blocking the process. That appears to be the last of
the annoying data loss issues, so I think the Windows serial back
end actually looks vaguely reliable now. Phew.

[originally from svn r6830]

windows/window.c

index 81a28aa40d1cde7c8d94c8baf465a420e33c1543..4855de54401dcc6b89028c92c338ceffb33dd6ee 100644 (file)
@@ -836,9 +836,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
 
        sfree(handles);
 
-       if (GetMessage(&msg, NULL, 0, 0) != 1)
-           break;
-       do {
+       while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
            if (msg.message == WM_QUIT)
                goto finished;         /* two-level break */
 
@@ -852,7 +850,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
             */
            if (must_close_session)
                close_session();
-       } while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE));
+       }
 
        /* The messages seem unreliable; especially if we're being tricky */
        term_set_focus(term, GetForegroundWindow() == hwnd);