Commit Graph

167 Commits

Author SHA1 Message Date
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
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
Nikolay Sivov 01080e6750 setupapi: Use sizeof() instead of numerical constants for buffer sizes.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-02-08 16:00:49 +01:00
Hans Leidekker cdb72f3997 setupapi: Add a stub implementation of SetupDiRemoveDeviceInterface.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-12-07 11:57:44 +01:00
Alistair Leslie-Hughes b32a0eaab9 setupapi: Add SetupDiGetDevicePropertyW stub.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-11-08 19:27:02 +01:00
Andrey Gusev bf9d01edd6 setupapi: Fix a typo in comment.
Signed-off-by: Andrey Gusev <andrey.goosev@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-05-02 12:26:08 +09:00
Austin English f820c09428 setupapi: Add SetupDiSetDeviceInstallParamsW stub.
Signed-off-by: Austin English <austinenglish@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-31 22:10:54 +09:00
Dmitry Timoshkov ab92627e19 setupapi: SetupDiCreateDeviceInfoListEx returns INVALID_HANDLE_VALUE on error. 2015-07-29 21:44:04 +02:00
Dmitry Timoshkov afa912b4f2 setupapi: SetupDiGetClassDevsEx returns INVALID_HANDLE_VALUE on error. 2015-07-29 21:44:04 +02:00
Dmitry Timoshkov 14650b939c setupapi: Avoid shadowing devInst variable. 2015-07-29 21:44:04 +02:00
Aric Stewart a3487ad316 setupapi: Restore close brace before using guid string as reg key. 2015-05-04 15:06:14 +09:00
Austin English 3013b6c6da setupapi: Add a stub for SetupDiSetClassInstallParamsW. 2014-07-14 19:26:16 +02:00
Austin English 8d854a4830 setupapi: Make sure DeviceInterfaceData->cbSize is initialized in SetupDiEnumDeviceInterfaces. 2014-03-17 17:34:12 +01:00
Frédéric Delanoy 9c76ccfda1 setupapi: Use BOOL type where appropriate. 2014-02-13 17:52:14 +01:00
Stefan Leichter 6aace3014d setupapi: Support signature $Windows NT$ in SetupDiGetINFClassA/W too. 2013-12-18 11:33:26 +01:00
Michael Stefaniuc 09524be583 setupapi: Avoid using CONST. 2013-09-23 11:54:55 +02:00
Stefan Leichter a829c2b3ad setupapi: Add a stub for SetupDiSetDeviceInstallParamsA. 2013-04-19 10:39:36 +02:00
André Hentschel 7b32809890 setupapi: Add a stub for SetupDiGetDeviceInstallParamsW. 2012-07-11 10:17:03 -05:00
Frédéric Delanoy 7e309601f3 dlls: Assorted spelling fixes. 2011-08-03 14:15:50 +02:00
Christian Inci 309914f315 setupapi: Fix return behaviour when the device key doesn't exist. 2011-07-09 11:48:06 +02:00
Juan Lang 4fe8cc6164 setupapi: Make sure machine name is non-empty before failing. 2011-06-10 10:44:12 +02:00
Juan Lang 53b2875309 setupapi: Always initialize output parameter to avoid crash in buggy applications. 2011-05-16 16:35:28 +02:00
Andrew Nguyen c66d27c555 setupapi: Fix some memory leaks in SetupDiGetINFClassA.
Spotted with Valgrind.
2011-01-17 15:58:34 +01:00
Stefan Leichter 05a1416c93 setupapi: Implement SetupDiGetINFClassA on top of SetupDiGetINFClassW. 2010-10-05 13:04:26 +02:00
Stefan Leichter 803b81c1b7 setupapi: Add partial implementation of SetupDiGetINFClassW. 2010-10-05 13:03:44 +02:00
Damjan Jovanovic bf18e7e71f setupapi: Stub out SetupDiRemoveDevice. 2010-03-15 15:08:43 +01:00
Juan Lang eba0657bf7 setupapi: Fix a comment typo. 2009-12-18 11:40:17 +01:00
Alexandre Julliard aaf908ab32 setupapi: Fix a structure size check for 64-bit. 2009-08-27 20:23:40 +02:00
Alexandre Julliard 72fdb74326 setupapi: Don't use 'interface' as variable name, since it can be defined to a keyword. 2009-02-09 13:04:55 +01:00
Michael Stefaniuc ffae0123ac setupapi: Remove superfluous pointer casts. 2009-01-28 12:30:57 +01:00
Michael Stefaniuc 02d1154bab setupapi: Remove some superfluous casts. 2008-12-08 12:04:25 +01:00
Andrew Talbot 1c64c934db setupapi: Sign-compare warnings fix. 2008-11-11 11:40:42 +01:00
Andrew Talbot 581a0e091c setupapi: Constify a variable. 2008-06-20 12:22:48 +02:00
Austin English aab8fae59a Spelling fixes. 2008-04-21 14:25:05 +02:00
Alexander Morozov af5e168f16 setupapi: SetupDiGetDeviceRegistryProperty should return ERROR_INVALID_DATA when buffer size is not 0 but buffer is NULL. 2008-04-17 20:21:48 +02:00
Alexander Morozov 85861a4999 setupapi: SetupDiGetDeviceRegistryProperty should return ERROR_INSUFFICIENT_BUFFER when buffer size is insufficient. 2008-04-17 20:21:38 +02:00
Alexander Morozov 62520da8d3 setupapi: Prevent of reallocating memory for _SP_DEVINFO_DATA structures. 2008-04-04 11:58:36 +02:00
Alexander Morozov 997bea9b89 setupapi: Create DeviceInstance value in registry, delete todo_wine from test. 2008-04-02 13:44:08 +02:00