diff --git a/reactos/drivers/wdm/audio/backpln/portcls/portcls.spec b/reactos/drivers/wdm/audio/backpln/portcls/portcls.spec index 366e6af5b71..f60523ada30 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/portcls.spec +++ b/reactos/drivers/wdm/audio/backpln/portcls/portcls.spec @@ -41,6 +41,7 @@ ; Power Management @ stdcall PcRegisterAdapterPowerManagement(ptr ptr) @ stdcall PcRequestNewPowerState(ptr long) +@ stdcall PcUnregisterAdapterPowerManagement(ptr) ; Properties @ stdcall PcCompletePendingPropertyRequest(ptr long) diff --git a/reactos/drivers/wdm/audio/backpln/portcls/power.cpp b/reactos/drivers/wdm/audio/backpln/portcls/power.cpp index 6371952b115..24862211b8d 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/power.cpp +++ b/reactos/drivers/wdm/audio/backpln/portcls/power.cpp @@ -48,6 +48,30 @@ PcRegisterAdapterPowerManagement( return STATUS_SUCCESS; } +NTSTATUS +NTAPI +PcUnregisterAdapterPowerManagement( + IN PDEVICE_OBJECT DeviceObject) +{ + PPCLASS_DEVICE_EXTENSION DeviceExt; + + DPRINT("PcUnregisterAdapterPowerManagement pUnknown %p pvContext %p\n", DeviceObject); + PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL); + + if (!DeviceObject) + return STATUS_INVALID_PARAMETER; + + DeviceExt = (PPCLASS_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + if (DeviceExt->AdapterPowerManagement) + { + DeviceExt->AdapterPowerManagement->Release(); + } + DeviceExt->AdapterPowerManagement = NULL; + return STATUS_SUCCESS; +} + + static VOID