mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[NTOS:PO] Do not ignore IoRegisterPlugPlayNotification return value
CORE-17637
This commit is contained in:
parent
230e6b9492
commit
07d38cd4c5
1 changed files with 18 additions and 17 deletions
|
@ -403,26 +403,27 @@ PoInitSystem(IN ULONG BootPhase)
|
|||
/* Check if this is phase 1 init */
|
||||
if (BootPhase == 1)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
/* Register power button notification */
|
||||
IoRegisterPlugPlayNotification(EventCategoryDeviceInterfaceChange,
|
||||
PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES,
|
||||
(PVOID)&GUID_DEVICE_SYS_BUTTON,
|
||||
IopRootDeviceNode->
|
||||
PhysicalDeviceObject->DriverObject,
|
||||
PopAddRemoveSysCapsCallback,
|
||||
NULL,
|
||||
&NotificationEntry);
|
||||
Status = IoRegisterPlugPlayNotification(EventCategoryDeviceInterfaceChange,
|
||||
PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES,
|
||||
(PVOID)&GUID_DEVICE_SYS_BUTTON,
|
||||
IopRootDeviceNode->PhysicalDeviceObject->DriverObject,
|
||||
PopAddRemoveSysCapsCallback,
|
||||
NULL,
|
||||
&NotificationEntry);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return FALSE;
|
||||
|
||||
/* Register lid notification */
|
||||
IoRegisterPlugPlayNotification(EventCategoryDeviceInterfaceChange,
|
||||
PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES,
|
||||
(PVOID)&GUID_DEVICE_LID,
|
||||
IopRootDeviceNode->
|
||||
PhysicalDeviceObject->DriverObject,
|
||||
PopAddRemoveSysCapsCallback,
|
||||
NULL,
|
||||
&NotificationEntry);
|
||||
return TRUE;
|
||||
Status = IoRegisterPlugPlayNotification(EventCategoryDeviceInterfaceChange,
|
||||
PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES,
|
||||
(PVOID)&GUID_DEVICE_LID,
|
||||
IopRootDeviceNode->PhysicalDeviceObject->DriverObject,
|
||||
PopAddRemoveSysCapsCallback,
|
||||
NULL,
|
||||
&NotificationEntry);
|
||||
return NT_SUCCESS(Status);
|
||||
}
|
||||
|
||||
/* Initialize the power capabilities */
|
||||
|
|
Loading…
Reference in a new issue