Author: cgutman
Date: Thu Aug 18 17:13:38 2011
New Revision: 53300
URL:
http://svn.reactos.org/svn/reactos?rev=53300&view=rev
Log:
[ACPI]
- Don't try to start an interface that wasn't registered
Modified:
trunk/reactos/drivers/bus/acpi/buspdo.c
Modified: trunk/reactos/drivers/bus/acpi/buspdo.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/buspdo.c?…
==============================================================================
--- trunk/reactos/drivers/bus/acpi/buspdo.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/bus/acpi/buspdo.c [iso-8859-1] Thu Aug 18 17:13:38 2011
@@ -66,40 +66,42 @@
}
DeviceData->InterfaceName.Length = 0;
+ status = STATUS_SUCCESS;
if (!device)
{
- IoRegisterDeviceInterface(DeviceData->Common.Self,
- &GUID_DEVICE_SYS_BUTTON,
- NULL,
- &DeviceData->InterfaceName);
+ status = IoRegisterDeviceInterface(DeviceData->Common.Self,
+ &GUID_DEVICE_SYS_BUTTON,
+ NULL,
+ &DeviceData->InterfaceName);
}
else if (device->flags.hardware_id &&
strstr(device->pnp.hardware_id, ACPI_THERMAL_HID))
{
- IoRegisterDeviceInterface(DeviceData->Common.Self,
- &GUID_DEVICE_THERMAL_ZONE,
- NULL,
- &DeviceData->InterfaceName);
+ status = IoRegisterDeviceInterface(DeviceData->Common.Self,
+ &GUID_DEVICE_THERMAL_ZONE,
+ NULL,
+ &DeviceData->InterfaceName);
}
else if (device->flags.hardware_id &&
strstr(device->pnp.hardware_id, ACPI_BUTTON_HID_LID))
{
- IoRegisterDeviceInterface(DeviceData->Common.Self,
- &GUID_DEVICE_LID,
- NULL,
- &DeviceData->InterfaceName);
+ status = IoRegisterDeviceInterface(DeviceData->Common.Self,
+ &GUID_DEVICE_LID,
+ NULL,
+ &DeviceData->InterfaceName);
}
else if (device->flags.hardware_id &&
strstr(device->pnp.hardware_id, ACPI_PROCESSOR_HID))
{
- IoRegisterDeviceInterface(DeviceData->Common.Self,
- &GUID_DEVICE_PROCESSOR,
- NULL,
- &DeviceData->InterfaceName);
+ status = IoRegisterDeviceInterface(DeviceData->Common.Self,
+ &GUID_DEVICE_PROCESSOR,
+ NULL,
+ &DeviceData->InterfaceName);
}
- if (DeviceData->InterfaceName.Length != 0)
+ /* Failure to register an interface is not a fatal failure so don't return a
failure status */
+ if (NT_SUCCESS(status) && DeviceData->InterfaceName.Length != 0)
IoSetDeviceInterfaceState(&DeviceData->InterfaceName, TRUE);
state.DeviceState = PowerDeviceD0;