Commit graph

5651 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto
a8206bae3d
[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.
2025-02-01 21:34:58 +01:00
Hermès Bélusca-Maïto
d78a4a308a
[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>
2025-02-01 21:34:57 +01:00
Hermès Bélusca-Maïto
b28264a9cc
[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>
2025-02-01 21:34:56 +01:00
winesync
5adf1d4575
[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
2025-02-01 21:34:56 +01:00
winesync
a1188a84d8
[WINESYNC] setupapi: Rewrite DiskSpaceList logic using lists.
wine-staging patch by Michael Müller <michael@fds-team.de>

[WINESYNC] setupapi: Implement SetupAddToDiskSpaceList.

wine-staging patch by Michael Müller <michael@fds-team.de>

[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>

[WINESYNC] setupapi: Ignore deletion of added files in SetupAddToDiskSpaceList.

wine-staging patch by Michael Müller <michael@fds-team.de>

[WINESYNC] setupapi: ImplementSetupAddSectionToDiskSpaceList.

wine-staging patch by Michael Müller <michael@fds-team.de>

[WINESYNC] setupapi: Implement SetupAddInstallSectionToDiskSpaceList.

wine-staging patch by Michael Müller <michael@fds-team.de>
2025-02-01 21:34:55 +01:00
winesync
205538a382
[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>
2025-02-01 21:34:54 +01:00
Hermès Bélusca-Maïto
f3e1490a18
[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.
2025-02-01 21:34:53 +01:00
winesync
24d5860370
[WINESYNC] setupapi/tests: Don't test function directly when reporting GetLastError().
wine commit id 4b09ed1486b4c880c7ed1cbbfd3d9b1335f4d4ab by André Zwing <nerv@dawncrow.de>

[WINESYNC] setupapi/tests: Add tests for FLG_ADDREG_APPEND.

wine commit id d7c8279c08c25e2afddb33184522386e928d5497 by Zebediah Figura <zfigura@codeweavers.com>

[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>

[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>

[WINESYNC] setupapi: Use standard va_list instead of __ms_va_list.

wine commit id d3a9fa181cbf81f6b920d6ddc3760e78d1d18601 by Alexandre Julliard <julliard@winehq.org>
2025-02-01 21:34:52 +01:00
Hermès Bélusca-Maïto
a2e8fba9b1
[INTL][NETSHELL][SYSDM] Include setupapi_undoc.h for IsUserAdmin(). 2025-02-01 21:34:52 +01:00
Hermès Bélusca-Maïto
365a2e961c
[DEVMGR][HOTPLUG][NEWDEV][SYSSETUP] Include setupapi_undoc.h for pSetup* functions. 2025-02-01 21:34:51 +01:00
winesync
6b280f34f5
[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>

[WINESYNC] uuid: Add devguid.h.

Needed to compile Tera Term.

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

[WINESYNC] setupapi/tests: Add more tests for buffer size handling in SetupDiGetDeviceInterfaceDetail().

wine commit id 60af599bb916260e8bb8a2f5d0111815f741fef4 by Zebediah Figura <zfigura@codeweavers.com>

[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>

[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>

[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>
2025-02-01 21:34:49 +01:00
Hermès Bélusca-Maïto
237e7461ea
[SETUPAPI] Use long type also in SetupGetInfDriverStoreLocationA
Addendum for the previous commit.
2025-02-01 21:34:47 +01:00
winesync
5ff377c9ab
[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>
2025-02-01 21:34:46 +01:00
winesync
7d6df771c8
[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>

[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>

[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>

[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>

[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>

[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>

[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>

[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>

[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>
2025-02-01 21:34:45 +01:00
winesync
a78f1815b8
[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>
2025-02-01 21:34:43 +01:00
winesync
e96236418f
[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>

[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>

[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>

[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>

[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>

[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>

[WINESYNC] setupapi/tests: Expand tests for SetupIterateCabinet().

Partially based on a patch by Sebastian Lackner.

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

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

[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>

[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>

[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>
2025-02-01 21:34:42 +01:00
winesync
e1e06fef84
[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__.
2025-02-01 21:34:41 +01:00
winesync
554be12b9f
[WINESYNC] setupapi: Implement SetupDiGetSelectedDriver().
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48639
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

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

[WINESYNC] setupapi: Implement SetupDiGetDriverInfoDetail().

Needed by the Windows Device Framework co-installer.

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

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

[WINESYNC] setupapi: Store the original INF file path in a .pnf file.

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

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

[WINESYNC] setupapi/tests: Change return values from coinst functions.

As co_error and class_error both return 0xdeadbeef, use of 0xdeadbeef as
a canary value as well can lead to ambiguous tests results.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id cfde18c4904cd76eff40336e064cba86b9831633 by Jeff Smith <whydoubt@gmail.com>

[WINESYNC] setupapi/tests: Add error tests for SetupDiDestroyDeviceInfoList.

Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id f9028142d1e57322f893d7e47d846f72a8c6c72c by Jeff Smith <whydoubt@gmail.com>

[WINESYNC] setupapi: Clear error on SetupDiDestroyDeviceInfoList success.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49332
Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id babb1019d1a6adaa5a52398c192b55a083327f45 by Jeff Smith <whydoubt@gmail.com>

[WINESYNC] setupapi/tests: Add explicit field for inf contents size.

To make testing embedded NULs possible.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 43115a74f94293994904c9857996e9576dc3a8eb by Dmitry Timoshkov <dmitry@baikal.ru>

[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>

[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>
2025-02-01 21:34:40 +01:00
winesync
d3c8b81269
[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>
2025-02-01 21:34:39 +01:00
Hermès Bélusca-Maïto
5281625eaa
[SETUPAPI] Use wide character string literals in ReactOS-specific code too. 2025-02-01 21:34:38 +01:00
winesync
e28739f66d
[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>
2025-02-01 21:34:37 +01:00
winesync
ee359e6a11
[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>

[WINESYNC] setupapi/tests: Remove an unused variable.

Signed-off-by: Thomas Faber <thomas.faber@reactos.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id dc968dae42e3b3162e2767ed32b0f91ae9b23ad3 by Thomas Faber <thomas.faber@reactos.org>

[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>

[WINESYNC] setupapi/tests: Add test for IDF_CHECKFIRST and SetupPromptForDiskA/W.

With modifications from Hermes Belusca-Maito.

Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

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

[WINESYNC] guiddef.h: Remove GUID_NULL declaration.

It's declared in cguid.h with proper extern "C".

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id c041605b0074e6b12e5ea1df0cc645e772a220a7 by Jacek Caban <jacek@codeweavers.com>

[WINESYNC] setupapi: Implement SetupDiOpenDeviceInterfaceRegKey().

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

wine commit id 4a3cd01bd150c27d7fd40d04fc92b173f2f988af by Zhiyi Zhang <zzhang@codeweavers.com>

[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>
2025-02-01 21:34:35 +01:00
Hermès Bélusca-Maïto
1d439f4706
[SETUPAPI] Add missing Vista+ SetupGetInfDriverStoreLocationA, forgotten in Wine. 2025-02-01 21:34:35 +01:00
winesync
f554e58231
[WINESYNC] setupapi: Support full path enumerator in SetupDiGetClassDevs.
Based on a patch by Michael Müller.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35345
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

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

[WINESYNC] setupapi/tests: A spelling fix in an ok() message.

Signed-off-by: Francois Gouget <fgouget@free.fr>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 21db058d14ac6fb769a42bdeea3dadfa4fd0e8bf by Francois Gouget <fgouget@free.fr>

[WINESYNC] setupapi/tests: Fix a crash in the need_media tests.

Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 448f4cc9a25c6f994395978df0dfd7c7487b5dbb by Sven Baars <sven.wine@gmail.com>

[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>

[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>

[WINESYNC] setupapi/tests: Add some tests for SPFILENOTIFY_STARTCOPY.

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

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

[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>

[WINESYNC] setupapi/tests: Remove win_9x checks.

Signed-off-by: Vijay Kiran Kamuju <infyquest@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id c59e9d302b79527f4a99be71d1346f56737dc3f3 by Vijay Kiran Kamuju <infyquest@gmail.com>

[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>

[WINESYNC] setupapi/tests: Fix timeout on win10 1809+.

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

wine commit id 177d6d7f8981b9e036437d78023b76232dcadb3d by Zhiyi Zhang <zzhang@codeweavers.com>

[WINESYNC] setupapi/tests: Add default device registry property tests.

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

wine commit id 4fe3d7e220225ddd57ef0acd9142ef8437cdb9ca by Zhiyi Zhang <zzhang@codeweavers.com>

[WINESYNC] setupapi: Set device SPDRP_CLASS registry property in create_device().

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

wine commit id 288a6625ad0177e258a0db1da166d292ff420b1e by Zhiyi Zhang <zzhang@codeweavers.com>

[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>
2025-02-01 21:34:34 +01:00
winesync
283648f6c5
[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>
2025-02-01 21:34:33 +01:00
winesync
2e5c712eb6
[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>

[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>

[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>

[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>

[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>

[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>

[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>

[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>

[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>

[WINESYNC] setupapi/tests: Add tests for building and enumerating driver lists.

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

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

[WINESYNC] setupapi: Add a basic implementation of SetupDiCallClassInstaller().

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

wine commit id 43ee138d4747722cfc7d27e59014a47c3003a898 by Zebediah Figura <z.figura12@gmail.com>
2025-02-01 21:34:30 +01:00
Hermès Bélusca-Maïto
b22b28a68d
[SETUPAPI] Prepare for syncing dirid.c with Wine.
[WINESYNC] Initial bootstrap for setupapi partial sync.

Start syncing at wine-4.8 for:
- dirid.c
- diskspace.c
2025-02-01 21:34:30 +01:00
winesync
1a68e54d1b
[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>

[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>
2025-02-01 21:34:29 +01:00
Hermès Bélusca-Maïto
07b9b00664
[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.
2025-02-01 21:34:28 +01:00
winesync
e9c8352803
[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>

[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>

[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>

[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>

[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>
2025-02-01 21:34:27 +01:00
Hermès Bélusca-Maïto
bc09be375a
[SETUPAPI] Additional adaptations for ReactOS-specific get_src_file_info(). 2025-02-01 21:34:26 +01:00
winesync
0413993a2c
[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>

[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>
2025-02-01 21:34:26 +01:00
winesync
90e557fd4e
[WINESYNC] !! Wine commit code removal kept for ReactOS only !!
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>
2025-02-01 21:34:25 +01:00
winesync
59c0527690
[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>

[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>

[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>

[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>

[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>
2025-02-01 21:34:24 +01:00
winesync
090f1b629b
[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).
2025-02-01 21:34:23 +01:00
winesync
5820e2f627
[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>

[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>

[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>

[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>

[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>

[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>

[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>

[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>

[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>

[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>

[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>

[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>

[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>

[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>

[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>

[WINESYNC] setupapi/tests: Avoid using snprintf().

Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 7204f0f67f9fbd8765fce86c4195269c4f5aa876 by Alexandre Julliard <julliard@winehq.org>
2025-02-01 21:34:22 +01:00
winesync
ea725d3792
[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>

[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>
2025-02-01 21:34:20 +01:00
Hermès Bélusca-Maïto
18b5ed73aa
[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.
2025-02-01 21:34:18 +01:00
Hermès Bélusca-Maïto
8c5282d277
[WINESYNC] Initial bootstrap for setupapi partial sync.
Start syncing at wine-1.9.4 for:
- query.c
- setupcab.c

[WINESYNC] Initial bootstrap for setupapi dialog.c partial sync.

Start syncing at wine-1.9.15

[WINESYNC]: revert wine-staging patchset for setupapi
2025-02-01 21:34:18 +01:00
winesync
6994a8f76c
[WINESYNC] setupapi: Make default context structure layout compatible.
wine commit id dcab5fe61bed87b291901ceff686894a64871d98 by Nikolay Sivov <nsivov@codeweavers.com>

[WINESYNC] setupapi: Remove dead code (Clang).

Signed-off-by: André Hentschel <nerv@dawncrow.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 9edfb14c6be13f599aafe5e300986f10e6fb999d by André Hentschel <nerv@dawncrow.de>

NOTE: Already committed in ReactOS in commit cd73072e5 (r72565)
2025-02-01 21:34:17 +01:00
Hermès Bélusca-Maïto
647d452a7a
[SETUPAPI] Guard in __WINESRC__ original Wine code that has been improved in ReactOS.
See commit 1cda0af51 (r27896) for more details.
2025-02-01 21:34:16 +01:00
Hermès Bélusca-Maïto
378ff5bb6b
[WINESYNC] setupapi: Implement a binary compatible string table.
wine commit id 8802f84c8cc473d5617c134c16973b1cb2c4b53e by Nikolay Sivov <nsivov@codeweavers.com>

+ Compile wine's stringtable.c , but keep ours around for the time being.
2025-02-01 21:34:15 +01:00
Hermès Bélusca-Maïto
f9146968b3
[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.
2025-02-01 21:34:13 +01:00
winesync
56ece9b185
[WINESYNC] setupapi: Move strdupW and strdupWtoA to the setupapi_private.h header.
wine commit id 44ab294e0b6f285f1aab5fc8533a36e852be38fa by Alexandre Julliard <julliard@winehq.org>

[WINESYNC] setupapi: Remove unneeded address-of operator from array name.

wine commit id ce2184e2f14e6ace87cd50c938b5e99d35ca80c1 by Andrew Talbot <andrew.talbot@talbotville.com>

[WINESYNC] setupapi: Do not cast NULL.

wine commit id d62b48df2acece81b533a92fbca566cc4023be43 by Michael Stefaniuc <mstefani@redhat.de>

[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

[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>

[WINESYNC] setupapi: Fix typo in StringTableGetExtraData.

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

[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.

[WINESYNC] setupapi: Implement SetupInstallFileExA/W.

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

[WINESYNC] setupapi: Remove superfluous pointer casts.

wine commit id ffae0123ac46ba6dfac74d7c84422073fd53b580 by Michael Stefaniuc <mstefani@redhat.de>

[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>

[WINESYNC] setupapi: Destination directory defaults to system directory.

wine commit id 1b8ba2537111f0d691d2592bb4ffb6bc4fe4f20e by Hans Leidekker <hans@codeweavers.com>

[WINESYNC] setupapi: Avoid hardcoding the Unicode string literal lengths.

wine commit id 9097fa132e56cc542fa3ea77706fea79353d2f4a by Francois Gouget <fgouget@free.fr>

[WINESYNC] setupapi: Avoid memory leaks (coverity).

wine commit id 4d796458d0ed517d45adc57a1aedaf1c3bdde232 by André Hentschel <nerv@dawncrow.de>

[WINESYNC]: setupapi/stringtable.c is now in sync with wine-staging wine-1.7.18
2025-02-01 21:34:13 +01:00
Hermès Bélusca-Maïto
07e3e7d3c4
[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).
2025-02-01 21:34:11 +01:00
winesync
70b6e54cb8
[WINESYNC] setupapi: setupapi.h must not define HSTRING_TABLE and the StringTable* prototypes.
wine commit id 7ab6d8522b614f6e9d9773fa86151ab05fb05a19 by Francois Gouget <fgouget@free.fr>

Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
2025-02-01 21:34:10 +01:00
Hermès Bélusca-Maïto
c19769b9bd
Partially revert commit 30810893ad.
[SETUPAPI]
- Add 'pSetup'-Prefix to the string table functions according to the new naming convention.
- Remove the obsolete function StringTableTrim.
2025-02-01 21:34:08 +01:00
Hermès Bélusca-Maïto
5a17e99bdb
[SETUPAPI] Prepare Wine syncing.
- Rename global hInstance to SETUPAPI_hInstance;
- Add ARRAY_SIZE in case it is not defined.

- Use the CRT oldnames library.
  Remove the '-Dwcsnicmp=_wcsnicmp' and use the alias in the oldnames lib.
  This will also fix wcslwr() usage in the next commits.
2025-02-01 21:34:07 +01:00
Hermès Bélusca-Maïto
4648a2210f
[SETUPAPI][SETUPAPI_WINETEST] Use conforming swprintf 2025-02-01 21:34:06 +01:00
Whindmar Saksit
77e4217919
[SHELL32] CMenuBand must set ShowWindow value for InvokeCommand (#7695) 2025-02-01 13:50:22 +01:00