Share via


PMExt_Init (Compact 2013)

3/26/2014

Power Manager calls the Power Management Extension (PME) implementation of PMExt_Init during initialization.

Syntax

DWORD PMExt_Init(
    HKEY hKey,
    LPCTSTR lpRegistryPath
);

Parameters

  • hKey
    [in] Handle to a root registry key. The value in lpRegistryPath is a subkey of this value.
  • lpRegistryPath
    [in] Path of the registry key that is used to load the extension.

Return Value

A DWORD value that represents the PME context. This value is used as an input parameter for other PME callback functions. If PMExt_Init fails, it returns zero.

Remarks

Power Manager will call a Power Management Extension's implementation of PMExt_Init to configure the PME for execution. The parameters include the path of the registry key that is used to load the extension; a PME can use this information to load additional configuration information.

During the call to PMExt_Init, the PME should start its own thread for processing and for signaling the event notification handle returned by PMExt_GetNotificationHandle.

When initialization has successfully completed, return a nonzero DWORD value to represent the PME context. This value will be used as an input parameter to successive PME calls during the extension's lifetime.

If a fatal error occurs during the initialization of a PME, return zero to indicate to Power Manager that the PME should not be used

Warning

Power Management Extensions execute within the context of the core Power Manager, and can have a significant effect on overall system performance and security. Errors in a PME can block the core Power Manager thread indefinitely; this can cause the system to stop responding. Performance issues in a PME can harm overall system performance. Security vulnerabilities in a PME can increase a system's vulnerability to malicious attacks.

Requirements

Header

Pmext.h

See Also

Reference

Power Management Functions