Commit Graph

885 Commits

Author SHA1 Message Date
Alex Henrie 837b4aa429 setupapi: Turn several constants and variables into static constants.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-30 19:36:51 +01:00
Marcus Meissner 161d02fd5d setupapi: Fix size passed to MultiByteToWideChar.
Signed-off-by: Marcus Meissner <meissner@suse.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-29 17:48:33 +01:00
Zebediah Figura 0c0aa90a90 setupapi: Avoid unnecessary buffer allocation in SETUPDI_EnumerateMatchingDeviceInstances().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-28 09:35:44 +01:00
Zebediah Figura 462c74bcdb setupapi: Avoid unnecessary buffer allocation in SetupDiCreateDeviceInfoW().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-28 09:35:42 +01:00
Zebediah Figura 81d2b419b8 setupapi: Avoid unnecessary buffer allocation in SetupDiGetDeviceInstanceIdA().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-28 09:35:35 +01:00
Zebediah Figura ad5314040b setupapi: Avoid unnecessary buffer allocation in SetupDiCreateDeviceInfoA().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-28 09:35:32 +01:00
Zebediah Figura 8289c651c0 setupapi: Enforce a maximum device instance ID length.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-28 09:35:24 +01:00
Zebediah Figura 72c5f3b57d setupapi: Store the class and reference string keys in the device_iface structure.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-27 09:00:22 +01:00
Zebediah Figura 48be283250 setupapi/tests: Remove workarounds in test_SetupDiOpenClassRegKeyExA().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-26 12:30:13 +01:00
Zebediah Figura bc8a117747 setupapi/tests: Remove workarounds in test_SetupDiCreateDeviceInfoListEx().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-26 12:30:11 +01:00
Zebediah Figura 3fef0ace16 setupapi/tests: Remove workarounds in testSetupDiGetINFClassA().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-26 12:30:08 +01:00
Zebediah Figura aba3ed75f1 setupapi/devinst: Factor out get_device_set().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-26 12:21:59 +01:00
Zebediah Figura cdb486ae0a setupapi/devinst: Factor out get_device_iface().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-26 12:21:57 +01:00
Zebediah Figura 62bf00b94f setupapi/devinst: Factor out get_device().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-26 12:21:53 +01:00
Zebediah Figura ca2cd98334 setupapi/tests: Remove workarounds in testDeviceRegistryPropertyW().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-23 12:51:37 +01:00
Zebediah Figura 1b032c2b12 setupapi/tests: Remove workarounds in testDeviceRegistryPropertyA().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-23 12:51:20 +01:00
Zebediah Figura af1362c8c8 setupapi/tests: Remove workarounds in testRegisterAndGetDetail().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-23 12:51:16 +01:00
Zebediah Figura c471e4cff4 setupapi/tests: Remove workarounds in testDevRegKey().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-23 12:51:10 +01:00
Zebediah Figura c9c646e9bb setupapi/tests: Remove workarounds in testGetDeviceInterfaceDetail().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-22 11:48:20 +01:00
Zebediah Figura 75a91c4e63 setupapi/tests: Add more tests for device interfaces.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-22 11:48:18 +01:00
Zebediah Figura 72cbe53bd8 setupapi/tests: Remove workarounds in testCreateDeviceInterface().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-22 11:48:17 +01:00
Zebediah Figura 9ac9e4b955 setupapi/tests: Add some more tests for SetupDiRegisterDeviceInfo().
Changed USB\BOGUS to the testcase used elsewhere since it fails on Windows 8.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-21 17:05:31 +01:00
Zebediah Figura 4e9b306e06 setupapi/tests: Remove workarounds in testRegisterDeviceInfo().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-21 17:05:30 +01:00
Zebediah Figura 16eb2b267c setupapi/tests: Remove workarounds in testGetDeviceInstanceId().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-21 17:05:28 +01:00
Zebediah Figura f86e796574 setupapi/tests: Add more tests for creating and removing devices.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-20 09:59:01 +01:00
Zebediah Figura 3af97988f1 setupapi/tests: Remove workarounds in testCreateDeviceInfo().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-20 09:58:59 +01:00
Zebediah Figura 7201eb5d79 setupapi/tests: Remove workarounds in testInstallClass().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-20 09:58:58 +01:00
Alistair Leslie-Hughes 8533516988 setupapi: Fix broken control definition.
Based on a patch by Mark Jansen.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-10-30 00:10:14 +01:00
Huw Davies a6d89db615 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>
2018-09-20 12:34:57 +02:00
Michael Stefaniuc d33f067460 setupapi: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-17 15:40:32 +02:00
Zebediah Figura 9ccf51e3c1 setupapi: Only delete unregistered device interfaces when deleting a device.
Fixes a regression introduced by 86d26dded5.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-20 09:08:46 +02:00
Zebediah Figura 3fa12ba3a5 setupapi: Implement DIGCF_PRESENT.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-17 16:53:42 +02:00
Zebediah Figura f48e726e51 setupapi: Implement SPINT_LINKED.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-17 16:53:40 +02:00
Zebediah Figura 9b767ad6bb setupapi: Correctly implement SetupDiDeleteDeviceInterfaceRegKey().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-16 13:11:01 +02:00
Zebediah Figura 1d17352ce2 setupapi: Correctly implement SetupDiCreateDeviceInterfaceRegKey().
This family of functions manipulates the "Device Parameters" subkey, not its
parent.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-16 13:10:58 +02:00
Zebediah Figura 86d26dded5 setupapi: Merge the InterfaceInfo and InterfaceInstances structs.
It seems the original motivation for separating these was to facilitate easy
enumeration of specific classes using SetupDiEnumDeviceInterfaces(), but it
makes other things unnecessarily complex [including an eventual
implementation of SetupDiRemoveDeviceInterface()] and the implementation
provided here seems quite simple enough.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-16 13:10:55 +02:00
Zebediah Figura ad9e1883ef setupapi: Add helper functions to get the path of the device instance keys.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-16 13:10:52 +02:00
Zebediah Figura 11d09c299e setupapi: Don't use SP_DEVINFO_DATA in internal structs.
And especially don't use a pointer to one, since there's no guarantee it'll
remain stable.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-16 13:10:49 +02:00
Zebediah Figura 5d7b123d09 setupapi: Merge the DeviceInstance and DeviceInfo structs.
These are two different representations of the same underlying object;
there's no reason to keep them separate.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-16 13:10:46 +02:00
Zebediah Figura b5b09649e6 setupapi: Add an internal helper for SetupDiSetDeviceRegistryProperty().
This essentially follows the model used in MSI. The next patch makes use of
this helper.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-16 13:10:43 +02:00
Zebediah Figura f840bcc6f7 setupapi: Use a handle table to allocate device nodes.
The size of DEVINST is DWORD, so using the pointer directly won't work on
64-bit.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-16 13:10:38 +02:00
Zebediah Figura a3cedc1f3a setupapi: Remove a pointless cast.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-16 13:10:35 +02:00
Gijs Vermeulen 87acb93586 setupapi/tests: Add SetupInstallFromInfSectionA test.
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-15 10:49:07 +02:00
Austin English d45e6814d6 setupapi: Set LastError on success in SetupInstallFromInfSectionW.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45167
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-08-15 10:49:07 +02:00
Michael Stefaniuc 94d8ba78b8 setupapi/tests: Use the available ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-06-15 12:56:48 +02:00
Tim Wanders 074345edd6 setupapi: Return CR_NO_SUCH_DEVNODE from CM_Get_Parent stub.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-02 20:47:11 +02:00
Alex Henrie 02acc6514a setupapi/tests: Drop install test workarounds for Windows <= 2000.
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-02-16 19:19:44 +01:00
Alexandre Julliard 35719665d7 setupapi: Use correct architecture for fake dlls on ARM and ARM64.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-11-01 23:16:07 +01:00
Hugh McMaster c9308b8d6b setupapi: Recursively remove any subkeys before calling NtDeleteKey().
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-09-12 10:24:47 +02:00
Andrew Wesie e4645d60d7 setupapi: Fix SetupDiGetDeviceRegistryProperty if property does not exist.
Signed-off-by: Andrew Wesie <awesie@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-05-02 11:18:36 +02:00