PowrProf (JNA API)
Description: declaration: package: com.sun.jna.platform.win32, interface: PowrProf

Package com.sun.jna.platform.win32

# Interface PowrProf

All Superinterfaces:
  `Library`

public interface PowrProf extends Library
Functions used with power management.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static interface`
  `PowrProf.POWER_INFORMATION_LEVEL`
  Enum which indicates the power information level requested from `CallNtPowerInformation(int, com.sun.jna.Pointer, int, com.sun.jna.Pointer, int)`.

  ## Nested classes/interfaces inherited from interface com.sun.jna.Library

  `Library.Handler`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final PowrProf`
  `INSTANCE`

  ### Fields inherited from interface com.sun.jna.Library

  `OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_CLASSLOADER, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRING_ENCODING, OPTION_STRUCTURE_ALIGNMENT, OPTION_SYMBOL_PROVIDER, OPTION_TYPE_MAPPER`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `CallNtPowerInformation(int informationLevel, Pointer lpInputBuffer, int nInputBufferSize, Pointer lpOutputBuffer, int nOutputBufferSize)`
  Sets or retrieves power information.

- ## Field Details

  - ### INSTANCE

    static final PowrProf INSTANCE

- ## Method Details

  - ### CallNtPowerInformation

    int CallNtPowerInformation(int informationLevel, Pointer lpInputBuffer, int nInputBufferSize, Pointer lpOutputBuffer, int nOutputBufferSize)
    Sets or retrieves power information.

    Changes made to the current system power policy using `CallNtPowerInformation(int, com.sun.jna.Pointer, int, com.sun.jna.Pointer, int)` are immediate, but they are not persistent; that is, the changes are not stored as part of a power scheme. Any changes to system power policy made with `CallNtPowerInformation(int, com.sun.jna.Pointer, int, com.sun.jna.Pointer, int)` may be overwritten by changes to a policy scheme made by the user in the Power Options control panel program, or by subsequent calls to `WritePwrScheme`, `SetActivePwrScheme`, or other power scheme functions.

    Parameters:
      `informationLevel` - The information level requested. This value indicates the specific power information to be set or retrieved. This parameter must be one of the following `PowrProf.POWER_INFORMATION_LEVEL` enumeration type values: `PowrProf.POWER_INFORMATION_LEVEL.LastSleepTime`, `PowrProf.POWER_INFORMATION_LEVEL.LastWakeTime`, `PowrProf.POWER_INFORMATION_LEVEL.ProcessorInformation`, `PowrProf.POWER_INFORMATION_LEVEL.SystemBatteryState`, `PowrProf.POWER_INFORMATION_LEVEL.SystemExecutionState`, `PowrProf.POWER_INFORMATION_LEVEL.SystemPowerCapabilities`, `PowrProf.POWER_INFORMATION_LEVEL.SystemPowerInformation`, `PowrProf.POWER_INFORMATION_LEVEL.SystemPowerPolicyAc`, `PowrProf.POWER_INFORMATION_LEVEL.SystemPowerPolicyCurrent`, `PowrProf.POWER_INFORMATION_LEVEL.SystemPowerPolicyDc`, or `PowrProf.POWER_INFORMATION_LEVEL.SystemReserveHiberFile`.
      `lpInputBuffer` - A pointer to an optional input buffer. The data type of this buffer depends on the information level requested in the `informationLevel` parameter.
      `nInputBufferSize` - The size of the input buffer, in bytes.
      `lpOutputBuffer` - A pointer to an optional output buffer. The data type of this buffer depends on the information level requested in the `informationLevel` parameter. If the buffer is too small to contain the information, the function returns `NTStatus.STATUS_BUFFER_TOO_SMALL`.
      `nOutputBufferSize` - The size of the output buffer, in bytes. Depending on the information level requested, this may be a variably sized buffer.
    Returns:
      If the function succeeds, the return value is `NTStatus.STATUS_SUCCESS`. If the function fails, the return value can be one the following status codes: `NTStatus.STATUS_BUFFER_TOO_SMALL` if the output buffer is of insufficient size to contain the data to be returned. `NTStatus.STATUS_ACCESS_DENIED` if the caller had insufficient access rights to perform the requested action.