Commit Graph

41 Commits

Author SHA1 Message Date
Rémi Bernon b065daa600 ntoskrnl.exe: Send IRP_MN_SURPRISE_REMOVAL to the device stack first.
Instead of sending both IRP_MN_SURPRISE_REMOVAL and IRP_MN_REMOVE_DEVICE
to all children first.

They may have pending IRPs sent to their parent PDO driver, which need
to be cancelled before IRP_MN_REMOVE_DEVICE can complete. This is the
case for hidclass.sys and its thread calling the lower driver for
instance.

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-07-06 17:48:34 +02:00
Arkadiusz Hiler 50210ea244 ntoskrnl: Implement IoSetDevicePropertyData().
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Arkadiusz Hiler <arek@hiler.eu>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-05-03 23:19:54 +02:00
Zebediah Figura 5bf72a75e3 ntoskrnl: Remove the device from the root device list in IRP_MN_REMOVE_DEVICE.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-14 20:51:09 +02:00
Zebediah Figura 94037f90a0 ntoskrnl: Do not send power IRPs on device start and removal.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-12 19:32:15 +02:00
Zebediah Figura 48b2e67d09 ntoskrnl: Start the device even without a function driver if it reports RawDeviceOK.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-12 19:32:15 +02:00
Zebediah Figura 73bfe36eab winedevice: Introduce a custom service control to reënumerate root PnP devices.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 21:15:25 +02:00
Zebediah Figura 6977b81807 ntoskrnl: Store root PnP devices per driver.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 21:14:27 +02:00
Zebediah Figura 414003e2d9 ntoskrnl: Store root PnP devices in a linked list.
It is quite rare to have more than one or two of these, and lists are slightly
easier to work with.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-04-02 21:13:54 +02:00
Arkadiusz Hiler f69c8f0181 ntoskrnl.exe: Use correct name format when sending WM_DEVICECHANGE.
This fixes controller hotplug with FarCry Primal.

Signed-off-by: Arkadiusz Hiler <ahiler@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-03-23 22:16:12 +01:00
Zebediah Figura f8c9027d98 ntoskrnl: Pass a KEVENT to IoBuildSynchronousFsdRequest() for PnP IRPs.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 22:26:36 +01:00
Zebediah Figura 71f71edd8d ntoskrnl: Retrieve information from the user I/O status block for PnP IRPs.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-11 22:26:36 +01:00
Zebediah Figura cb79644199 ntoskrnl: Do not destroy the device list in enumerate_new_device().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-02-02 10:00:56 +01:00
Jefferson Carpenter ab6f8ba0d1 ntoskrnl.exe: Set reserved to 0 in pnp WM_DEVICECHANGE broadcast.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49488
Signed-off-by: Jefferson Carpenter <jeffersoncarpenter2@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-06-30 17:51:49 +02:00
Zebediah Figura 7addca95b5 ntoskrnl.exe: Move the BroadcastSystemMessage() call to plugplay_send_event().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-06 10:49:18 +02:00
Zebediah Figura d80101f17a ntoskrnl.exe: Broadcast device notifications to registered handlers.
Based on a patch by Micah N Gorrell.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-05-06 10:48:06 +02:00
Andrew Eikum 7ac5b7889f ntoskrnl: Quiet down failed class installer 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
Zebediah Figura bd00dedecd ntoskrnl.exe: Implement IoOpenDeviceRegistryKey().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-03-16 21:36:23 +01:00
Piotr Caban 292b728908 ntoskrnl.exe: Store device state in volatile key.
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-12 23:04:35 +01:00
Zebediah Figura 81cda52d15 ntoskrnl.exe: BusRelations is also used when devices are removed.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 14:12:53 +01:00
Zebediah Figura ca683dcaad ntoskrnl.exe: IoInvalidateDeviceRelations() receives the parent PDO.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-07 14:12:51 +01:00
Zebediah Figura 781fc47f36 ntoskrnl.exe: Trace the call to AddDevice().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-06 09:32:57 +01:00
Zebediah Figura 74b98dc82b ntoskrnl.exe: Implement IRP_MN_QUERY_DEVICE_RELATIONS for root-enumerated devices.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-06 09:32:54 +01:00
Zebediah Figura 481b099345 ntoskrnl.exe: Stub IRP_MN_QUERY_CAPABILITIES for root-enumerated devices.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-06 09:32:50 +01:00
Zebediah Figura c4ec69adce ntoskrnl.exe: Implement many more properties in IoGetDeviceProperty().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-06 09:32:46 +01:00
Rémi Bernon 8db70e92a8 ntoskrnl.exe: Update the interface if it is already in the tree.
As we are going to reuse the same device id when re-plugging a
previously plugged SDL controller, the device interfaces are still
present in the tree and IoRegisterDeviceInterface was not updating the
device pointer.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-20 12:50:05 +02:00
Sven Baars aa10b49c57 ntoskrnl.exe: Don't use irp after it has been freed by IoCompleteRequest (Coverity).
Signed-off-by: Sven Baars <sven.wine@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-08-19 11:29:28 +02:00
Zebediah Figura 2698249362 ntoskrnl.exe: Use the registered interface class in IoSetDeviceInterfaceState().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-03 23:44:24 +02:00
Zebediah Figura 4ecbc3a0f5 ntoskrnl.exe: Implement PoCallDriver().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-26 09:34:41 +02:00
Zebediah Figura 656035da85 ntoskrnl.exe: Stub PoStartNextPowerIrp().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-26 09:34:37 +02:00
Zebediah Figura 816e25c194 ntoskrnl.exe: Handle IRP_MN_QUERY_ID for root PnP devices.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-26 09:34:33 +02:00
Zebediah Figura 13e9d43127 ntoskrnl.exe: Handle some no-op PnP requests.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-26 09:34:31 +02:00
Zebediah Figura b06740ecde ntoskrnl.exe: Load a driver's root PnP devices when the driver is started.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-25 19:25:40 +02:00
Zebediah Figura d4c91cc6f9 ntoskrnl.exe: Add a stub PnP manager driver.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-25 19:25:01 +02:00
Alexandre Julliard a1cdcc5290 ntoskrnl: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-17 09:28:35 +02:00
Zebediah Figura 4ca91cfd5d ntoskrnl.exe: Use INF files to locate function drivers.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-10 19:42:38 +02:00
Zebediah Figura 9392aaa17f ntoskrnl.exe: Send PnP IRPs to the top of the device stack.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-06 17:41:42 +02:00
Zebediah Figura 6c6aeea8a8 ntoskrnl.exe: Correctly handle instance IDs.
The instance ID is only the third part of the "A\B\C" form, and must be
combined with the device ID to form the whole name for setupapi (the "device
instance ID").

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 16:46:20 +02:00
Zebediah Figura 510261a4b4 ntoskrnl.exe: Use SetupDiOpenDeviceInfo().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 16:44:54 +02:00
Zebediah Figura 533a426d14 ntoskrnl.exe: Free device IDs from pool.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-05 16:44:47 +02:00
Zebediah Figura 6e999b4a46 ntoskrnl.exe: Fix handling of reference string in IoRegisterDeviceInterface().
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-04 23:05:29 +02:00
Zebediah Figura 3b2592a2bc ntoskrnl.exe: Move PNP code to a separate file.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-03 22:33:30 +02:00