ReactOS 0.4.15-dev-8222-g9164419
pnpio.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PIP_DUMP_FL_ALL_NODES   1
 
#define PIP_DUMP_FL_RES_ALLOCATED   2
 
#define PIP_DUMP_FL_RES_REQUIREMENTS   4
 
#define PIP_DUMP_FL_RES_TRANSLATED   8
 

Functions

VOID NTAPI PipDumpCmResourceList (_In_ PCM_RESOURCE_LIST CmResource, _In_ ULONG DebugLevel)
 
PCM_PARTIAL_RESOURCE_DESCRIPTOR NTAPI PipGetNextCmPartialDescriptor (_In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor)
 
VOID NTAPI PipDumpCmResourceDescriptor (_In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, _In_ ULONG DebugLevel)
 
VOID NTAPI PipDumpResourceRequirementsList (_In_ PIO_RESOURCE_REQUIREMENTS_LIST IoResource, _In_ ULONG DebugLevel)
 
VOID NTAPI PipDumpIoResourceDescriptor (_In_ PIO_RESOURCE_DESCRIPTOR Descriptor, _In_ ULONG DebugLevel)
 
VOID NTAPI PipDumpDeviceNodes (_In_ PDEVICE_NODE DeviceNode, _In_ ULONG Flags, _In_ ULONG DebugLevel)
 

Macro Definition Documentation

◆ PIP_DUMP_FL_ALL_NODES

#define PIP_DUMP_FL_ALL_NODES   1

Definition at line 5 of file pnpio.h.

◆ PIP_DUMP_FL_RES_ALLOCATED

#define PIP_DUMP_FL_RES_ALLOCATED   2

Definition at line 6 of file pnpio.h.

◆ PIP_DUMP_FL_RES_REQUIREMENTS

#define PIP_DUMP_FL_RES_REQUIREMENTS   4

Definition at line 7 of file pnpio.h.

◆ PIP_DUMP_FL_RES_TRANSLATED

#define PIP_DUMP_FL_RES_TRANSLATED   8

Definition at line 8 of file pnpio.h.

Function Documentation

◆ PipDumpCmResourceDescriptor()

VOID NTAPI PipDumpCmResourceDescriptor ( _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR  Descriptor,
_In_ ULONG  DebugLevel 
)

Definition at line 30 of file debug.c.

33{
34 PAGED_CODE();
35
36 if (DebugLevel != 0)
37 {
38#ifdef NDEBUG
39 return;
40#endif
41 }
42
43 if (Descriptor == NULL)
44 {
45 DPRINT1("Dump CmDescriptor: Descriptor == NULL\n");
46 return;
47 }
48
49 switch (Descriptor->Type)
50 {
52 DPRINT1("[%p:%X:%X] IO: Start %X:%X, Len %X\n", Descriptor, Descriptor->ShareDisposition, Descriptor->Flags, Descriptor->u.Port.Start.HighPart, Descriptor->u.Port.Start.LowPart, Descriptor->u.Port.Length);
53 break;
54
56 DPRINT1("[%p:%X:%X] INT: Lev %X Vec %X Aff %IX\n", Descriptor, Descriptor->ShareDisposition, Descriptor->Flags, Descriptor->u.Interrupt.Level, Descriptor->u.Interrupt.Vector, Descriptor->u.Interrupt.Affinity);
57 break;
58
60 DPRINT1("[%p:%X:%X] MEM: %X:%X Len %X\n", Descriptor, Descriptor->ShareDisposition, Descriptor->Flags, Descriptor->u.Memory.Start.HighPart, Descriptor->u.Memory.Start.LowPart, Descriptor->u.Memory.Length);
61 break;
62
64 DPRINT1("[%p:%X:%X] DMA: Channel %X Port %X\n", Descriptor, Descriptor->ShareDisposition, Descriptor->Flags, Descriptor->u.Dma.Channel, Descriptor->u.Dma.Port);
65 break;
66
68 DPRINT1("[%p:%X:%X] DAT: DataSize %X\n", Descriptor, Descriptor->ShareDisposition, Descriptor->Flags, Descriptor->u.DeviceSpecificData.DataSize);
69 break;
70
72 DPRINT1("[%p:%X:%X] BUS: Start %X Len %X Reserv %X\n", Descriptor, Descriptor->ShareDisposition, Descriptor->Flags, Descriptor->u.BusNumber.Start, Descriptor->u.BusNumber.Length, Descriptor->u.BusNumber.Reserved);
73 break;
74
76 DPRINT1("[%p:%X:%X] PVT: D[0] %X D[1] %X D[2] %X\n", Descriptor, Descriptor->ShareDisposition, Descriptor->Flags, Descriptor->u.DevicePrivate.Data[0], Descriptor->u.DevicePrivate.Data[1], Descriptor->u.DevicePrivate.Data[2]);
77 break;
78
79 default:
80 DPRINT1("[%p] Unknown type %X\n", Descriptor, Descriptor->Type);
81 break;
82 }
83}
#define PAGED_CODE()
#define DPRINT1
Definition: precomp.h:8
#define NULL
Definition: types.h:112
ULONG DebugLevel
Definition: fbtusb.c:26
#define CmResourceTypeMemory
Definition: hwresource.cpp:125
#define CmResourceTypeDma
Definition: hwresource.cpp:126
#define CmResourceTypeDevicePrivate
Definition: hwresource.cpp:131
#define CmResourceTypeDeviceSpecific
Definition: hwresource.cpp:127
#define CmResourceTypePort
Definition: hwresource.cpp:123
#define CmResourceTypeBusNumber
Definition: hwresource.cpp:128
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342

Referenced by PipDumpCmResourceList().

◆ PipDumpCmResourceList()

VOID NTAPI PipDumpCmResourceList ( _In_ PCM_RESOURCE_LIST  CmResource,
_In_ ULONG  DebugLevel 
)

Definition at line 116 of file debug.c.

119{
122 ULONG ix;
123 ULONG jx;
124
125 PAGED_CODE();
126
127 if (DebugLevel != 0)
128 {
129#ifdef NDEBUG
130 return;
131#endif
132 }
133
134 DPRINT1("Dump CmList: CmResource %p\n", CmResource);
135
136 if (CmResource == NULL)
137 {
138 DPRINT1("PipDumpCmResourceList: CmResource == NULL\n");
139 return;
140 }
141
142 if (CmResource->Count == 0)
143 {
144 DPRINT1("PipDumpCmResourceList: CmResource->Count == 0\n");
145 return;
146 }
147
148 DPRINT1("FullList Count %x\n", CmResource->Count);
149
150 FullList = &CmResource->List[0];
151
152 for (ix = 0; ix < CmResource->Count; ix++)
153 {
154 DPRINT1("List #%X Iface %X Bus #%X Ver.%X Rev.%X Count %X\n",
155 ix,
156 FullList->InterfaceType,
157 FullList->BusNumber,
160 FullList->PartialResourceList.Count);
161
163
164 for (jx = 0; jx < FullList->PartialResourceList.Count; jx++)
165 {
168 }
169
171 }
172}
struct _CM_FULL_RESOURCE_DESCRIPTOR * PCM_FULL_RESOURCE_DESCRIPTOR
PCM_PARTIAL_RESOURCE_DESCRIPTOR NTAPI PipGetNextCmPartialDescriptor(_In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor)
Definition: debug.c:89
VOID NTAPI PipDumpCmResourceDescriptor(_In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, _In_ ULONG DebugLevel)
Definition: debug.c:30
CM_PARTIAL_RESOURCE_LIST PartialResourceList
Definition: hwresource.cpp:160
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
uint32_t ULONG
Definition: typedefs.h:59

Referenced by PipDumpDeviceNode().

◆ PipDumpDeviceNodes()

VOID NTAPI PipDumpDeviceNodes ( _In_ PDEVICE_NODE  DeviceNode,
_In_ ULONG  Flags,
_In_ ULONG  DebugLevel 
)

Definition at line 513 of file debug.c.

517{
518 if (DebugLevel != 0)
519 {
520#ifdef NDEBUG
521 return;
522#endif
523 }
524
525 DPRINT1("PipDumpDeviceNodes: DeviceNode %X, Flags %X Level %X\n", DeviceNode, Flags, DebugLevel);
526
527 if (DeviceNode == NULL)
528 {
530 }
531
533}
@ DeviceNode
Definition: Node.h:9
PDEVICE_NODE IopRootDeviceNode
Definition: devnode.c:18
VOID NTAPI PipDumpDeviceNode(_In_ PDEVICE_NODE DeviceNode, _In_ ULONG NodeLevel, _In_ ULONG Flags, _In_ ULONG DebugLevel)
Definition: debug.c:414
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

◆ PipDumpIoResourceDescriptor()

VOID NTAPI PipDumpIoResourceDescriptor ( _In_ PIO_RESOURCE_DESCRIPTOR  Descriptor,
_In_ ULONG  DebugLevel 
)

Definition at line 183 of file debug.c.

186{
187 PAGED_CODE();
188
189 if (DebugLevel != 0)
190 {
191#ifdef NDEBUG
192 return;
193#endif
194 }
195
196 if (Descriptor == NULL)
197 {
198 DPRINT1("DumpResourceDescriptor: Descriptor == 0\n");
199 return;
200 }
201
202 switch (Descriptor->Type)
203 {
205 DPRINT1("[%p:%X:%X] O: Len %X Align %X Min %I64X, Max %I64X\n", Descriptor, Descriptor->Option, Descriptor->ShareDisposition, Descriptor->u.Generic.Length, Descriptor->u.Generic.Alignment, Descriptor->u.Generic.MinimumAddress.QuadPart, Descriptor->u.Generic.MaximumAddress.QuadPart);
206 break;
207
209 DPRINT1("[%p:%X:%X] IO: Min %X:%X, Max %X:%X, Align %X Len %X\n", Descriptor, Descriptor->Option, Descriptor->ShareDisposition, Descriptor->u.Port.MinimumAddress.HighPart, Descriptor->u.Port.MinimumAddress.LowPart, Descriptor->u.Port.MaximumAddress.HighPart, Descriptor->u.Port.MaximumAddress.LowPart, Descriptor->u.Port.Alignment, Descriptor->u.Port.Length);
210 break;
211
213 DPRINT1("[%p:%X:%X] INT: Min %X Max %X\n", Descriptor, Descriptor->Option, Descriptor->ShareDisposition, Descriptor->u.Interrupt.MinimumVector, Descriptor->u.Interrupt.MaximumVector);
214 break;
215
217 DPRINT1("[%p:%X:%X] MEM: Min %X:%X, Max %X:%X, Align %X Len %X\n", Descriptor, Descriptor->Option, Descriptor->ShareDisposition, Descriptor->u.Memory.MinimumAddress.HighPart, Descriptor->u.Memory.MinimumAddress.LowPart, Descriptor->u.Memory.MaximumAddress.HighPart, Descriptor->u.Memory.MaximumAddress.LowPart, Descriptor->u.Memory.Alignment, Descriptor->u.Memory.Length);
218 break;
219
221 DPRINT1("[%p:%X:%X] DMA: Min %X Max %X\n", Descriptor, Descriptor->Option, Descriptor->ShareDisposition, Descriptor->u.Dma.MinimumChannel, Descriptor->u.Dma.MaximumChannel);
222 break;
223
225 DPRINT1("[%p:%X:%X] BUS: Min %X Max %X Len %X\n", Descriptor, Descriptor->Option, Descriptor->ShareDisposition, Descriptor->u.BusNumber.MinBusNumber, Descriptor->u.BusNumber.MaxBusNumber, Descriptor->u.BusNumber.Length);
226 break;
227
229 DPRINT1("[%p:%X:%X] CFG: Priority %X\n", Descriptor, Descriptor->Option, Descriptor->ShareDisposition, Descriptor->u.ConfigData.Priority);
230 break;
231
233 DPRINT1("[%p:%X:%X] DAT: %X %X %X\n", Descriptor, Descriptor->Option, Descriptor->ShareDisposition, Descriptor->u.DevicePrivate.Data[0], Descriptor->u.DevicePrivate.Data[1], Descriptor->u.DevicePrivate.Data[2]);
234 break;
235
236 default:
237 DPRINT1("[%p:%X:%X]. Unknown type %X\n", Descriptor, Descriptor->Option, Descriptor->ShareDisposition, Descriptor->Type);
238 break;
239 }
240}
#define CmResourceTypeNull
Definition: hwresource.cpp:122
#define CmResourceTypeConfigData
Definition: hwresource.cpp:130

Referenced by PipDumpResourceRequirementsList().

◆ PipDumpResourceRequirementsList()

VOID NTAPI PipDumpResourceRequirementsList ( _In_ PIO_RESOURCE_REQUIREMENTS_LIST  IoResource,
_In_ ULONG  DebugLevel 
)

Definition at line 249 of file debug.c.

252{
253 PIO_RESOURCE_LIST AltList;
255 ULONG ix;
256 ULONG jx;
257
258 PAGED_CODE();
259
260 if (DebugLevel != 0)
261 {
262#ifdef NDEBUG
263 return;
264#endif
265 }
266
267 if (IoResource == NULL)
268 {
269 DPRINT1("PipDumpResourceRequirementsList: IoResource == 0\n");
270 return;
271 }
272
273 DPRINT1("Dump RequirementsList: IoResource %p\n", IoResource);
274 DPRINT1("Interface %X Bus %X Slot %X AlternativeLists %X\n",
275 IoResource->InterfaceType,
276 IoResource->BusNumber,
277 IoResource->SlotNumber,
278 IoResource->AlternativeLists);
279
280 AltList = &IoResource->List[0];
281
282 if (IoResource->AlternativeLists < 1)
283 {
284 DPRINT1("PipDumpResourceRequirementsList: AlternativeLists < 1\n");
285 return;
286 }
287
288 for (ix = 0; ix < IoResource->AlternativeLists; ix++)
289 {
290 DPRINT1("AltList %p, AltList->Count %X\n", AltList, AltList->Count);
291
292 for (jx = 0; jx < AltList->Count; jx++)
293 {
294 Descriptor = &AltList->Descriptors[jx];
296 }
297
298 AltList = (PIO_RESOURCE_LIST)(AltList->Descriptors + AltList->Count);
299 DPRINT1("End Descriptors %p\n", AltList);
300 }
301}
struct _IO_RESOURCE_LIST * PIO_RESOURCE_LIST
VOID NTAPI PipDumpIoResourceDescriptor(_In_ PIO_RESOURCE_DESCRIPTOR Descriptor, _In_ ULONG DebugLevel)
Definition: debug.c:183
ULONG Count
Definition: edit.c:124
IO_RESOURCE_DESCRIPTOR Descriptors[1]
Definition: edit.c:125

Referenced by PipDumpDeviceNode().

◆ PipGetNextCmPartialDescriptor()

PCM_PARTIAL_RESOURCE_DESCRIPTOR NTAPI PipGetNextCmPartialDescriptor ( _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR  CmDescriptor)

Definition at line 89 of file debug.c.

91{
93
94 /* Assume the descriptors are the fixed size ones */
95 NextDescriptor = CmDescriptor + 1;
96
97 /* But check if this is actually a variable-sized descriptor */
98 if (CmDescriptor->Type == CmResourceTypeDeviceSpecific)
99 {
100 /* Add the size of the variable section as well */
101 NextDescriptor = (PVOID)((ULONG_PTR)NextDescriptor +
102 CmDescriptor->u.DeviceSpecificData.DataSize);
103 }
104
105 /* Now the correct pointer has been computed, return it */
106 return NextDescriptor;
107}
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@398::@407 DeviceSpecificData
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@398 u
void * PVOID
Definition: typedefs.h:50
uint32_t ULONG_PTR
Definition: typedefs.h:65

Referenced by PipDumpCmResourceList().