Commit Graph

263 Commits

Author SHA1 Message Date
Arkadiusz Hiler 30a026d245 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>
2021-12-23 22:57:01 +01:00
Rémi Bernon cfddd2c1e2 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>
2021-08-18 20:07:08 +02:00
Rémi Bernon eb94d7aea8 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>
2021-08-18 20:07:06 +02:00
Rémi Bernon fcb6da3af4 setupapi: Use a struct driver instead of individual local variables.
In enum_compat_drivers_from_file.

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>
2021-08-18 20:07:04 +02:00
Zebediah Figura d9c5b213d6 setupapi: Quiet a noisy warning.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-19 20:08:48 +02:00
Arkadiusz Hiler 268fb3d1d6 setupapi: Demote ERR on opening driver key to a TRACE.
open_driver_key() is called by create_driver_key() and SetupDiOpenDevRegKey()
which depend on the failure path to detect the presence of the key.

This causes a lot of unnecessary errors being printed out.

Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-13 17:39:20 +02:00
Nikolay Sivov babdaffff7 setupapi: Fix use after free in trace message (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-12 19:35:17 +02:00
Zebediah Figura 0b8c1d69e6 setupapi: Remove all device interfaces in SetupDiRemoveDevice().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-08 12:14:31 +02:00
Zebediah Figura f023028640 setupapi: Reënumerate root PnP devices in SetupDiRemoveDevice().
Allow them to be unloaded.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 21:15:38 +02:00
Zebediah Figura 304b094d16 setupapi: Reënumerate root PnP devices in SetupDiInstallDevice().
If the service is already running, starting it has no effect.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 21:15:30 +02:00
Jeff Smith babb1019d1 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>
2020-08-03 15:52:15 +02:00
Alexandre Julliard 2487a35372 setupapi: Avoid storing uninitialized data in the registry.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-15 11:21:34 +02:00
Gijs Vermeulen 9a044007cc setupapi: Add SetupDiGetActualSectionToInstallExA/W.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49130
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-12 10:58:08 +02:00
Andrew Eikum 20a283e7e2 setupapi: Quiet down missing driver debug message.
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-01 21:51:31 +02:00
Sven Baars dcc6a143e9 setupapi: Make sure the class name is always set on success in SetupDiGetINFClassW (Valgrind).
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-17 21:06:11 +02:00
Sven Baars b08974900f setupapi: Only copy driver info if SetupDiEnumDriverInfoW succeeded (Valgrind).
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-17 21:06:03 +02:00
Sven Baars c85b140531 setupapi: Fix a leak on early return in SetupDiGetDriverInfoDetailA (Valgrind).
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-17 21:05:58 +02:00
Sven Baars 75e878346a setupapi: Fix a memory leak (Valgrind).
Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-17 21:05:54 +02:00
Zhiyi Zhang e570c2fe59 setupapi: Fix a registry key handle leak.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-04-17 19:58:11 +02:00
Zebediah Figura dd74b9c8e6 setupapi: Use the "section" and "description" fields directly in more places.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-09 12:10:52 +01:00
Zebediah Figura 5cff8c9e2e 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>
2020-03-09 12:10:52 +01:00
Zebediah Figura 6971dfcfc2 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>
2020-03-09 12:10:52 +01:00
Zhiyi Zhang 4a3cd01bd1 setupapi: Implement SetupDiOpenDeviceInterfaceRegKey().
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-02-04 21:30:27 +01:00
Jacek Caban c041605b00 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>
2020-02-04 21:30:27 +01:00
Chip Davis 4588f10f8d setupapi: Implement CM_Get_DevNode_Property[_Ex]W().
Signed-off-by: Chip Davis <cdavis@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-01-28 19:44:12 +01:00
Zhiyi Zhang 288a6625ad 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>
2019-11-18 23:18:00 +01:00
Zebediah Figura 404cee2aa6 setupapi: Set the DeviceDesc value in SetupDiInstallDevice().
At least one PnP enumeration utility expects this.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-08 10:29:28 +01:00
Zebediah Figura 7d152715ef setupapi: Set the device class in SetupDiBuildDriverInfoList().
This matches Windows XP behaviour. In Vista and later this appears to be done
by UpdateDriverForPlugAndPlayDevices().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-08 10:29:23 +01:00
Zhiyi Zhang d5e24897e2 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>
2019-07-31 09:34:32 +02:00
Alexandre Julliard 72d6759f3a setupapi: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-05 11:38:15 +02:00
Zebediah Figura 72f298e3f7 setupapi: Also start newly installed root PnP services in SetupDiInstallDevice().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-27 09:29:13 +02:00
Zebediah Figura e2194b93b5 setupapi: Avoid adding duplicate devices in SetupDiGetClassDevs().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-28 12:06:45 +02:00
Zebediah Figura bd12a0ace8 setupapi: Set the list device class to GUID_NULL when enumerating interfaces.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-28 12:06:45 +02:00
Zebediah Figura 5ff5c7036e setupapi: Treat DIGCF_ALLCLASSES as if a NULL device class was given.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-28 12:06:45 +02:00
Zebediah Figura b2adecd5e4 setupapi: Process the .Services subsection in SetupDiInstallDevice().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-27 14:36:31 +02:00
Zebediah Figura cd6ee00cfd setupapi: Process the .HW subsection in SetupDiInstallDevice().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-27 14:36:27 +02:00
Zebediah Figura d4c18c89d5 setupapi: Copy the INF file to C:/windows/inf/ and record it in the driver key.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-27 14:36:23 +02:00
Zebediah Figura dc9c4221bd setupapi: Add a basic implementation of SetupDiInstallDevice().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-27 14:36:19 +02:00
Zebediah Figura a37c4262e9 setupapi: Implement SetupDiInstallDeviceInterfaces().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-23 08:57:34 +02:00
Zebediah Figura 94256fccae setupapi: Process interface sections in SetupDiInstallDriverFiles().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-23 08:57:31 +02:00
Zebediah Figura 1c25cc09b5 setupapi: Implement SetupDiInstallDriverFiles().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-23 08:57:28 +02:00
Zebediah Figura a3a4751a76 setupapi: Implement device-specific co-installers in SetupDiCallClassInstaller().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-22 19:17:18 +02:00
Zebediah Figura 8b1050c7f4 setupapi: Implement class co-installers in SetupDiCallClassInstaller().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-22 19:17:16 +02:00
Zebediah Figura afba7d9d93 setupapi: Call DIF_DESTROYPRIVATEDATA when deleting a device.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-22 19:17:13 +02:00
Zebediah Figura fce26e60cc setupapi: Implement custom class installers in SetupDiCallClassInstaller().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-22 19:17:11 +02:00
Zebediah Figura 43ee138d47 setupapi: Add a basic implementation of SetupDiCallClassInstaller().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-22 19:17:07 +02:00
Zebediah Figura a35a2ec2af setupapi: Implement SetupDiRegisterCoDeviceInstallers().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-22 19:17:04 +02:00
Zebediah Figura 9fa4a2af1c setupapi: Add a semi-stub implementation of SetupDiSelectBestCompatDrv().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-21 18:08:37 +02:00
Zebediah Figura 23be8593e9 setupapi: Implement SetupDiEnumDriverInfo().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-21 18:08:37 +02:00
Zebediah Figura ec02dde9d2 setupapi: Implement directory search in SetupDiBuildDriverInfoList().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-21 18:08:37 +02:00