Commit graph

85238 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
winesync e02150ffe1
[WINESYNC] setupapi: Create the registry value if it doesn't exist in append_multi_sz_value().
wine commit id 38e36e8fdaf6dc682ce5af7b5b00cb795fffd967 by Zebediah Figura <zfigura@codeweavers.com>
2024-02-20 16:41:10 +01:00
winesync 66a7ba0218
[WINESYNC] setupapi: Fail installation when trying to append to a registry value of the wrong type.
wine commit id 0ab56b88dfdca442ab0820eacc14f6397f628924 by Zebediah Figura <zfigura@codeweavers.com>
2024-02-20 16:41:09 +01:00
winesync 635e77759f
[WINESYNC] setupapi/tests: Add tests for FLG_ADDREG_APPEND.
wine commit id d7c8279c08c25e2afddb33184522386e928d5497 by Zebediah Figura <zfigura@codeweavers.com>
2024-02-20 16:41:08 +01:00
winesync 9d592a7e0c
[WINESYNC] setupapi/tests: Don't test function directly when reporting GetLastError().
wine commit id 4b09ed1486b4c880c7ed1cbbfd3d9b1335f4d4ab by André Zwing <nerv@dawncrow.de>
2024-02-20 16:41:07 +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 cd252d5703
[WINESYNC] setupapi: Move prototypes not in Windows's setupapi.h to setupapi_private.h.
And delete the ones we don't need.

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

+ ReactOS: Private exports prototypes are added in sdk setupapi_undoc.h

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2024-02-20 16:41:04 +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 5369aafbc0
[WINESYNC] setupapi: Fill the required size in SetupDiGetDeviceInterfaceDetail() also on success.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53387

wine commit id d15262e464ba3536567ad73f68d95e6b7f88f3aa by Zebediah Figura <zfigura@codeweavers.com>
2024-02-20 16:41:02 +01:00
winesync 060d6f2482
[WINESYNC] setupapi: Correctly calculate the required size in SetupDiGetDeviceInterfaceDetailA().
Don't include the null terminator twice.

wine commit id 5711f03e8479936ac5e3bc71ba7987f6b7cb5586 by Zebediah Figura <zfigura@codeweavers.com>
2024-02-20 16:41:01 +01:00
winesync fef704dfdf
[WINESYNC] setupapi/tests: Add more tests for buffer size handling in SetupDiGetDeviceInterfaceDetail().
wine commit id 60af599bb916260e8bb8a2f5d0111815f741fef4 by Zebediah Figura <zfigura@codeweavers.com>
2024-02-20 16:41:00 +01:00
winesync d94bf49682
[WINESYNC] uuid: Add devguid.h.
Needed to compile Tera Term.

wine commit id e72a16b57f66b63a16bb3d1619ac4d42632cb141 by Alex Henrie <alexhenrie24@gmail.com>
2024-02-20 16:40:59 +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
winesync 515a47a67b
[WINESYNC] setupapi/tests: 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 b73e3102009cc7151ab58321800aeded24c1307f by Eric Pouech <eric.pouech@gmail.com>
2024-02-20 16:40:57 +01:00
winesync 20c488b2b3
[WINESYNC] setupapi/tests: Use correct integral type.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 0e4c108490db8d1c7b3c5d016979ace327d2c8ab by Eric Pouech <eric.pouech@gmail.com>
2024-02-20 16:40:56 +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 59a3f67dea
[WINESYNC] setupapi: Also handle DelFiles and RenFiles directives in SetupInstallFilesFromInfSection().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 506ce2ae6bc2fc1395da402a8ed0de4527fa7e24 by Zebediah Figura <zfigura@codeweavers.com>
2024-02-20 16:40:53 +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 797272c06f
[WINESYNC] setupapi/tests: Add more tests for SetupInstallFilesFromInfSection().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 63cdb0b91a80d6e4bfd7528131157a3f20f2de6f by Zebediah Figura <zfigura@codeweavers.com>
2024-02-20 16:40:51 +01:00
winesync b9ef0112dd
[WINESYNC] setupapi/tests: Test queuing the same copy operation twice.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id ef77468b5e041d55db3821778665a2a406ed72ea by Zebediah Figura <zfigura@codeweavers.com>
2024-02-20 16:40:50 +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 dcf1e1e7d6
[WINESYNC] setupapi/tests: Avoid "misleading indentation" warnings.
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 87acd4021848afffc4c2060c0494db1045c060d6 by Fabian Maurer <dark.shadow4@web.de>
2024-02-20 16:40:48 +01:00
winesync 8e6e2b7d85
[WINESYNC] setupapi/tests: Add some service installation flags tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 919ee014b93ba633ead2cfe44bcf475dbda55ecd by Rémi Bernon <rbernon@codeweavers.com>
2024-02-20 16:40:47 +01:00
winesync 58ea8d9390
[WINESYNC] setupapi/tests: Add possible test_need_media results for Win10.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 68b83a8a093d59d9ee085574c4c1ef64e6b28807 by Rémi Bernon <rbernon@codeweavers.com>
2024-02-20 16:40:46 +01:00
winesync d572469aa8
[WINESYNC] setupapi: Use lowercase device paths.
Some games are doing case sensitive matches on the device paths obtained from
Setup API and expect them to be lowercase.

This fixes Virginia not being able to discover DualShock 4.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 30a026d2454b2de93257e9eb895573ce8c56dc05 by Arkadiusz Hiler <ahiler@codeweavers.com>
2024-02-20 16:40:45 +01:00
winesync f8c0728e48
[WINESYNC] setupapi/tests: Add display device interface tests.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 5030f4cf26c31bc709d6565182b51af1165953a6 by Zhiyi Zhang <zzhang@codeweavers.com>

SYNC NOTE: These display GUIDs are Vista+, so temporarily elevate
NTDDI_VERSION to Vista.

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2024-02-20 16:40:44 +01:00
winesync 3a4c13e32b
[WINESYNC] setupapi: Rank drivers according to their id match.
And as described on MSDN "Driver Rank Example".

In order to safely remove the hardcoded XBox gamepad ID list from
winebus.sys, and list their hardware IDs in the (future) xinput.sys
driver INF.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id cfddd2c1e24fc03ad570f771093fd08bbf8b9575 by Rémi Bernon <rbernon@codeweavers.com>
2024-02-20 16:40:43 +01:00
winesync 325156fea5
[WINESYNC] setupapi: Create only one driver per driver id match.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id eb94d7aea85b13197f8d678baeca414adc05aaed by Rémi Bernon <rbernon@codeweavers.com>
2024-02-20 16:40:42 +01:00
winesync 4db2d8c197
[WINESYNC] setupapi/tests: Add more driver / device id match tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 9b2a25232312a073f288d683d48f9366d54654d3 by Rémi Bernon <rbernon@codeweavers.com>
2024-02-20 16:40:42 +01:00
winesync f620cb39c6
[WINESYNC] setupapi: Remove all device interfaces in SetupDiRemoveDevice().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 0b8c1d69e66094d72e00f30f370ec3f69fb43dfd by Zebediah Figura <z.figura12@gmail.com>
2024-02-20 16:40:41 +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