- Revert to pre-38722 to unbreak build
[reactos.git] / reactos / drivers / wdm / audio / backpln / portcls / power.c
1 #include "private.h"
2
3 const GUID IID_IAdapterPowerManagement;
4
5 /*
6 * @implemented
7 */
8
9 NTSTATUS
10 NTAPI
11 PcRegisterAdapterPowerManagement(
12 IN PUNKNOWN pUnknown,
13 IN PVOID pvContext)
14 {
15 NTSTATUS Status;
16 PDEVICE_OBJECT pDeviceObject;
17 PCExtension* DeviceExt;
18 IAdapterPowerManagement * pPower;
19
20 if (!pUnknown || !pvContext)
21 return STATUS_INVALID_PARAMETER;
22
23 Status = pUnknown->lpVtbl->QueryInterface(pUnknown, &IID_IAdapterPowerManagement, (PVOID*)&pPower);
24 if (!NT_SUCCESS(Status))
25 return Status;
26
27 pDeviceObject = (PDEVICE_OBJECT)pvContext;
28 DeviceExt = (PCExtension*)pDeviceObject->DeviceExtension;
29
30 if (DeviceExt->AdapterPowerManagement)
31 {
32 pPower->lpVtbl->Release(pPower);
33 return STATUS_UNSUCCESSFUL;
34 }
35
36 DeviceExt->AdapterPowerManagement = pPower;
37 return STATUS_SUCCESS;
38 }