Commit graph

5077 commits

Author SHA1 Message Date
winesync ebe0384806
[WINESYNC] setupapi: Handle NULL source filename in build_filepathsW.
Source filename is NULL for files to be deleted.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id fac1e40aaf0726a3e328a922cb496927548190cf by Hans Leidekker <hans@codeweavers.com>
2024-02-20 16:40:30 +01:00
winesync e33b5f1b4a
[WINESYNC] setupapi: Add an extension to support file copies from module resources.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 5696c3c23d5be9f5ce57ef7e361d88722120da09 by Alexandre Julliard <julliard@winehq.org>

NOTE: This commit is a Wine-specific feature, that does not exist in
Windows, thus should not exist in ReactOS: surrounded in __WINESRC__.
2024-02-20 16:40:29 +01:00
winesync eb4ed941e4
[WINESYNC] setupapi: Add a few more dirids.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 354aabd77e4ff3747446b2402de89d804001bd3f by Alexandre Julliard <julliard@winehq.org>
2024-02-20 16:40:28 +01:00
winesync 6309808b5d
[WINESYNC] setupapi: Treat trailing \0 in field values same way as trailing spaces.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 5b7fac05d95fd2cd0c274f1342fb96d0f7152848 by Dmitry Timoshkov <dmitry@baikal.ru>
2024-02-20 16:40:27 +01:00
winesync 3d4a386ecf
[WINESYNC] setupapi: Implement SP_COPY_IN_USE_NEEDS_REBOOT.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36059
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 87b2af73baf3cc26fe5ed135cbd6ed494a9003be by Michael Müller <michael@fds-team.de>

+ Adaptation for ReactOS-specific code: the temporary file is already
  created because of the LZOpenFileW steps from above, introduced by
  commit e0e3c56ec (r68659), so we can directly call
  MoveFileExW(..., MOVEFILE_DELAY_UNTIL_REBOOT);
  with suitable parameters.

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2024-02-20 16:40:20 +01:00
Hermès Bélusca-Maïto db99b79468
[SETUPAPI] Use wide character string literals in ReactOS-specific code too. 2024-02-20 16:40:18 +01:00
winesync 68f4dfa593
[WINESYNC] setupapi: Use wide character string literals.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 32a2cde6c187ac3805303929a16c12d4412df832 by Alexandre Julliard <julliard@winehq.org>
2024-02-20 16:40:17 +01:00
winesync e900088251
[WINESYNC] setupapi: Fix hex digit check in SetupGetBinaryField.
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id d580d2c2fdad7f6f00dd12923e475298c019b660 by Jacek Caban <jacek@codeweavers.com>
2024-02-20 16:40:14 +01:00
winesync 6f42d25d21
[WINESYNC] setupapi: Add support for IDF_CHECKFIRST flag in SetupPromptForDiskW.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=20465
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 0422c6c4d0224c4e619771a0d22f4a5a1575f3f3 by Michael Müller <michael@fds-team.de>
2024-02-20 16:40:10 +01:00
winesync 691f76af4f
[WINESYNC] setupapi: Handle copy errors in SetupCommitFileQueueW().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id b3abc343c373ee5fd0764a3ceedeef52589c0ab2 by Alexandre Julliard <julliard@winehq.org>
2024-02-20 16:40:08 +01:00
Hermès Bélusca-Maïto 8924d633b6
[SETUPAPI] Add missing Vista+ SetupGetInfDriverStoreLocationA, forgotten in Wine. 2024-02-20 16:40:07 +01:00
winesync 8a03aa576f
[WINESYNC] setupapi: Add SetupGetInfDriverStoreLocationW stub.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id f1b94dc16c35a5c477b6df8aa94c6d3537642c77 by Derek Lesho <dlesho@codeweavers.com>
2024-02-20 16:40:07 +01:00
winesync 41f3b93750
[WINESYNC] setupapi: Define .inf section names for ARM platforms.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id b2b3975f46c203a129a946128ccd018dd7ed6e46 by Alexandre Julliard <julliard@winehq.org>
2024-02-20 16:40:03 +01:00
winesync c46514caa1
[WINESYNC] setupapi: Fix handling of FILEOP_SKIP from the SPFILENOTIFY_STARTCOPY callback.
Fixes a regression introduced by 3e5c9798a80641e0e39e95e4467c60405b22b062.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47436
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id a431b4b54a36b49821cae363d7ea8733eefe62ef by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:40:01 +01:00
winesync 3c09799914
[WINESYNC] setupapi: Fix an uninitialized variable warning (Valgrind).
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id ecbd2dd34b4239318162242caaa197ae4f0911f5 by Sven Baars <sven.wine@gmail.com>
2024-02-20 16:39:59 +01:00
winesync 7b28a3f093
[WINESYNC] setupapi: Fix a path leak (Valgrind).
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 5f0d53e20903b009ee47a238a642f2e95f27d712 by Sven Baars <sven.wine@gmail.com>
2024-02-20 16:39:58 +01:00
winesync 8208d7b41b
[WINESYNC] setupapi: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 72d6759f3a86c24e2db0b6190f4d2fae642e487f by Alexandre Julliard <julliard@winehq.org>

+ Similar adaptations in ReactOS-specific code.

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2024-02-20 16:39:55 +01:00
winesync 40d001ae5d
[WINESYNC] setupapi: Don't fail a queued copy if no copy was necessary.
This fixes a regression introduced by 3e5c9798a80641e0e39e95e4467c60405b22b062.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47219
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 8bc25b24af0276985ad080c8364c11cfff3a1fe5 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:39 +01:00
winesync f82328cb7c
[WINESYNC] setupapi: Clear the Win32 error if no copy was necessary.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id a748f685a502891bc8fa5f4719f80b6feb39ac9c by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:38 +01:00
winesync 19cb94a4d2
[WINESYNC] setupapi: Retrieve the default destination path in SetupInstallFile().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id d5f6d6419b16ef81ce882f01a318189251320fcb by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:37 +01:00
winesync 3c579a7bba
[WINESYNC] setupapi: Handle an empty string for the source file in SetupQueueCopySection().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47185
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 86724af01241b257a4b4b39682031c9c7a3aaeaa by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:32 +01:00
winesync b0e98c7b5c
[WINESYNC] setupapi: Avoid debugstr buffer overflow.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 88e28d971bd119f214e29d4ebfa819af9f18f5b7 by Józef Kucia <jkucia@codeweavers.com>
2024-02-20 16:39:31 +01:00
Hermès Bélusca-Maïto c1e9b441ae
[SETUPAPI] Prepare for syncing dirid.c with Wine. 2024-02-20 16:39:29 +01:00
winesync 75b8fd01b0
[WINESYNC] setupapi: Add magic bytes to struct file_queue and validate them in SetupCloseFileQueue().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=12332
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id c65d98065c0038e0919f40bec4a9dc978fb2ade9 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:28 +01:00
Hermès Bélusca-Maïto 0dcb32cb9d
[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.
2024-02-20 16:39:26 +01:00
winesync 55a4eaf25c
[WINESYNC] setupapi: Implement source media path resolution.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47107
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 3e5c9798a80641e0e39e95e4467c60405b22b062 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:25 +01:00
winesync c1b2ea9954
[WINESYNC] setupapi: Use the source file name if the destination file name is NULL.
Do not do the reverse. Windows crashes if SourceFilename is NULL.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id cfe4ce28ebc0f381eb2f561ad3111eef71505546 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:24 +01:00
winesync d306987d57
[WINESYNC] setupapi: Properly null-terminate the path in concat_W().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id db8e2388d940f908db009f34f620da1ac8b46d07 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:23 +01:00
winesync 5eb4bded7f
[WINESYNC] setupapi: Implement W -> A mapping of SPFILENOTIFY_NEEDMEDIA.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id e8c4dbcec21d9b65cb680c6c773e560f761d42f8 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:22 +01:00
winesync c753e9f517
[WINESYNC] setupapi: Implement SetupDefaultQueueCallback(SPFILENOTIFY_NEEDMEDIA).
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 46dc6dddf3d1ef02aa773d0e25c121b8643d4bba by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:21 +01:00
Hermès Bélusca-Maïto 7941ad33ee
[SETUPAPI] Additional adaptations for ReactOS-specific get_src_file_info(). 2024-02-20 16:39:20 +01:00
winesync 8748f693ad
[WINESYNC] setupapi: Keep track of source media in a separate list.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 31bb0097ad85090b1e006ade020c68aa5582dc0c by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:19 +01:00
winesync e713ba6c3f
[WINESYNC] setupapi: Separate the entire copy operation into a helper function.
So as to centralize SPFILENOTIFY_COPYERROR callbacks into one place.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 3cb621e6ca78064adeb2415bf3467e476e9eba6a by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:18 +01:00
winesync dcafe5085c
** SKIPPED COMMIT **
[WINESYNC] setupapi: Remove implementation for LayoutInf parameter of SP_FILE_COPY_PARAMS.

Tests demonstrate that the existing implementation is not correct, and I was
unable to find an arrangement of parameters such that it was respected on
Windows. Most likely it has to do with the undocumented parameters used in
the "master" C:\windows\inf\layout.inf.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id ee36f923c59d9ba51b429247df90e0ed30592e62 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:17 +01:00
winesync ed41692297
[WINESYNC] setupapi: Implement SetupQueueCopyIndirectA() on top of the W variant.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 466b80786fbf7ced695358af3ee87302ed00eb1b by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:16 +01:00
winesync 93b98f235c
[WINESYNC] setupapi: Fill out all source file parameters in SetupQueueDefaultCopy().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 705d3eed86f3ff96ee1190dbc694148c21c4939c by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:15 +01:00
winesync 46863938f9
[WINESYNC] setupapi: Fill out all source file parameters in SetupQueueCopySection().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id f9f25ee227a60c335ea8767e8b09d2f3bc3d53f7 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:14 +01:00
winesync ed328e0191
[WINESYNC] setupapi: Extract individual files from cabinets.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id fccb7552ebe81ea2c0c17bc747a920f90e2537a5 by Zebediah Figura <z.figura12@gmail.com>

NOTE: Already committed in ReactOS in commit 5c8ec78b7 (PR #5233).
2024-02-20 16:39:11 +01:00
winesync 9828509db3
[WINESYNC] setupapi: Search for substituted strings in SetupFindNextMatchLine().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id bb4a6da373d7fdb4a61743ee0632298f6a2f333f by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:04 +01:00
winesync 01c7e4b88f
[WINESYNC] setupapi: For consistency use __x86_64__ instead of __x86_64.
Spotted by Ken Thomases.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id a6d89db61566b5dcccd66cb1cb5a51dfa0cc0f0a by Huw Davies <huw@codeweavers.com>
2024-02-20 16:38:54 +01:00
winesync ab19b30220
[WINESYNC] setupapi: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id d33f06746050984c622366ffbc19219ec1f5aa7d by Michael Stefaniuc <mstefani@winehq.org>
2024-02-20 16:38:53 +01:00
Hermès Bélusca-Maïto 50371bc6e7
[SETUPAPI] parser.c: Improve the ReactOS-specific code.
In particular, directly use unicode strings instead of the old ugly
Wine-construction. Indeed they are also slowly phasing it out in their
own code.
2024-02-20 16:38:51 +01:00
winesync 567fcbd651
[WINESYNC]: revert wine-staging patchset for setupapi 2024-02-20 16:38:50 +01:00
winesync 4df741193b
[WINESYNC] setupapi: Make default context structure layout compatible.
wine commit id dcab5fe61bed87b291901ceff686894a64871d98 by Nikolay Sivov <nsivov@codeweavers.com>
2024-02-20 16:38:46 +01:00
Hermès Bélusca-Maïto e32aaa6ac0
[SETUPAPI] Guard in __WINESRC__ original Wine code that has been improved in ReactOS.
See commit 1cda0af51 (r27896) for more details.
2024-02-20 16:38:45 +01:00
Hermès Bélusca-Maïto 1ae2375f90
******** Now compile wine's stringtable.c for testing purposes 2024-02-20 16:38:44 +01:00
Hermès Bélusca-Maïto 5f2aad632c
[WINESYNC] setupapi: Implement a binary compatible string table.
wine commit id 8802f84c8cc473d5617c134c16973b1cb2c4b53e by Nikolay Sivov <nsivov@codeweavers.com>
2024-02-20 16:38:43 +01:00
Hermès Bélusca-Maïto 6ba11f67c3
[SETUPAPI] stringtable.c: Code simplification and bugfix.
- Reimplement StringTableInitialize around StringTableInitializeEx
- Fix buffer over-read in StringTableGetExtraData in case the user-specified
  dwExtraDataSize is larger than the dwSize of the pStringTable pData buffer.
2024-02-20 16:38:41 +01:00
winesync 1242c0bb46
[WINESYNC] setupapi: Avoid memory leaks (coverity).
wine commit id 4d796458d0ed517d45adc57a1aedaf1c3bdde232 by André Hentschel <nerv@dawncrow.de>
2024-02-20 16:38:39 +01:00
winesync 3a01cdb3cd
[WINESYNC] setupapi: Avoid hardcoding the Unicode string literal lengths.
wine commit id 9097fa132e56cc542fa3ea77706fea79353d2f4a by Francois Gouget <fgouget@free.fr>
2024-02-20 16:38:38 +01:00