From 8e3e163fd4724c93c50c72747919d73bd2d428d6 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 14 May 2025 14:34:41 +0200 Subject: [PATCH] [client,xfreerdp] remove SetWaitableTimer use --- client/X11/xf_client.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index 14948b8d0..caf5bc951 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -1553,11 +1553,7 @@ static DWORD WINAPI xf_client_thread(LPVOID param) DWORD exit_code = 0; DWORD waitStatus = 0; HANDLE inputEvent = NULL; - HANDLE timer = NULL; - LARGE_INTEGER due = { 0 }; - TimerEventArgs timerEvent = { 0 }; - EventArgsInit(&timerEvent, "xfreerdp"); freerdp* instance = (freerdp*)param; WINPR_ASSERT(instance); @@ -1601,27 +1597,12 @@ static DWORD WINAPI xf_client_thread(LPVOID param) goto disconnect; } - timer = CreateWaitableTimerA(NULL, FALSE, "mainloop-periodic-timer"); - - if (!timer) - { - WLog_ERR(TAG, "failed to create timer"); - goto disconnect; - } - - due.QuadPart = 0; - - if (!SetWaitableTimer(timer, &due, 20, NULL, NULL, FALSE)) - { - goto disconnect; - } inputEvent = xfc->x11event; while (!freerdp_shall_disconnect_context(instance->context)) { HANDLE handles[MAXIMUM_WAIT_OBJECTS] = { 0 }; DWORD nCount = 0; - handles[nCount++] = timer; handles[nCount++] = inputEvent; /* @@ -1682,12 +1663,6 @@ static DWORD WINAPI xf_client_thread(LPVOID param) if (!handle_window_events(instance)) break; - - if ((waitStatus != WAIT_TIMEOUT) && (waitStatus == WAIT_OBJECT_0)) - { - timerEvent.now = GetTickCount64(); - PubSub_OnTimer(context->pubSub, context, &timerEvent); - } } if (!exit_code) @@ -1706,9 +1681,6 @@ static DWORD WINAPI xf_client_thread(LPVOID param) disconnect: - if (timer) - (void)CloseHandle(timer); - freerdp_disconnect(instance); end: ExitThread(exit_code);