Commit graph

85276 commits

Author SHA1 Message Date
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 9531df2634
[WINESYNC] setupapi/tests: Add some tests for SetupInstallFile().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 2ddc60c8f0276c739b2f512397d32e1b9425e4b0 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:36 +01:00
winesync 361ce98ce2
[WINESYNC] setupapi: Return the section name in SetupDiGetActualSectionToInstall() even if it doesn't exist.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 23320d05b628575ab9ccb44e4482a30268e9a93e by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:35 +01:00
winesync 23e342d5ff
[WINESYNC] setupapi/tests: Add tests for SetupDiGetActualSectionToInstall().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 6244f05941f13bf330d68208849d74ae54f116a0 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:34 +01:00
winesync 5a032785d0
[WINESYNC] setupapi/tests: Add some basic tests for SetupDi{Get, Set}DeviceInstallParams().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 45d199023f440209c5753e055db233924664df22 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:33 +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 6edb489043
[WINESYNC] Initial bootstrap for setupapi partial sync.
Start syncing at wine-4.8 for:
- dirid.c
- diskspace.c
2024-02-20 16:39:30 +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
winesync dd918fe881
[WINESYNC] setupapi/tests: Add tests for source media path resolution.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id d5a6a2675c250cffd7b37a27d61fc2031b1d7b21 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:27 +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 73fc9ca039
[WINESYNC] setupapi/tests: Add some tests for SetupInstallFilesFromInfSection().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 02df7eeb5bbed4f94840cec4cd8c3d0ad3da9eda by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:13 +01:00
winesync f8d21cf7bc
[WINESYNC] setupapi/tests: Avoid assert().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 2d13b6b74cfa4a21f2b575081331619fb6cebfed by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:12 +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 40d6d25cb9
[WINESYNC] setupapi/tests: Avoid using snprintf().
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 7204f0f67f9fbd8765fce86c4195269c4f5aa876 by Alexandre Julliard <julliard@winehq.org>
2024-02-20 16:39:10 +01:00
winesync f40120eed5
[WINESYNC] setupapi: Check registered device duplicate in SetupDiCreateDeviceInfo().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 1fa7782c080e5d4719bb230110992a0705f9b224 by Zhiyi Zhang <zzhang@codeweavers.com>
2024-02-20 16:39:10 +01:00
winesync 73615556e8
[WINESYNC] setupapi/tests: Add more SetupDiCreateDeviceInfo() tests.
SetupDiCreateDeviceInfo() should report last error
ERROR_DEVINST_ALREADY_EXISTS when an registered instance exists
when creating a device for an empty set.

Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 7876234e3ad3f664bdc02e976458dc87fb00f0a5 by Zhiyi Zhang <zzhang@codeweavers.com>
2024-02-20 16:39:09 +01:00
winesync c07b9d2b1c
[WINESYNC] setupapi/tests: Add SetupDiOpenDeviceInfo() tests.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 0b9b1cbf56a035a78cce6003392b95d4c43a3144 by Zhiyi Zhang <zzhang@codeweavers.com>
2024-02-20 16:39:08 +01:00
winesync 9562a36429
[WINESYNC] setupapi: Set phantom value after device creation.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 64c09819cf937b87344b41d049d43e4b8754fb64 by Zhiyi Zhang <zzhang@codeweavers.com>
2024-02-20 16:39:07 +01:00
winesync 2f25688991
[WINESYNC] setupapi/tests: Test phantom value after device creation.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 35673c7e8e0709276fe6f0bb2727da3da438ec11 by Zhiyi Zhang <zzhang@codeweavers.com>
2024-02-20 16:39:06 +01:00
winesync 9c3ba23c74
[WINESYNC] setupapi/tests: Add a trailing '\n' to a couple of ok() calls.
Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 9f2baf1dd49590a0f8dada5a050719b7e2be697c by Francois Gouget <fgouget@free.fr>
2024-02-20 16:39:05 +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 fb2bbc5649
[WINESYNC] setupapi: Handle error translation in SetupDiOpenDevRegKey().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id f703c7f22d5da5596c9abc91400191d3e12c3cbc by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:03 +01:00
winesync 39e75a324b
[WINESYNC] setupapi: Return the "Device Parameters" subkey for DIREG_DEV.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=21023
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 486fffa45c47fa102a40f88ea4f46c74fbd7640c by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:39:02 +01:00
winesync e72847baa8
[WINESYNC] setupapi/tests: Avoid sizeof in traces.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id d70d6b8486fc880e8fd72f6d409464deb518a639 by Alexandre Julliard <julliard@winehq.org>
2024-02-20 16:39:01 +01:00
winesync f3b19fe099
[WINESYNC] setupapi: Implement SetupDiGetDevicePropertyW.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 307812c30d2d9a037e3ebfc9c392bfe11fe39112 by Zhiyi Zhang <zzhang@codeweavers.com>
2024-02-20 16:39:00 +01:00
winesync e2517f2a6f
[WINESYNC] setupapi: Implement SetupDiSetDevicePropertyW.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id afac1c405d0d82839df7c0c3d6299921bdd26a89 by Zhiyi Zhang <zzhang@codeweavers.com>
2024-02-20 16:38:59 +01:00
winesync 70a3840a3a
[WINESYNC] setupapi: Also remove the driver key in remove_device().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 7e4c1a20740c8b2e2a46c3bd906d07213598aa41 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:38:59 +01:00
winesync 3e97c17d9d
[WINESYNC] setupapi/tests: Create the setup class key before trying to create the driver key.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 00c8c270321f75d34c08f77300bd7082df761e42 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:38:58 +01:00
winesync a6b763a45e
[WINESYNC] setupapi: Store the path to the driver key in the device key.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id e26f8464e90462654d846657bf15938f1f287664 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:38:57 +01:00
winesync df3a46577e
[WINESYNC]: revert wine-staging patchset for setupapi 2024-02-20 16:38:56 +01:00
Hermès Bélusca-Maïto 6f524b5113
[WINESYNC] Initial bootstrap for setupapi winetest partial sync.
- Initial sync config file;
- Add reconstructed WineStaging v4.0 setupapi patches that were originally
  applied (and need to be reverted).
2024-02-20 16:38:55 +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 d98469cf15
[WINESYNC] Initial bootstrap for setupapi parser.c partial sync.
Start syncing at Wine-2.2
2024-02-20 16:38:52 +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