reactos/ntoskrnl
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
..
cache
cc [NTOS/CC] Fix broken usage of _SEH2_FINALLY 2023-04-14 11:56:08 +03:00
config [NTOS:CM] Initialize the alternative system architecture field on PC-98 builds (#5136) 2023-05-05 18:04:35 +02:00
dbgk
ex Fix typo "managment" -> "management" in our codebase... 2023-06-04 21:39:56 +02:00
fsrtl
fstub
inbv
include [NTOS:IO] Reformat iorsrce.c, no functional code changes. 2023-06-04 21:40:07 +02:00
io [NTOS:IO] Fix some bugs in the IoQueryDeviceDescription helpers (#5320) 2023-06-14 11:20:56 +02:00
kd [NTOS:KDBG] Introduce local versions of KdpPrintString, KdpDprintf and KdpPromptString... 2023-04-12 19:30:54 +02:00
kd64 [NTOS] Include kdbg/kdb.h only in the files that really need it. 2023-04-11 00:44:10 +02:00
kdbg [NTOS:KDBG] Only load symbols on x86 2023-05-04 14:09:14 +03:00
ke Fix typo "managment" -> "management" in our codebase... 2023-06-04 21:39:56 +02:00
lpc [NTOS:LPC] Ensure debug-traced pointer-given user-mode data is captured. (#4399) 2023-05-17 17:40:37 +02:00
mm Fix typo "managment" -> "management" in our codebase... 2023-06-04 21:39:56 +02:00
ntkrnlmp
ob [NTOS:OB] Fix the SAL2 annotation of ObQueryTypeInfo 2023-04-22 17:18:57 +02:00
po
ps [NTOS:PS] Do not reference the copied token twice and properly assign the impersonation level in case the server can't impersonate 2023-06-09 11:53:55 +02:00
rtl
se [NTOS:SE] Refactor SeTokenCanImpersonate 2023-06-09 11:53:56 +02:00
tests
vdm
vf
wmi
CMakeLists.txt
guid.c
KrnlFun.c
ntdll.S
ntos.cmake [NTOS:PNP] Move Firmware Mapper functions into new file 2023-05-08 16:07:01 +02:00
ntoskrnl.rc
ntoskrnl.spec
sysfuncs.lst