Expand Minimize

PowerDuplicateScheme function

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/valueDescription
ERROR_SUCCESS
0 (0x0)

The power scheme was successfully duplicated.

ERROR_INVALID_PARAMETER
87 (0x57)

One of the parameters is not valid.

ERROR_ALREADY_EXISTS
183 (0xB7)

The DestinationSchemeGuid parameter refers to an existing power scheme. PowerDeleteScheme can be used to delete this scheme.

 

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

PowrProf.h

Library

PowrProf.lib

DLL

PowrProf.dll

See also

Power Management Functions

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.