From 0b6a52acf4be881a23255fc210019be72bdfd702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Wojdy=C5=82a?= Date: Fri, 6 Jun 2025 15:26:22 +0200 Subject: [PATCH 1/3] Automatically accept test-signed driver installation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Wojdyła --- src/install-helper/install-helper.c | 42 +++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/src/install-helper/install-helper.c b/src/install-helper/install-helper.c index aec9a75..fe56d38 100644 --- a/src/install-helper/install-helper.c +++ b/src/install-helper/install-helper.c @@ -127,8 +127,50 @@ DWORD StopXenbusMonitor() return status; } +/* + * Automatically accept the prompt for installing test-signed drivers. + */ +DWORD ApproveTestSign(void* param) +{ + while (TRUE) + { + HWND window = FindWindow(NULL, L"Windows Security"); + if (window) + { + DWORD fg_tid = GetWindowThreadProcessId(GetForegroundWindow(), NULL); + DWORD tid = GetCurrentThreadId(); + // Without this, focus-stealing mitigations can prevent activating the target window. + if (tid != fg_tid) + AttachThreadInput(fg_tid, tid, TRUE); + + BringWindowToTop(window); + ShowWindow(window, SW_SHOW); + + while (GetForegroundWindow() != window) + Sleep(100); + + INPUT inputs[2]; + inputs[0].type = INPUT_KEYBOARD; + inputs[0].ki.wVk = 'i'; + inputs[1].type = INPUT_KEYBOARD; + inputs[1].ki.dwFlags = KEYEVENTF_KEYUP; + inputs[1].ki.wVk = 'i'; + SendInput(ARRAYSIZE(inputs), inputs, sizeof(INPUT)); + break; + } + else + { + Sleep(100); + } + } + return 0; +} + int WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd) { (void)AddSymlinkRightToUsers(); + HANDLE thread = CreateThread(NULL, 0, ApproveTestSign, NULL, 0, NULL); + if (WaitForSingleObject(thread, 30000) == WAIT_TIMEOUT) + TerminateThread(thread, 0); return (int)StopXenbusMonitor(); } From ab698e934207462ea51b0abbda842b34de92fa56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Wojdy=C5=82a?= Date: Fri, 20 Jun 2025 19:19:15 +0200 Subject: [PATCH 2/3] Preserve existing IHVDRIVER debug print filter value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Wojdyła --- vs2022/installer/CoreComponents.wxs | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/vs2022/installer/CoreComponents.wxs b/vs2022/installer/CoreComponents.wxs index 316a836..40da43b 100644 --- a/vs2022/installer/CoreComponents.wxs +++ b/vs2022/installer/CoreComponents.wxs @@ -38,6 +38,15 @@ /> + + + + @@ -132,6 +141,16 @@ + + + + + + - - - - From e942eafbe64178789bad1940a725f86d97b17954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 9 Jul 2025 03:03:19 +0200 Subject: [PATCH 3/3] Increase ApproveTestSign timeout to 3 minutes When installing QWT via qvm-create-windows-qube, the installation may start while there is sill an Windows installer (OOB?) splash screen that prevents interacting with any window. In unlucky situation (which happens always on Windows 11...) the whole 30s timeout expires before it's possible to interact with the window. Increase the timeout to (attempt to) fix this issue. BTW, relevant documentation about when foreground window can be switched is at https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setforegroundwindow#remarks --- src/install-helper/install-helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/install-helper/install-helper.c b/src/install-helper/install-helper.c index fe56d38..eb425b2 100644 --- a/src/install-helper/install-helper.c +++ b/src/install-helper/install-helper.c @@ -170,7 +170,7 @@ int WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPS { (void)AddSymlinkRightToUsers(); HANDLE thread = CreateThread(NULL, 0, ApproveTestSign, NULL, 0, NULL); - if (WaitForSingleObject(thread, 30000) == WAIT_TIMEOUT) + if (WaitForSingleObject(thread, 1800000) == WAIT_TIMEOUT) TerminateThread(thread, 0); return (int)StopXenbusMonitor(); }