From 07b9b00664dc402de5615236b55943ed6cba1418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 7 Oct 2023 19:55:39 +0200 Subject: [PATCH] [SETUPAPI] Add a temporary HACK for source media resolution in SetupCommitFileQueueW() Emit an error line in the debug log and break out of the resolution loop. Don't use a message box for now, since the problem happens also during 2nd-stage setup, for which an automated handling of such msgbox in our test bots would not be possible. We now get the following during 2nd-stage: ``` [...] (base\services\umpnpmgr\install.c:118) Installing: ACPI\ACPI0003\0 err:(dll\win32\setupapi\queue.c:1696) ** Could not find source install media! ** copy error 0 L"C:\\ReactOS\\inf\\cmbatt.sys" -> L"C:\\ReactOS\\System32\\drivers\\cmbatt.sys" err:(dll\win32\setupapi\queue.c:1696) ** Could not find source install media! ** copy error 0 L"C:\\ReactOS\\inf\\battc.sys" -> L"C:\\ReactOS\\System32\\drivers\\battc.sys" err:(dll\win32\setupapi\queue.c:1696) ** Could not find source install media! ** copy error 0 L"C:\\ReactOS\\inf\\compbatt.sys" -> L"C:\\ReactOS\\System32\\drivers\\compbatt.sys" [...] err:(dll\win32\setupapi\queue.c:1696) ** Could not find source install media! ** copy error 0 L"C:\\ReactOS\\inf\\" -> L"C:\\ReactOS\\System32\\drivers\\cdrom.sys" [...] err:(dll\win32\setupapi\queue.c:1696) ** Could not find source install media! ** copy error 0 L"C:\\ReactOS\\inf\\" -> L"C:\\ReactOS\\System32\\drivers\\disk.sys" ``` (Note that the source paths without any file, in the last two example lines, is strange...) --- The previous Wine commit, that implements install source media resolution feature, causes ReactOS to apparently hang during the 2nd-stage setup. This is caused by an infinite "loop" while trying to resolve the install source for our drivers we "install" during 2nd-stage setup. Testing by replacing our setupapi.dll with Windows', reveals that this is basically what's happening, except that the dialog for finding the install media shows up now. The "infinite loop" would effectively be obtained by pressing OK, failing, pressing OK again, etc. indefinitely. The only difference is that Wine's setupapi.dll doesn't have any dialog for that, so nothing shows up and it just infinitely loops there. (The dialog would be the equivalent to the IDPROMPTFORDISK one.) Now, the reason why this happens in ReactOS is because we use .inf files that derive their installation source from a layout.inf file... that we do not support (ours is a stub). Further, Wine's setupapi doesn't support LayoutInf as well. --- dll/win32/setupapi/queue.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dll/win32/setupapi/queue.c b/dll/win32/setupapi/queue.c index c8f511347ca..ba6aa1678a4 100644 --- a/dll/win32/setupapi/queue.c +++ b/dll/win32/setupapi/queue.c @@ -1692,6 +1692,11 @@ BOOL WINAPI SetupCommitFileQueueW( HWND owner, HSPFILEQ handle, PSP_FILE_CALLBAC break; #endif } +#if defined(__REACTOS__) // TEMP HACK! + ERR( "** Could not find source install media! ** copy error %d %s -> %s\n", + paths.Win32Error, debugstr_w(paths.Source), debugstr_w(paths.Target) ); + break; +#endif } } else