IWDFUsbTargetDevice::SetPowerPolicy method
[Warning: UMDF 2 is the latest version of UMDF and supersedes UMDF 1. All new UMDF drivers should be written using UMDF 2. No new features are being added to UMDF 1 and there is limited support for UMDF 1 on newer versions of Windows 10. Universal Windows drivers must use UMDF 2. For more info, see Getting Started with UMDF.]
The SetPowerPolicy method sets the WinUsb power policy.
Syntax
HRESULT SetPowerPolicy( [in] ULONG PolicyType, [in] ULONG ValueLength, [in] PVOID Value );
Parameters
- PolicyType [in]
-
The type of WinUsb power policy that the UMDF driver sets.
- ValueLength [in]
-
The size, in bytes, of the buffer that SetPowerPolicy supplies in Value.
- Value [in]
-
A pointer to the buffer that contains the WinUsb power policy.
Return value
SetPowerPolicy returns one of the following values:
| Return code | Description |
|---|---|
|
SetPowerPolicy successfully set the WinUsb power policy. |
|
SetPowerPolicy encountered an allocation failure. |
|
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 and values that a UMDF driver can pass for the PolicyType and Value parameters, see the WinUsb_SetPowerPolicy function.
For more information about the power behavior of WinUSB, see WinUSB Power Management.
The SetPowerPolicy method generates a UMDF request and synchronously sends the request to the I/O target.
Requirements
|
Target platform |
|
|---|---|
|
End of support |
Unavailable in UMDF 2.0 and later. |
|
Minimum UMDF version |
1.5 |
|
Header |
|
|
DLL |
|
See also