IWDFUsbTargetDevice::RetrievePowerPolicy method

The RetrievePowerPolicy method retrieves a WinUsb power policy.

Syntax


HRESULT RetrievePowerPolicy(
  [in]       ULONG PolicyType,
  [in, out]  ULONG *ValueLength,
  [out]      PVOID Value
);

Parameters

PolicyType [in]

The type of WinUsb power policy that the UMDF driver requests.

ValueLength [in, out]

A pointer to a variable that, on input, contains the size, in bytes, of the buffer that RetrievePowerPolicy supplies in Value. On output, this parameter contains the size that RetrievePowerPolicy requires for Value.

Value [out]

A pointer that receives the buffer that contains the WinUsb power policy.

Return value

RetrievePowerPolicy returns one of the following values:

Return codeDescription
S_OK

RetrievePowerPolicy successfully retrieved the WinUsb power policy.

E_OUTOFMEMORY

RetrievePowerPolicy encountered an allocation failure.

An error code that is defined in Winerror.h

This value corresponds to the error code that the WinUsb API returned.

 

Remarks

Power policy controls the power management that WinUsb for the device performs.

For information about valid policy types that a UMDF driver can pass for the PolicyType parameter and values that the framework returns, see the WinUsb_GetPowerPolicy function.

For more information about the power behavior of WinUSB, see WinUSB Power Management.

The RetrievePowerPolicy method generates a UMDF request and synchronously sends the request to the I/O target.

Requirements

End of support

Unavailable in UMDF 2.0 and later.

Minimum UMDF version

1.5

Header

Wudfusb.h (include Wudfusb.h)

DLL

WUDFx.dll

See also

IWDFUsbTargetDevice
WinUsb_GetPowerPolicy
IWDFUsbTargetDevice::SetPowerPolicy

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.