reactos/ntoskrnl/io/iomgr
Hermès Bélusca-Maïto 84b4a80beb
[NTOS:IO] Fix some bugs in the IoQueryDeviceDescription helpers (#5320)
- Add missing ExAllocatePool NULL checks.

- Fix order of KeBugCheckEx parameters for PNP_DETECTED_FATAL_ERROR.

- The Controller and Peripheral numbers are zero-based, so if the caller
  wants to inspect controller (or peripheral) zero, let it be so!
  The original code was treating controller number zero for enumerating
  controllers of a given class within the different buses, which is
  wrong. See the diff'ed trace below.
  Tested with Windows' videoprt.sys VideoPortGetDeviceData().

```diff
 IoQueryDeviceDescription()
     BusType:          0xB093C224 (0)
     BusNumber:        0xB093C228 (0)
     ControllerType:   0xF9D01030 (19)
     ControllerNumber: 0xF9D01038 (0)
     PeripheralType:   0x00000000 (4294967295)
     PeripheralNumber: 0x00000000 (4294967295)
     CalloutRoutine:   0xF9CF74E4
     Context:          0xF9D5A340
 --> Query: 0xF9D5A22C

 IopQueryBusDescription(Query: 0xF9D5A22C)
     RootKey: '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM'
     RootKeyHandle: 0x00000598
     KeyIsRoot: TRUE
     Bus: 0xF9D5A290 (4294967295)
     Seen: 'CentralProcessor'
     Seen: 'FloatingPointProcessor'
     Seen: 'MultifunctionAdapter'
     SubRootRegName: '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM\MultifunctionAdapter'

 IopQueryBusDescription(Query: 0xF9D5A22C)
     RootKey: '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM\MultifunctionAdapter'
     RootKeyHandle: 0x00000590
     KeyIsRoot: FALSE
     Bus: 0xF9D5A290 (4294967295)
     Seen: '0'
     SubRootRegName: '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM\MultifunctionAdapter\0'
     Getting bus value: 'Identifier'
     Getting bus value: 'Configuration Data'
     Getting bus value: 'Component Information'
     --> Getting device on Bus #0 : '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM\MultifunctionAdapter\0'

 IopQueryDeviceDescription(Query: 0xF9D5A22C)
     RootKey: '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM\MultifunctionAdapter\0'
     RootKeyHandle: 0x00000590
     Bus: 0
-    Enumerating controllers in '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM\MultifunctionAdapter\0\DisplayController'...
+    Getting controller #0
+    Retrieving controller '\REGISTRY\MACHINE\HARDWARE\DESCRIPTION\SYSTEM\MultifunctionAdapter\0\DisplayController\0'
```
2023-06-14 11:20:56 +02:00
..
adapter.c
arcname.c [NTOS:IO] Check RtlAnsiStringToUnicodeString return value when initializing Arc names 2021-06-28 10:20:57 +02:00
bootlog.c [REACTOS] Cleanup INIT and some PAGE section allocations 2020-11-02 21:45:31 +03:00
controller.c [NTOSKRNL] Fix indentation. No code changes. 2018-12-16 10:30:23 +01:00
device.c [NTOS:IO] Fix indentation. No code changes! 2020-03-21 14:32:18 +01:00
deviface.c [NTOS:IO] IoRegisterDeviceInterface: create non-volatile keys for new device interfaces 2022-03-28 08:13:05 +02:00
driver.c Grmbl... 2023-04-05 01:53:32 +02:00
error.c [NTOS:IO] Be more specific for chasing CORE-17587 2021-05-26 11:03:34 +02:00
file.c [NTOS:IO] Properly zero-initialize a file object created by IopParseDevice (#4931) 2022-12-08 01:15:42 +03:00
iocomp.c [NTOSKRNL] Force a probe against ReturnLength on query & Misc ICIF stuff 2022-06-12 11:05:05 +02:00
ioevent.c
iofunc.c [NTOS:IO] Fail, if io completion port and an apc routine are used at the same time 2021-11-24 13:34:26 +01:00
iomdl.c [NTOSKRNL] Fix indentation. No code changes. 2018-12-19 19:18:20 +01:00
iomgr.c [NTOS:KD][KDBG] Rework the BootPhase >= 2 initialization of the KD/KDBG kernel debugger. (#4892) 2023-03-11 01:22:19 +01:00
iorsrce.c [NTOS:IO] Fix some bugs in the IoQueryDeviceDescription helpers (#5320) 2023-06-14 11:20:56 +02:00
iotimer.c [NTOS:IO/KD/KDBG] Formatting fixes only. 2023-03-09 18:26:02 +01:00
iowork.c
irp.c [NTOS:IO] Fix IRP stack location check in IoForwardIrpSynchronously 2020-09-07 04:57:17 +03:00
irq.c
ramdisk.c [NTOS:IO] Check RtlAnsiStringToUnicodeString return value when initializing ramdisk 2021-06-28 10:20:57 +02:00
rawfs.c [NTOS:RAWFS] LE JOKE! - Commit 7716bddd (r24564) claimed to "actually create the \\Device names so that user-mode can even talk to it", yet didn't bother to do that! 2021-09-26 03:02:58 +02:00
remlock.c
symlink.c
util.c Fix build (forgot a comma ;) 2019-06-11 22:36:10 +02:00
volume.c [REACTOS] Cleanup INIT and some PAGE section allocations 2020-11-02 21:45:31 +03:00