Commit graph

5109 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto be52cb7d7c
** WIP ** SETUPAPI: Improve do_file_copyW: Generate a temporary file path based on the target path (thus, ensured to be writable)
Needed because we may run setupapi to extract and copy files to a
writable target directory, from a read-only ReactOS installation
(e.g. livecd)
2024-02-20 16:43:27 +01:00
Hermès Bélusca-Maïto bbf6c45279
[SETUPAPI] Slightly improve pSetupGetFileTitle
- Make the function return a pointer to const string.
- Skip any drive path if any, looking for ':' just once.
2024-02-20 16:43:26 +01:00
Hermès Bélusca-Maïto e8b454a92e
[SETUPAPI] .spec file: Add NT6+ stubs and -version info for some functions.
Note that the exports are sorted by _ordinal_ and not by name, for
compatibility with Windows' setupapi.dll.

Cross-checked with:
- https://abi-laboratory.pro/compatibility/Windows_5.0_to_Windows_6.0/x86_64/compat_reports/setupapi.dll/abi_compat_report.html
- http://redplait.blogspot.com/2010/11/setupapidll-exports.html
- https://blog.airesoft.co.uk/apichanges/changes-Vista%20SP2-To-7%20SP0.xml#setupapi.dll
- https://blog.airesoft.co.uk/apichanges/changes-7%20SP1-To-8%20SP0.xml#setupapi.dll
- https://blog.airesoft.co.uk/apichanges/changes-8%20SP0-To-8.1.xml#setupapi.dll
- https://windows10dll.nirsoft.net/setupapi_dll.html

and manually with setupapi.dll from Win2k3, Vista, Windows 7 and 10.
2024-02-20 16:41:24 +01:00
Hermès Bélusca-Maïto 30921965be
[SETUPAPI] Add missing NULL parameter checks in SetupOpenInfFileW and SetupDiGetINFClassW.
Based on PR #5673, ROSTESTS-388

Co-authored-by: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
2024-02-20 16:41:23 +01:00
Hermès Bélusca-Maïto febda67eff
[SETUPAPI] diskspace.c: Fix memory allocations.
- The allocated file element should use the CRT allocator, as it is how
  it gets freed in SetupDestroyDiskSpaceList (and SetupDuplicateDiskSpaceListW)

- GetFullPathNameW() takes the buffer size in number of characters, not
  in bytes.

Fix for wine-staging commit:
setupapi: Implement SetupAddToDiskSpaceList.
wine-staging patch by Michael Müller <michael@fds-team.de>
2024-02-20 16:41:22 +01:00
winesync a04b28e92c
[WINESYNC]: setupapi is partially in sync, and setupapi_winetest is in sync with wine-staging wine-8.15
- dialog.c
- dirid.c
- diskspace.c
- parser.c
- query.c
- queue.c
- setupcab.c
- stringtable_wine.c
- setupapi_winetest
2024-02-20 16:41:21 +01:00
winesync c8be1ae834
[WINESYNC] setupapi: Implement SetupAddInstallSectionToDiskSpaceList.
wine-staging patch by Michael Müller <michael@fds-team.de>
2024-02-20 16:41:19 +01:00
winesync dd0c4303a2
[WINESYNC] setupapi: ImplementSetupAddSectionToDiskSpaceList.
wine-staging patch by Michael Müller <michael@fds-team.de>
2024-02-20 16:41:18 +01:00
winesync 29c1323f00
[WINESYNC] setupapi: Ignore deletion of added files in SetupAddToDiskSpaceList.
wine-staging patch by Michael Müller <michael@fds-team.de>
2024-02-20 16:41:17 +01:00
winesync 3ad50272d5
[WINESYNC] setupapi: Implement SetupQueryDrivesInDiskSpaceList.
wine-staging patch by Michael Müller <michael@fds-team.de>

+ Add the .spec exports.

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2024-02-20 16:41:16 +01:00
winesync 492011e956
[WINESYNC] setupapi: Implement SetupAddToDiskSpaceList.
wine-staging patch by Michael Müller <michael@fds-team.de>
2024-02-20 16:41:15 +01:00
winesync 4ab556830d
[WINESYNC] setupapi: Rewrite DiskSpaceList logic using lists.
wine-staging patch by Michael Müller <michael@fds-team.de>
2024-02-20 16:41:14 +01:00
winesync aa28089900
[WINESYNC] setupapi: Use CRT functions for memory allocation where possible.
The big win here is getting rid of the reimplementation of wcsdup.

wine commit id c293cd781fb4b330b7d93171501134f86a5138b8 by Alex Henrie <alexhenrie24@gmail.com>

+ Similar adaptations in ReactOS-specific code.

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2024-02-20 16:41:13 +01:00
Hermès Bélusca-Maïto ad92792811
[SETUPAPI] Add a temporary private implementation of _recalloc.
Needed for the next commit.

Code has been copied and adapted from sdk/lib/crt/wine/heap.c.
This is because this NT6+ function is not currently exported
from MSVCRT.DLL, and it is not possible to static-link parts
of the CRT lib while also using the dll.
2024-02-20 16:41:12 +01:00
winesync 8b30c01165
[WINESYNC] setupapi: Use standard va_list instead of __ms_va_list.
wine commit id d3a9fa181cbf81f6b920d6ddc3760e78d1d18601 by Alexandre Julliard <julliard@winehq.org>
2024-02-20 16:41:11 +01:00
Hermès Bélusca-Maïto 44e2420612
[INTL][NETSHELL][SYSDM] Include setupapi_undoc.h for IsUserAdmin(). 2024-02-20 16:41:06 +01:00
Hermès Bélusca-Maïto 70ac8fe290
[DEVMGR][HOTPLUG][NEWDEV][SYSSETUP] Include setupapi_undoc.h for pSetup* functions. 2024-02-20 16:41:05 +01:00
winesync 888c3abfc3
[WINESYNC] setupapi: Use _S_I(READ|WRITE) from sys/stat.h instead of redefining them.
wine commit id a1ae33a3efb7231adf683484e9de66f84abb04d1 by Alex Henrie <alexhenrie24@gmail.com>
2024-02-20 16:41:03 +01:00
winesync 014fb7b8f2
[WINESYNC] setupapi: Add SetupQueryInfVersionInformationA/W stub.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52616
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id dc0aa67ce690f67ae8c12d7bed0a449c1af8c693 by Gijs Vermeulen <gijsvrm@gmail.com>
2024-02-20 16:40:58 +01:00
Hermès Bélusca-Maïto da53374174
[SETUPAPI] Use long type also in SetupGetInfDriverStoreLocationA
Addendum for the previous commit.
2024-02-20 16:40:55 +01:00
winesync 982d65b93c
[WINESYNC] setupapi: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id e498e0ec9bf5a3f9cdb965f8668888697ac642ae by Eric Pouech <eric.pouech@gmail.com>
2024-02-20 16:40:54 +01:00
winesync 0fa54f958b
[WINESYNC] setupapi: Use the source path if the target path is missing in SetupQueueRename().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 47111ff6b08dc019456d0f3c910a924deb1267d2 by Zebediah Figura <zfigura@codeweavers.com>
2024-02-20 16:40:52 +01:00
winesync 2d6bd39e24
[WINESYNC] setupapi: Use correct integral type.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id fd8d0babe1ba8efde1d5a251deee43994d2d8eec by Eric Pouech <eric.pouech@gmail.com>
2024-02-20 16:40:49 +01:00
winesync 4f40e8febd
[WINESYNC] setupapi: Add a few printer directory ids.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 00b9c975d4bd3a24ae41c99057d7a1a32f329c00 by Alexandre Julliard <julliard@winehq.org>

SYNC NOTE: This commit also reverts wine commit 000136ac301327a85fecbd0aef788bc1629b6121
"setupapi: Add support for DIRID_PRINTPROCESSOR." by Andrey Turkin <andrey.turkin@gmail.com>
2024-02-20 16:40:40 +01:00
winesync 909b686cf2
[WINESYNC] setupapi: Pass the full cabinet path as the second parameter to SPFILENOTIFY_FILEINCABINET.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 8cb6e9585eefd4b0c0257f549d738f6a10f0d097 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:40:39 +01:00
winesync 60bf103205
[WINESYNC] setupapi: Set the Source field to the full cabinet path for SPFILENOTIFY_FILEEXTRACTED.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id b67deb0d2f03f7963f3247e4a4477b668a7ace35 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:40:38 +01:00
winesync 7af2e21724
[WINESYNC] setupapi: Set the CabinetFile field to the name of the next cabinet.
Verified through manual testing.

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

wine commit id 811da7bf1a37fc4e3851971a7e96e28b445efebc by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:40:37 +01:00
winesync b35058fce8
[WINESYNC] setupapi: Make the FDI handle a local variable.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id b70b153c59e2aa9365beecc94ef63f6fefb19b9f by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:40:35 +01:00
winesync d6cb3ad97c
[WINESYNC] setupapi: Remove unnecessary error handling from cabinet callbacks.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 6b248f788c251223e2b7123cad90a25f55e13337 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:40:34 +01:00
winesync 9bdb01905d
[WINESYNC] setupapi: Remove some superfluous traces.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 0b4d3dc2e8d4097997e69dd27ede7bbd8d92af05 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:40:33 +01:00
winesync 5b66f23245
[WINESYNC] setupapi: Link directly to cabinet.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id ad59a006ac9839c8bd29e4c4c6b80e6fc736136d by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:40:32 +01:00
winesync 07baff8739
[WINESYNC] setupapi: Implement SetupIterateCabinetW() on top of SetupIterateCabinetA().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 85afec5f2d09286d835c69bcc519780f6c103f22 by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:40:31 +01:00
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