mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/virt-viewer
synced 2026-01-09 22:25:30 +00:00
win32: process message queue in debug-helper
Process messages while waiting for pi.hProcess. Avoid the spice-x from hanging in WaitForInputIdle(), although the client itself might not be ready, not even started... https://bugzilla.redhat.com/show_bug.cgi?id=903190
This commit is contained in:
parent
ea6c9d2673
commit
d5229a71eb
@ -24,6 +24,7 @@ int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
char pipe[2048];
|
||||
MSG msg;
|
||||
STARTUPINFO si = { 0, };
|
||||
PROCESS_INFORMATION pi = { 0, };
|
||||
gchar *program_path = get_program_path();
|
||||
@ -55,8 +56,19 @@ main(int argc, char *argv[])
|
||||
goto end;
|
||||
}
|
||||
|
||||
// Wait until child process exits
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
|
||||
while (1) {
|
||||
DWORD reason = MsgWaitForMultipleObjects(1, &pi.hProcess, FALSE,
|
||||
INFINITE, QS_ALLINPUT);
|
||||
if (reason == WAIT_OBJECT_0)
|
||||
break;
|
||||
else {
|
||||
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Close process and thread handles
|
||||
CloseHandle(pi.hProcess);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user