3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: ntoskrnl/io/pnpreport.c
6 * PURPOSE: Device Changes Reporting functions
8 * PROGRAMMERS: Filip Navara (xnavara@volny.cz)
11 /* INCLUDES ******************************************************************/
15 #include <internal/debug.h>
17 /* FUNCTIONS *****************************************************************/
24 IoReportDetectedDevice(
25 IN PDRIVER_OBJECT DriverObject
,
26 IN INTERFACE_TYPE LegacyBusType
,
29 IN PCM_RESOURCE_LIST ResourceList
,
30 IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements OPTIONAL
,
31 IN BOOLEAN ResourceAssigned
,
32 IN OUT PDEVICE_OBJECT
*DeviceObject
)
34 PDEVICE_NODE DeviceNode
;
36 NTSTATUS Status
= STATUS_SUCCESS
;
38 DPRINT("IoReportDetectedDevice (DeviceObject %p, *DeviceObject %p)\n",
39 DeviceObject
, DeviceObject
? *DeviceObject
: NULL
);
41 /* if *DeviceObject is not NULL, we must use it as a PDO,
42 * and don't create a new one.
44 if (DeviceObject
&& *DeviceObject
)
48 /* create a new PDO and return it in *DeviceObject */
49 Status
= IopCreateDeviceNode(IopRootDeviceNode
, NULL
, &DeviceNode
);
50 if (!NT_SUCCESS(Status
))
52 DPRINT("IopCreateDeviceNode() failed (Status 0x%08lx)\n", Status
);
55 Pdo
= DeviceNode
->PhysicalDeviceObject
;
60 /* we don't need to call AddDevice and send IRP_MN_START_DEVICE */
62 /* FIXME: save this device into the root-enumerated list, so this
63 * device would be detected as a PnP device during next startups.
74 IoReportResourceForDetection(
75 IN PDRIVER_OBJECT DriverObject
,
76 IN PCM_RESOURCE_LIST DriverList OPTIONAL
,
77 IN ULONG DriverListSize OPTIONAL
,
78 IN PDEVICE_OBJECT DeviceObject OPTIONAL
,
79 IN PCM_RESOURCE_LIST DeviceList OPTIONAL
,
80 IN ULONG DeviceListSize OPTIONAL
,
81 OUT PBOOLEAN ConflictDetected
)
83 static int warned
= 0;
86 DPRINT1("IoReportResourceForDetection partly implemented\n");
90 *ConflictDetected
= FALSE
;
92 /* FIXME: Manually indicate conflicts with KD Ports */
95 if (KdpDetectConflicts(DriverList
))
97 *ConflictDetected
= TRUE
;
98 return STATUS_CONFLICTING_ADDRESSES
;
102 if (PopSystemPowerDeviceNode
!= NULL
&& DriverListSize
> 0)
104 /* We hope legacy devices will be enumerated by ACPI */
105 *ConflictDetected
= TRUE
;
106 return STATUS_CONFLICTING_ADDRESSES
;
108 return STATUS_SUCCESS
;
116 IoReportTargetDeviceChange(
117 IN PDEVICE_OBJECT PhysicalDeviceObject
,
118 IN PVOID NotificationStructure
)
120 DPRINT1("IoReportTargetDeviceChange called (UNIMPLEMENTED)\n");
121 return STATUS_NOT_IMPLEMENTED
;
129 IoReportTargetDeviceChangeAsynchronous(
130 IN PDEVICE_OBJECT PhysicalDeviceObject
,
131 IN PVOID NotificationStructure
,
132 IN PDEVICE_CHANGE_COMPLETE_CALLBACK Callback OPTIONAL
,
133 IN PVOID Context OPTIONAL
)
135 DPRINT1("IoReportTargetDeviceChangeAsynchronous called (UNIMPLEMENTED)\n");
136 return STATUS_NOT_IMPLEMENTED
;