+PdoQueryResources(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp,
+ PIO_STACK_LOCATION IrpSp)
+{
+ PCM_RESOURCE_LIST ResourceList;
+ ULONG ResourceListSize = FIELD_OFFSET(CM_RESOURCE_LIST, List);
+
+ ResourceList = ExAllocatePool(PagedPool, ResourceListSize);
+ if (ResourceList == NULL)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ ResourceList->Count = 0;
+
+ Irp->IoStatus.Information = (ULONG_PTR)ResourceList;
+
+ return STATUS_SUCCESS;
+}
+
+
+NTSTATUS
+PdoQueryResourceRequirements(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp,
+ PIO_STACK_LOCATION IrpSp)
+{
+ PPNPROOT_PDO_DEVICE_EXTENSION DeviceExtension;
+ PIO_RESOURCE_REQUIREMENTS_LIST ResourceList;
+ ULONG ResourceListSize = FIELD_OFFSET(IO_RESOURCE_REQUIREMENTS_LIST, List);
+
+ DPRINT("Called\n");
+
+ DeviceExtension = (PPNPROOT_PDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
+
+ if (DeviceExtension->ResourceRequirementsList == NULL)
+ {
+ /* Create an empty resource list */
+ ResourceList = ExAllocatePool(PagedPool, ResourceListSize);
+ if (ResourceList == NULL)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ RtlZeroMemory(ResourceList, ResourceListSize);
+ ResourceList->ListSize = ResourceListSize;
+
+ Irp->IoStatus.Information = (ULONG_PTR)ResourceList;
+ }
+ else
+ {
+ /* Copy existing resource requirement list */
+ ResourceList = ExAllocatePool(PagedPool, DeviceExtension->ResourceRequirementsList->ListSize);
+ if (ResourceList == NULL)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ RtlCopyMemory(
+ ResourceList,
+ DeviceExtension->ResourceRequirementsList,
+ DeviceExtension->ResourceRequirementsList->ListSize);
+ Irp->IoStatus.Information = (ULONG_PTR)ResourceList;
+ }
+
+ return STATUS_SUCCESS;
+}
+
+
+static NTSTATUS
+PnpRootPdoQueryCapabilities(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp,
+ PIO_STACK_LOCATION IrpSp)
+{
+ PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension;
+ PDEVICE_CAPABILITIES DeviceCapabilities;
+
+ DPRINT("Called\n");
+
+ DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
+ DeviceCapabilities = IrpSp->Parameters.DeviceCapabilities.Capabilities;
+
+ if (DeviceCapabilities->Version != 1)
+ return STATUS_UNSUCCESSFUL;
+
+ DeviceCapabilities->UniqueID = TRUE;
+ /* FIXME: Fill other fields */
+
+ return STATUS_SUCCESS;
+}
+
+