Commit graph

5065 commits

Author SHA1 Message Date
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
winesync b30218b154
[WINESYNC] setupapi: Destination directory defaults to system directory.
wine commit id 1b8ba2537111f0d691d2592bb4ffb6bc4fe4f20e by Hans Leidekker <hans@codeweavers.com>
2024-02-20 16:38:37 +01:00
winesync dda601fc43
[WINESYNC] setupapi: Fix memory leak.
Found by Valgrind.

wine commit id 63231be8044441218fb82899e748900e1ace3d0d by Huw Davies <huw@codeweavers.com>

NOTE: Some of the code was already present as part of ReactOS-specific
changes. It has been slightly adapted to suit Wine changes.

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2024-02-20 16:38:37 +01:00
winesync 3a9df253a1
[WINESYNC] setupapi: Remove superfluous pointer casts.
wine commit id ffae0123ac46ba6dfac74d7c84422073fd53b580 by Michael Stefaniuc <mstefani@redhat.de>
2024-02-20 16:38:36 +01:00
winesync 6b26c5b37d
[WINESYNC] setupapi: Implement SetupInstallFileExA/W.
wine commit id bd9c265cc26a4cf2c9141a99dadb2f9ccf4b6f8c by Hans Leidekker <hans@codeweavers.com>
2024-02-20 16:38:35 +01:00
winesync 268b193327
[WINESYNC] setupapi: Implement StringTableLookUpStringEx.
wine commit id 18b5366c35f95eb6e7fc6e19c50c371a81d5a980 by Hans Leidekker <hans@codeweavers.com>

[WINESYNC] setupapi: Add some tests for StringTableLookUpStringEx. Make them pass.

wine commit id 601870a4351753555bfa351a23328b2e1109c7b0 by Hans Leidekker <hans@codeweavers.com>

[WINESYNC] setupapi: Fix the StringTableLookUpStringEx() prototype.

wine commit id 916d6a44500735b3fecf0e7c485c2aa7e8025644 by Francois Gouget <fgouget@free.fr>

These commits have been grouped together, since all of these were
partially already present in the forked stringtable.c code.
2024-02-20 16:38:34 +01:00
winesync 1112a6a701
[WINESYNC] setupapi: Fix typo in StringTableGetExtraData.
wine commit id d8dad22c9783e1868ec4bb72d8051dd0a5f4f0a7 by Hans Leidekker <hans@codeweavers.com>
2024-02-20 16:38:33 +01:00
winesync 5cd932f1e2
[WINESYNC] setupapi: Implement StringTableAddStringEx.
wine commit id c2f99f30143e1180620980f3d5713456392c8ecf by Hans Leidekker <hans@codeweavers.com>

+ Re-integrate existing ReactOS bug fixes
+ Add missing dwExtraDataSize && lpExtraData zero/NULL checks in StringTableAddStringEx

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2024-02-20 16:38:32 +01:00
winesync 75a69f3b69
[WINESYNC] setupapi: Implement SetupInstallFile{A, W}.
wine commit id 19764fcf4c7c05d5badbef54be64170c2ebadd83 by Hans Leidekker <hans@codeweavers.com>

NOTE: Already committed in ReactOS in commit 336ef53fa (r37876).
The lost memory cleanup on failure will be recovered by wine commit
4d796458d0ed517d45adc57a1aedaf1c3bdde232
2024-02-20 16:38:31 +01:00
winesync 9b52894cb6
[WINESYNC] setupapi: Do not cast NULL.
wine commit id d62b48df2acece81b533a92fbca566cc4023be43 by Michael Stefaniuc <mstefani@redhat.de>
2024-02-20 16:38:30 +01:00
winesync a2ac7886cc
[WINESYNC] setupapi: Remove unneeded address-of operator from array name.
wine commit id ce2184e2f14e6ace87cd50c938b5e99d35ca80c1 by Andrew Talbot <andrew.talbot@talbotville.com>
2024-02-20 16:38:29 +01:00
winesync cf47417e5c
[WINESYNC] setupapi: Move strdupW and strdupWtoA to the setupapi_private.h header.
wine commit id 44ab294e0b6f285f1aab5fc8533a36e852be38fa by Alexandre Julliard <julliard@winehq.org>
2024-02-20 16:38:28 +01:00
Hermès Bélusca-Maïto 66ba252ba4
[SETUPAPI] Prepare for partial Wine sync.
- Add __REACTOS__ for ReactOS-specific copied files security descriptor support.
- Add missing __REACTOS__ guard + restoring original wine code in CopyFileW call.

- Remove erroneous casts: input parameters are already strings.
  Revert unnecessary changes from commit fc10b038f (r16937).
2024-02-20 16:38:26 +01:00