[NTOS:PNP] Implement NT5.2-like DEVICE_NODE state management
authorVictor Perevertkin <victor.perevertkin@reactos.org>
Thu, 10 Dec 2020 00:19:31 +0000 (03:19 +0300)
committerVictor Perevertkin <victor.perevertkin@reactos.org>
Wed, 27 Jan 2021 02:15:15 +0000 (05:15 +0300)
commit798fc13b482b56a785b910f7febb396d608e14b0
treef31a5322dddc8baa8a75469729d96de78ee8eccf
parentb7042928089b360663f310a6a7aa0a2c0eb0326d
[NTOS:PNP] Implement NT5.2-like DEVICE_NODE state management

- Use DeviceNode->State field and its values, instead of
  DeviceNode->Flags for tracking current node state
- Change DNF_* flags to the ones compatible with Windows XP+
- Simplify state changes for device nodes and encapsulate all the logic
  inside the PiDevNodeStateMachine routine. This makes the ground for
  future improvements in the device removal sequence and
  resource management
- Now values inside DeviceNode->State and ->Flags are compatible with
  the windbg !devnode macro and can be tracked using it
- BUGFIX: fixed cases where IRP_MN_START_DEVICE or
  IRP_MN_QUERY_DEVICE_RELATIONS may be sent to a device after a
  IRP_MN_REMOVE_DEVICE

CORE-7826
12 files changed:
ntoskrnl/include/internal/io.h
ntoskrnl/io/iomgr/iomgr.c
ntoskrnl/io/pnpmgr/devaction.c
ntoskrnl/io/pnpmgr/devnode.c
ntoskrnl/io/pnpmgr/plugplay.c
ntoskrnl/io/pnpmgr/pnpinit.c
ntoskrnl/io/pnpmgr/pnpirp.c [new file with mode: 0644]
ntoskrnl/io/pnpmgr/pnpmgr.c
ntoskrnl/io/pnpmgr/pnpreport.c
ntoskrnl/io/pnpmgr/pnpres.c
ntoskrnl/ntos.cmake
sdk/include/ndk/iotypes.h