2 * PROJECT: ReactOS Kernel
3 * COPYRIGHT: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/io/pnpmgr/pnpreport.c
5 * PURPOSE: Device Changes Reporting Functions
6 * PROGRAMMERS: Filip Navara (xnavara@volny.cz)
9 /* INCLUDES ******************************************************************/
15 /* PUBLIC FUNCTIONS **********************************************************/
22 IoReportDetectedDevice(IN PDRIVER_OBJECT DriverObject
,
23 IN INTERFACE_TYPE LegacyBusType
,
26 IN PCM_RESOURCE_LIST ResourceList
,
27 IN PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements OPTIONAL
,
28 IN BOOLEAN ResourceAssigned
,
29 IN OUT PDEVICE_OBJECT
*DeviceObject OPTIONAL
)
31 PDEVICE_NODE DeviceNode
;
33 NTSTATUS Status
= STATUS_SUCCESS
;
35 DPRINT("__FUNCTION__ (DeviceObject %p, *DeviceObject %p)\n",
36 DeviceObject
, DeviceObject
? *DeviceObject
: NULL
);
38 /* if *DeviceObject is not NULL, we must use it as a PDO, and don't create a new one */
39 if (DeviceObject
&& *DeviceObject
)
45 UNICODE_STRING ServiceName
;
46 ServiceName
.Buffer
= DriverObject
->DriverName
.Buffer
+
47 sizeof(DRIVER_ROOT_NAME
) / sizeof(WCHAR
) - 1;
48 ServiceName
.Length
= DriverObject
->DriverName
.Length
-
49 sizeof(DRIVER_ROOT_NAME
) + sizeof(WCHAR
);
50 ServiceName
.MaximumLength
= ServiceName
.Length
;
52 /* create a new PDO and return it in *DeviceObject */
53 Status
= IopCreateDeviceNode(IopRootDeviceNode
,
58 if (!NT_SUCCESS(Status
))
60 DPRINT("IopCreateDeviceNode() failed (Status 0x%08lx)\n", Status
);
64 Pdo
= DeviceNode
->PhysicalDeviceObject
;
65 if (DeviceObject
) *DeviceObject
= Pdo
;
68 /* we don't need to call AddDevice and send IRP_MN_START_DEVICE */
77 IoReportResourceForDetection(IN PDRIVER_OBJECT DriverObject
,
78 IN PCM_RESOURCE_LIST DriverList OPTIONAL
,
79 IN ULONG DriverListSize OPTIONAL
,
80 IN PDEVICE_OBJECT DeviceObject OPTIONAL
,
81 IN PCM_RESOURCE_LIST DeviceList OPTIONAL
,
82 IN ULONG DeviceListSize OPTIONAL
,
83 OUT PBOOLEAN ConflictDetected
)
85 static int warned
= 0;
88 DPRINT1("IoReportResourceForDetection partly implemented\n");
92 *ConflictDetected
= FALSE
;
94 if (PopSystemPowerDeviceNode
&& DriverListSize
> 0)
96 /* We hope legacy devices will be enumerated by ACPI */
97 *ConflictDetected
= TRUE
;
98 return STATUS_CONFLICTING_ADDRESSES
;
101 return STATUS_SUCCESS
;
106 IopSetEvent(IN PVOID Context
)
108 PKEVENT Event
= Context
;
111 KeSetEvent(Event
, IO_NO_INCREMENT
, FALSE
);
119 IoReportTargetDeviceChange(IN PDEVICE_OBJECT PhysicalDeviceObject
,
120 IN PVOID NotificationStructure
)
123 return STATUS_NOT_IMPLEMENTED
;
131 IoReportTargetDeviceChangeAsynchronous(IN PDEVICE_OBJECT PhysicalDeviceObject
,
132 IN PVOID NotificationStructure
,
133 IN PDEVICE_CHANGE_COMPLETE_CALLBACK Callback OPTIONAL
,
134 IN PVOID Context OPTIONAL
)
137 return STATUS_NOT_IMPLEMENTED
;