PowerDuplicateScheme function
Applies to: desktop apps only
Duplicates an existing power scheme.
Syntax
DWORD WINAPI PowerDuplicateScheme( __in_opt HKEY RootPowerKey, __in const GUID *SourceSchemeGuid, __in GUID **DestinationSchemeGuid );
Parameters
- RootPowerKey [in, optional]
-
This parameter is reserved for future use and must be set to NULL.
- SourceSchemeGuid [in]
-
The identifier of the power scheme that is to be duplicated.
- DestinationSchemeGuid [in]
-
The address of a pointer to a GUID. If the pointer contains NULL, the function allocates memory for a new GUID and puts the address of this memory in the pointer. The caller can free this memory using LocalFree.
Return value
Returns ERROR_SUCCESS (zero) if the call was successful, and a nonzero value if the call failed.
| Return code/value | Description |
|---|---|
|
The power scheme was successfully duplicated. |
|
One of the parameters is not valid. |
|
The DestinationSchemeGuid parameter refers to an existing power scheme. PowerDeleteScheme can be used to delete this scheme. |
Requirements
|
Minimum supported client | Windows Vista |
|---|---|
|
Minimum supported server | Windows Server 2008 |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 2/7/2012
/// Duplicates an existing power scheme
/// </summary>
/// <param name="RootPowerKey">[in, optional] This parameter is reserved for future use and must be set to NULL.</param>
/// <param name="SourceSchemeGuid">[in] The identifier of the power scheme that is to be duplicated.</param>
/// <param name="DestinationSchemeGuid">[in] The address of a pointer to a GUID. If the pointer contains NULL, the function allocates memory for a new GUID and puts the address of this memory in the pointer. The caller can free this memory using LocalFree.</param>
/// <returns>Returns ERROR_SUCCESS (zero) if the call was successful, and a non-zero value if the call failed.</returns>
[DllImport("powrprof.dll", EntryPoint = "PowerDuplicateScheme", CharSet = CharSet.Auto, SetLastError = true)]
public static extern uint PowerDuplicateScheme(IntPtr RootPowerKey, ref Guid SourceSchemeGuid, ref IntPtr DestinationSchemeGuid);
- 1/24/2011
- tilellimx