ReactOS  0.4.15-dev-1033-gd7d716a
Bus_PDO_QueryResourceRequirements.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS API Tests
3  * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4  * PURPOSE: Unit Tests for acpi!Bus_PDO_QueryResourceRequirements
5  * COPYRIGHT: Copyright 2017-2020 Thomas Faber (thomas.faber@reactos.org)
6  */
7 
8 #include <apitest.h>
9 
10 #define WIN32_NO_STATUS
11 #include <ndk/rtlfuncs.h>
12 #define UNIT_TEST
13 #include <acpi.h>
14 
15 /* Kernel definitions (copied) */
16 #define IO_RESOURCE_PREFERRED 0x01
17 #define IO_RESOURCE_DEFAULT 0x02
18 #define IO_RESOURCE_ALTERNATIVE 0x08
19 
20 typedef struct _IO_RESOURCE_DESCRIPTOR {
27  union {
28  struct {
33  } Port;
34  struct {
35  ULONG Length;
39  } Memory;
40  struct {
43  } Interrupt;
44  struct {
47  } Dma;
48  struct {
49  ULONG Length;
53  } Generic;
54  struct {
55  ULONG Data[3];
56  } DevicePrivate;
57  struct {
58  ULONG Length;
62  } BusNumber;
63  struct {
67  } ConfigData;
68  } u;
70 
71 typedef struct _IO_RESOURCE_LIST {
77 
87 
88 /* Kernel definitions (mock) */
89 #define PAGED_CODE()
90 #define DPRINT1(...) do { if (0) DbgPrint(__VA_ARGS__); } while (0)
91 
92 typedef struct _IRP
93 {
95 } IRP, *PIRP;
96 
97 #define PagedPool 1
98 static
99 PVOID
101 {
102  PVOID *Mem;
103 
104  Mem = HeapAlloc(GetProcessHeap(), 0, NumberOfBytes + 2 * sizeof(PVOID));
105  Mem[0] = (PVOID)NumberOfBytes;
106  Mem[1] = (PVOID)(ULONG_PTR)Tag;
107  return Mem + 2;
108 }
109 
110 static
111 VOID
113 {
114  PVOID *Mem = MemPtr;
115 
116  Mem -= 2;
117  ok(Mem[1] == (PVOID)(ULONG_PTR)Tag, "Tag is %lx, expected %p\n", Tag, Mem[1]);
118  HeapFree(GetProcessHeap(), 0, Mem);
119 }
120 
121 static
122 SIZE_T
124 {
125  PVOID *Mem = MemPtr;
126 
127  Mem -= 2;
128  return (SIZE_T)Mem[0];
129 }
130 
131 /* ACPI driver definitions */
132 typedef struct _PDO_DEVICE_DATA
133 {
137 
138 /* ACPICA functions (mock) */
143 
147  ACPI_BUFFER *RetBuffer)
148 {
149  ok(AcpiCallExpected, "Unexpected call to AcpiGetCurrentResources\n");
150  ok(Device == CorrectHandle, "Device = %p, expected %p\n", Device, CorrectHandle);
151  if (RetBuffer->Length < CurrentBuffer.Length)
152  {
153  RetBuffer->Length = CurrentBuffer.Length;
154  return AE_BUFFER_OVERFLOW;
155  }
156  RetBuffer->Length = CurrentBuffer.Length;
158  return AE_OK;
159 }
160 
164  ACPI_BUFFER *RetBuffer)
165 {
166  ok(AcpiCallExpected, "Unexpected call to AcpiGetPossibleResources\n");
167  ok(Device == CorrectHandle, "Device = %p, expected %p\n", Device, CorrectHandle);
168  if (RetBuffer->Length < PossibleBuffer.Length)
169  {
170  RetBuffer->Length = PossibleBuffer.Length;
171  return AE_BUFFER_OVERFLOW;
172  }
173  RetBuffer->Length = PossibleBuffer.Length;
175  return AE_OK;
176 }
177 
178 #include "../../../../drivers/bus/acpi/buspdo.c"
179 
180 /* ACPI_RESOURCE builder helpers */
181 #define MAKE_IRQ(Resource, _DescriptorLength, _Triggering, _Polarity, _Shareable, _WakeCapable) \
182  do { \
183  Resource->Data.Irq.DescriptorLength = _DescriptorLength; \
184  Resource->Data.Irq.Triggering = _Triggering; \
185  Resource->Data.Irq.Polarity = _Polarity; \
186  Resource->Data.Irq.Shareable = _Shareable; \
187  Resource->Data.Irq.WakeCapable = _WakeCapable; \
188  } while (0)
189 
190 /* IO_RESOURCE_DESCRIPTOR expectations */
191 #define expect_irq(Desc, ExpectedOption, ExpectedShare, ExpectedMin, ExpectedMax) \
192  do { \
193  ok((Desc)->Option == ExpectedOption, "Desc->Option = %u\n", (Desc)->Option); \
194  ok((Desc)->Type == CmResourceTypeInterrupt, "Desc->Type = %u\n", (Desc)->Type); \
195  ok((Desc)->ShareDisposition == ExpectedShare, "Desc->ShareDisposition = %u\n", (Desc)->ShareDisposition); \
196  ok((Desc)->u.Interrupt.MinimumVector == ExpectedMin, "Desc->u.Interrupt.MinimumVector = %lu\n", (Desc)->u.Interrupt.MinimumVector); \
197  ok((Desc)->u.Interrupt.MaximumVector == ExpectedMax, "Desc->u.Interrupt.MaximumVector = %lu\n", (Desc)->u.Interrupt.MaximumVector); \
198  } while (0)
199 
200 #define expect_port(Desc, ExpectedOption, ExpectedShare, ExpectedLength, ExpectedAlign, ExpectedMin, ExpectedMax) \
201  do { \
202  ok((Desc)->Option == ExpectedOption, "Desc->Option = %u\n", (Desc)->Option); \
203  ok((Desc)->Type == CmResourceTypePort, "Desc->Type = %u\n", (Desc)->Type); \
204  ok((Desc)->ShareDisposition == ExpectedShare, "Desc->ShareDisposition = %u\n", (Desc)->ShareDisposition); \
205  ok((Desc)->u.Port.Length == ExpectedLength, "Desc->u.Port.Length = %lu\n", (Desc)->u.Port.Length); \
206  ok((Desc)->u.Port.Alignment == ExpectedAlign, "Desc->u.Port.Alignment = %lu\n", (Desc)->u.Port.Alignment); \
207  ok((Desc)->u.Port.MinimumAddress.QuadPart == ExpectedMin, "Desc->u.Port.MinimumAddress = 0x%I64x\n", (Desc)->u.Port.MinimumAddress.QuadPart); \
208  ok((Desc)->u.Port.MaximumAddress.QuadPart == ExpectedMax, "Desc->u.Port.MaximumAddress = 0x%I64x\n", (Desc)->u.Port.MaximumAddress.QuadPart); \
209  } while (0)
210 
212 {
215  IRP Irp;
216  ACPI_RESOURCE ResourcesBuffer[20];
219  PIO_RESOURCE_LIST ReqList2;
220 
221  /* Invalid AcpiHandle */
223  Irp.IoStatus.Status = STATUS_WAIT_0 + 17;
224  DeviceData.AcpiHandle = NULL;
226  ok(Status == STATUS_WAIT_0 + 17, "Status = 0x%lx\n", Status);
227 
228  /* PCI Bus device */
230  Irp.IoStatus.Status = STATUS_WAIT_0 + 17;
231  DeviceData.AcpiHandle = CorrectHandle;
232  DeviceData.HardwareIDs = L"PNP0A03\0";
234  ok(Status == STATUS_WAIT_0 + 17, "Status = 0x%lx\n", Status);
235 
236  /* PCI Bus device #2 */
238  Irp.IoStatus.Status = STATUS_WAIT_0 + 17;
239  DeviceData.AcpiHandle = CorrectHandle;
240  DeviceData.HardwareIDs = L"PNP0A08\0";
242  ok(Status == STATUS_WAIT_0 + 17, "Status = 0x%lx\n", Status);
243 
244  /* Empty buffer */
246  Irp.IoStatus.Status = STATUS_WAIT_0 + 17;
247  DeviceData.AcpiHandle = CorrectHandle;
248  DeviceData.HardwareIDs = L"PNP0501\0";
250  ok(Status == STATUS_WAIT_0 + 17, "Status = 0x%lx\n", Status);
251 
252  /* Simple single-resource list */
254  Irp.IoStatus.Status = STATUS_WAIT_0 + 17;
255  Irp.IoStatus.Information = 0;
256  DeviceData.AcpiHandle = CorrectHandle;
257  DeviceData.HardwareIDs = L"PNP0501\0";
258  Resource = ResourcesBuffer;
260  Resource->Length = sizeof(*Resource);
262  Resource->Data.Irq.InterruptCount = 1;
263  Resource->Data.Irq.Interrupts[0] = 7;
266  Resource->Length = 0;
267  Resource++;
268  PossibleBuffer.Pointer = ResourcesBuffer;
269  PossibleBuffer.Length = (ULONG_PTR)Resource - (ULONG_PTR)ResourcesBuffer;
271  ok(Status == STATUS_SUCCESS, "Status = 0x%lx\n", Status);
272  ok(Irp.IoStatus.Status == STATUS_WAIT_0 + 17, "IoStatus.Status = 0x%lx\n", Irp.IoStatus.Status);
273  ReqList = (PVOID)Irp.IoStatus.Information;
274  ok(ReqList != NULL, "ReqList is NULL\n");
275  if (ReqList == NULL)
276  {
277  skip("No ReqList\n");
278  return;
279  }
280  ok(ReqList->InterfaceType == Internal, "InterfaceType = %u\n", ReqList->InterfaceType);
281  ok(ReqList->BusNumber == 0, "BusNumber = %lu\n", ReqList->BusNumber);
282  ok(ReqList->SlotNumber == 0, "SlotNumber = %lu\n", ReqList->SlotNumber);
283  ok(ReqList->AlternativeLists == 1, "AlternativeLists = %lu\n", ReqList->AlternativeLists);
284  ok(ReqList->List[0].Version == 1, "List[0].Version = %u\n", ReqList->List[0].Version);
285  ok(ReqList->List[0].Revision == 1, "List[0].Revision = %u\n", ReqList->List[0].Revision);
286  ok(ReqList->List[0].Count == 1, "List[0].Count = %lu\n", ReqList->List[0].Count);
288  ok_int(ReqList->ListSize, GetPoolAllocSize(ReqList));
289  ok_int(ReqList->ListSize, (ULONG_PTR)&ReqList->List[0].Descriptors[1] - (ULONG_PTR)ReqList);
290  ExFreePoolWithTag(ReqList, 'RpcA');
291 
292  /* Two IRQs */
294  Irp.IoStatus.Status = STATUS_WAIT_0 + 17;
295  Irp.IoStatus.Information = 0;
296  DeviceData.AcpiHandle = CorrectHandle;
297  DeviceData.HardwareIDs = L"PNP0501\0";
298  Resource = ResourcesBuffer;
302  Resource->Data.Irq.InterruptCount = 2;
303  Resource->Data.Irq.Interrupts[0] = 3;
304  Resource->Data.Irq.Interrupts[1] = 7;
307  Resource->Length = 0;
308  Resource++;
309  PossibleBuffer.Pointer = ResourcesBuffer;
310  PossibleBuffer.Length = (ULONG_PTR)Resource - (ULONG_PTR)ResourcesBuffer;
312  ok(Status == STATUS_SUCCESS, "Status = 0x%lx\n", Status);
313  ok(Irp.IoStatus.Status == STATUS_WAIT_0 + 17, "IoStatus.Status = 0x%lx\n", Irp.IoStatus.Status);
314  ReqList = (PVOID)Irp.IoStatus.Information;
315  ok(ReqList != NULL, "ReqList is NULL\n");
316  if (ReqList == NULL)
317  {
318  skip("No ReqList\n");
319  return;
320  }
321  ok(ReqList->InterfaceType == Internal, "InterfaceType = %u\n", ReqList->InterfaceType);
322  ok(ReqList->BusNumber == 0, "BusNumber = %lu\n", ReqList->BusNumber);
323  ok(ReqList->SlotNumber == 0, "SlotNumber = %lu\n", ReqList->SlotNumber);
324  ok(ReqList->AlternativeLists == 1, "AlternativeLists = %lu\n", ReqList->AlternativeLists);
325  ok(ReqList->List[0].Version == 1, "List[0].Version = %u\n", ReqList->List[0].Version);
326  ok(ReqList->List[0].Revision == 1, "List[0].Revision = %u\n", ReqList->List[0].Revision);
327  ok(ReqList->List[0].Count == 2, "List[0].Count = %lu\n", ReqList->List[0].Count);
328  expect_irq(&ReqList->List[0].Descriptors[0], IO_RESOURCE_PREFERRED, CmResourceShareDeviceExclusive, 3, 3);
329  expect_irq(&ReqList->List[0].Descriptors[1], IO_RESOURCE_ALTERNATIVE, CmResourceShareDeviceExclusive, 7, 7);
330  ok_int(ReqList->ListSize, GetPoolAllocSize(ReqList));
331  ok_int(ReqList->ListSize, (ULONG_PTR)&ReqList->List[0].Descriptors[2] - (ULONG_PTR)ReqList);
332  ExFreePoolWithTag(ReqList, 'RpcA');
333 
334  /* Port */
336  Irp.IoStatus.Status = STATUS_WAIT_0 + 17;
337  Irp.IoStatus.Information = 0;
338  DeviceData.AcpiHandle = CorrectHandle;
339  DeviceData.HardwareIDs = L"PNP0501\0";
340  Resource = ResourcesBuffer;
342  Resource->Length = sizeof(*Resource);
343  Resource->Data.Io.IoDecode = ACPI_DECODE_16;
344  Resource->Data.Io.Alignment = 8;
345  Resource->Data.Io.AddressLength = 8;
346  Resource->Data.Io.Minimum = 0x3F8;
347  Resource->Data.Io.Maximum = 0x3F8;
350  Resource->Length = 0;
351  Resource++;
352  PossibleBuffer.Pointer = ResourcesBuffer;
353  PossibleBuffer.Length = (ULONG_PTR)Resource - (ULONG_PTR)ResourcesBuffer;
355  ok(Status == STATUS_SUCCESS, "Status = 0x%lx\n", Status);
356  ok(Irp.IoStatus.Status == STATUS_WAIT_0 + 17, "IoStatus.Status = 0x%lx\n", Irp.IoStatus.Status);
357  ReqList = (PVOID)Irp.IoStatus.Information;
358  ok(ReqList != NULL, "ReqList is NULL\n");
359  if (ReqList == NULL)
360  {
361  skip("No ReqList\n");
362  return;
363  }
364  ok(ReqList->InterfaceType == Internal, "InterfaceType = %u\n", ReqList->InterfaceType);
365  ok(ReqList->BusNumber == 0, "BusNumber = %lu\n", ReqList->BusNumber);
366  ok(ReqList->SlotNumber == 0, "SlotNumber = %lu\n", ReqList->SlotNumber);
367  ok(ReqList->AlternativeLists == 1, "AlternativeLists = %lu\n", ReqList->AlternativeLists);
368  ok(ReqList->List[0].Version == 1, "List[0].Version = %u\n", ReqList->List[0].Version);
369  ok(ReqList->List[0].Revision == 1, "List[0].Revision = %u\n", ReqList->List[0].Revision);
370  ok(ReqList->List[0].Count == 1, "List[0].Count = %lu\n", ReqList->List[0].Count);
371  expect_port(&ReqList->List[0].Descriptors[0], IO_RESOURCE_PREFERRED, CmResourceShareDriverExclusive, 8, 8, 0x3F8, 0x3FF);
372  ok_int(ReqList->ListSize, GetPoolAllocSize(ReqList));
373  ok_int(ReqList->ListSize, (ULONG_PTR)&ReqList->List[0].Descriptors[1] - (ULONG_PTR)ReqList);
374  ExFreePoolWithTag(ReqList, 'RpcA');
375 
376  /* Port + two IRQs */
378  Irp.IoStatus.Status = STATUS_WAIT_0 + 17;
379  Irp.IoStatus.Information = 0;
380  DeviceData.AcpiHandle = CorrectHandle;
381  DeviceData.HardwareIDs = L"PNP0501\0";
382  Resource = ResourcesBuffer;
384  Resource->Length = sizeof(*Resource);
385  Resource->Data.Io.IoDecode = ACPI_DECODE_16;
386  Resource->Data.Io.Alignment = 8;
387  Resource->Data.Io.AddressLength = 8;
388  Resource->Data.Io.Minimum = 0x3F8;
389  Resource->Data.Io.Maximum = 0x3F8;
394  Resource->Data.Irq.InterruptCount = 2;
395  Resource->Data.Irq.Interrupts[0] = 3;
396  Resource->Data.Irq.Interrupts[1] = 7;
399  Resource->Length = 0;
400  Resource++;
401  PossibleBuffer.Pointer = ResourcesBuffer;
402  PossibleBuffer.Length = (ULONG_PTR)Resource - (ULONG_PTR)ResourcesBuffer;
404  ok(Status == STATUS_SUCCESS, "Status = 0x%lx\n", Status);
405  ok(Irp.IoStatus.Status == STATUS_WAIT_0 + 17, "IoStatus.Status = 0x%lx\n", Irp.IoStatus.Status);
406  ReqList = (PVOID)Irp.IoStatus.Information;
407  ok(ReqList != NULL, "ReqList is NULL\n");
408  if (ReqList == NULL)
409  {
410  skip("No ReqList\n");
411  return;
412  }
413  ok(ReqList->InterfaceType == Internal, "InterfaceType = %u\n", ReqList->InterfaceType);
414  ok(ReqList->BusNumber == 0, "BusNumber = %lu\n", ReqList->BusNumber);
415  ok(ReqList->SlotNumber == 0, "SlotNumber = %lu\n", ReqList->SlotNumber);
416  ok(ReqList->AlternativeLists == 1, "AlternativeLists = %lu\n", ReqList->AlternativeLists);
417  ok(ReqList->List[0].Version == 1, "List[0].Version = %u\n", ReqList->List[0].Version);
418  ok(ReqList->List[0].Revision == 1, "List[0].Revision = %u\n", ReqList->List[0].Revision);
419  ok(ReqList->List[0].Count == 3, "List[0].Count = %lu\n", ReqList->List[0].Count);
420  expect_port(&ReqList->List[0].Descriptors[0], IO_RESOURCE_PREFERRED, CmResourceShareDriverExclusive, 8, 8, 0x3F8, 0x3FF);
421  expect_irq(&ReqList->List[0].Descriptors[1], IO_RESOURCE_PREFERRED, CmResourceShareDeviceExclusive, 3, 3);
422  expect_irq(&ReqList->List[0].Descriptors[2], IO_RESOURCE_ALTERNATIVE, CmResourceShareDeviceExclusive, 7, 7);
423  ok_int(ReqList->ListSize, GetPoolAllocSize(ReqList));
424  ok_int(ReqList->ListSize, (ULONG_PTR)&ReqList->List[0].Descriptors[3] - (ULONG_PTR)ReqList);
425  ExFreePoolWithTag(ReqList, 'RpcA');
426 
427  /* Multiple alternatives for ports + IRQs (VMware COM port, simplified) */
429  Irp.IoStatus.Status = STATUS_WAIT_0 + 17;
430  Irp.IoStatus.Information = 0;
431  DeviceData.AcpiHandle = CorrectHandle;
432  DeviceData.HardwareIDs = L"PNP0501\0";
433  Resource = ResourcesBuffer;
435  Resource->Length = sizeof(*Resource);
436 
439  Resource->Length = sizeof(*Resource);
440  Resource->Data.Io.IoDecode = ACPI_DECODE_16;
441  Resource->Data.Io.Alignment = 8;
442  Resource->Data.Io.AddressLength = 8;
443  Resource->Data.Io.Minimum = 0x3E8;
444  Resource->Data.Io.Maximum = 0x3E8;
445 
450  Resource->Data.Irq.InterruptCount = 5;
451  Resource->Data.Irq.Interrupts[0] = 3;
452  Resource->Data.Irq.Interrupts[1] = 4;
453  Resource->Data.Irq.Interrupts[2] = 5;
454  Resource->Data.Irq.Interrupts[3] = 6;
455  Resource->Data.Irq.Interrupts[4] = 7;
456 
459  Resource->Length = sizeof(*Resource);
460 
463  Resource->Length = sizeof(*Resource);
464  Resource->Data.Io.IoDecode = ACPI_DECODE_16;
465  Resource->Data.Io.Alignment = 8;
466  Resource->Data.Io.AddressLength = 8;
467  Resource->Data.Io.Minimum = 0x2E8;
468  Resource->Data.Io.Maximum = 0x2E8;
469 
474  Resource->Data.Irq.InterruptCount = 5;
475  Resource->Data.Irq.Interrupts[0] = 3;
476  Resource->Data.Irq.Interrupts[1] = 4;
477  Resource->Data.Irq.Interrupts[2] = 5;
478  Resource->Data.Irq.Interrupts[3] = 6;
479  Resource->Data.Irq.Interrupts[4] = 7;
480 
483  Resource->Length = sizeof(*Resource);
484 
487  Resource->Length = 0;
488  Resource++;
489  PossibleBuffer.Pointer = ResourcesBuffer;
490  PossibleBuffer.Length = (ULONG_PTR)Resource - (ULONG_PTR)ResourcesBuffer;
492  ok(Status == STATUS_SUCCESS, "Status = 0x%lx\n", Status);
493  ok(Irp.IoStatus.Status == STATUS_WAIT_0 + 17, "IoStatus.Status = 0x%lx\n", Irp.IoStatus.Status);
494  ReqList = (PVOID)Irp.IoStatus.Information;
495  ok(ReqList != NULL, "ReqList is NULL\n");
496  if (ReqList == NULL)
497  {
498  skip("No ReqList\n");
499  return;
500  }
501  ok(ReqList->InterfaceType == Internal, "InterfaceType = %u\n", ReqList->InterfaceType);
502  ok(ReqList->BusNumber == 0, "BusNumber = %lu\n", ReqList->BusNumber);
503  ok(ReqList->SlotNumber == 0, "SlotNumber = %lu\n", ReqList->SlotNumber);
504  ok(ReqList->AlternativeLists == 2, "AlternativeLists = %lu\n", ReqList->AlternativeLists);
505  ok(ReqList->List[0].Version == 1, "List[0].Version = %u\n", ReqList->List[0].Version);
506  ok(ReqList->List[0].Revision == 1, "List[0].Revision = %u\n", ReqList->List[0].Revision);
507  ok(ReqList->List[0].Count == 6, "List[0].Count = %lu\n", ReqList->List[0].Count);
508  expect_port(&ReqList->List[0].Descriptors[0], IO_RESOURCE_PREFERRED, CmResourceShareDriverExclusive, 8, 8, 0x3E8, 0x3EF);
509  expect_irq(&ReqList->List[0].Descriptors[1], IO_RESOURCE_PREFERRED, CmResourceShareDeviceExclusive, 3, 3);
510  expect_irq(&ReqList->List[0].Descriptors[2], IO_RESOURCE_ALTERNATIVE, CmResourceShareDeviceExclusive, 4, 4);
511  expect_irq(&ReqList->List[0].Descriptors[3], IO_RESOURCE_ALTERNATIVE, CmResourceShareDeviceExclusive, 5, 5);
512  expect_irq(&ReqList->List[0].Descriptors[4], IO_RESOURCE_ALTERNATIVE, CmResourceShareDeviceExclusive, 6, 6);
513  expect_irq(&ReqList->List[0].Descriptors[5], IO_RESOURCE_ALTERNATIVE, CmResourceShareDeviceExclusive, 7, 7);
514  ReqList2 = (PVOID)&ReqList->List[0].Descriptors[6];
515  if (ReqList->ListSize > (ULONG_PTR)ReqList2 - (ULONG_PTR)ReqList)
516  {
517  ok(ReqList2->Version == 1, "List[1].Version = %u\n", ReqList->List[0].Version);
518  ok(ReqList2->Revision == 1, "List[1].Revision = %u\n", ReqList->List[0].Revision);
519  ok(ReqList2->Count == 6, "List[1].Count = %lu\n", ReqList->List[0].Count);
526  }
527  ok_int(ReqList->ListSize, GetPoolAllocSize(ReqList));
528  ok_int(ReqList->ListSize, (ULONG_PTR)&ReqList2->Descriptors[6] - (ULONG_PTR)ReqList);
529  ExFreePoolWithTag(ReqList, 'RpcA');
530 }
static ACPI_BUFFER CurrentBuffer
struct _IO_RESOURCE_REQUIREMENTS_LIST IO_RESOURCE_REQUIREMENTS_LIST
struct _IO_RESOURCE_LIST * PIO_RESOURCE_LIST
struct _IO_RESOURCE_DESCRIPTOR::@1570::@1573 Interrupt
enum _INTERFACE_TYPE INTERFACE_TYPE
#define ACPI_RESOURCE_TYPE_START_DEPENDENT
Definition: acrestyp.h:716
_In_ PIRP _In_ PDEVICE_OBJECT Device
Definition: fatprocs.h:2029
#define IO_RESOURCE_PREFERRED
struct _PDO_DEVICE_DATA * PPDO_DEVICE_DATA
_In_ PIRP Irp
Definition: csq.h:116
#define TRUE
Definition: types.h:120
#define ACPI_RESOURCE_TYPE_END_DEPENDENT
Definition: acrestyp.h:717
#define expect_irq(Desc, ExpectedOption, ExpectedShare, ExpectedMin, ExpectedMax)
struct _IO_RESOURCE_LIST IO_RESOURCE_LIST
ACPI_SIZE Length
Definition: actypes.h:1044
#define ACPI_RESOURCE_TYPE_IRQ
Definition: acrestyp.h:714
LONG NTSTATUS
Definition: precomp.h:26
struct _IO_RESOURCE_DESCRIPTOR::@1570::@1576 DevicePrivate
#define ACPI_RESOURCE_TYPE_END_TAG
Definition: acrestyp.h:721
struct _IO_RESOURCE_REQUIREMENTS_LIST * PIO_RESOURCE_REQUIREMENTS_LIST
void * Pointer
Definition: actypes.h:1045
static SIZE_T GetPoolAllocSize(PVOID MemPtr)
IO_STATUS_BLOCK IoStatus
uint16_t * PWCHAR
Definition: typedefs.h:56
UINT32 ACPI_STATUS
Definition: actypes.h:460
NTSTATUS Bus_PDO_QueryResourceRequirements(PPDO_DEVICE_DATA DeviceData, PIRP Irp)
Definition: buspdo.c:1301
static BOOLEAN AcpiCallExpected
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define ACPI_NOT_WAKE_CAPABLE
Definition: acrestyp.h:109
#define ACPI_RESOURCE_TYPE_IO
Definition: acrestyp.h:718
#define STATUS_WAIT_0
Definition: ntstatus.h:237
#define AE_BUFFER_OVERFLOW
Definition: acexcep.h:119
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
Definition: cdprocs.h:843
#define FALSE
Definition: types.h:117
PWCHAR HardwareIDs
Definition: acpisys.h:44
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define ok_int(expression, result)
Definition: atltest.h:134
struct _PDO_DEVICE_DATA PDO_DEVICE_DATA
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
void * PVOID
Definition: retypes.h:9
struct _IO_RESOURCE_DESCRIPTOR::@1570::@1577 BusNumber
struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR
START_TEST(Bus_PDO_QueryResourceRequirements)
static VOID ExFreePoolWithTag(PVOID MemPtr, ULONG Tag)
IO_RESOURCE_DESCRIPTOR Descriptors[1]
#define GetProcessHeap()
Definition: compat.h:484
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
ACPI_STATUS AcpiGetCurrentResources(ACPI_HANDLE Device, ACPI_BUFFER *RetBuffer)
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define CopyMemory
Definition: winbase.h:1646
struct _IO_RESOURCE_DESCRIPTOR::@1570::@1575 Generic
struct _IRP IRP
static PVOID ExAllocatePoolWithTag(ULONG PoolType, SIZE_T NumberOfBytes, ULONG Tag)
static ACPI_BUFFER PossibleBuffer
struct _IRP * PIRP
#define IO_RESOURCE_ALTERNATIVE
unsigned char UCHAR
Definition: xmlstorage.h:181
struct _IO_RESOURCE_DESCRIPTOR * PIO_RESOURCE_DESCRIPTOR
Status
Definition: gdiplustypes.h:24
static const WCHAR L[]
Definition: oid.c:1250
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define ACPI_NEXT_RESOURCE(Res)
Definition: acrestyp.h:802
unsigned short USHORT
Definition: pedump.c:61
#define ok(value,...)
Definition: atltest.h:57
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
struct _IO_RESOURCE_DESCRIPTOR::@1570::@1574 Dma
struct _IO_RESOURCE_DESCRIPTOR::@1570::@1572 Memory
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
#define skip(...)
Definition: atltest.h:64
static ACPI_HANDLE CorrectHandle
#define ACPI_DECODE_16
Definition: acrestyp.h:85
#define ACPI_EXCLUSIVE
Definition: acrestyp.h:104
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1002
unsigned int ULONG
Definition: retypes.h:1
#define ULONG_PTR
Definition: config.h:101
ACPI_STATUS AcpiGetPossibleResources(ACPI_HANDLE Device, ACPI_BUFFER *RetBuffer)
#define ACPI_ACTIVE_HIGH
Definition: acrestyp.h:98
struct _IO_RESOURCE_DESCRIPTOR::@1570::@1578 ConfigData
return STATUS_SUCCESS
Definition: btrfs.c:3014
struct _IO_RESOURCE_DESCRIPTOR::@1570::@1571 Port
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T _In_ POOL_TYPE PoolType
Definition: fltkernel.h:1444
#define AE_OK
Definition: acexcep.h:97
#define ACPI_LEVEL_SENSITIVE
Definition: acrestyp.h:93
#define HeapFree(x, y, z)
Definition: compat.h:483
#define expect_port(Desc, ExpectedOption, ExpectedShare, ExpectedLength, ExpectedAlign, ExpectedMin, ExpectedMax)
union _IO_RESOURCE_DESCRIPTOR::@1570 u
#define MAKE_IRQ(Resource, _DescriptorLength, _Triggering, _Polarity, _Shareable, _WakeCapable)