Platform SDK: Hardware

BATTERY_SET_INFORMATION

The BATTERY_SET_INFORMATION structure indicates to the IOCTL_BATTERY_SET_INFORMATION operation which information about the battery is to be set, and the data to which to set it.

typedef struct _BATTERY_SET_INFORMATION {
  ULONG                         BatteryTag;
  BATTERY_SET_INFORMATION_LEVEL InformationLevel;
  UCHAR                         Buffer[1];
} BATTERY_SET_INFORMATION, *PBATTERY_SET_INFORMATION;

Members

BatteryTag
Specifies the current battery tag for the battery. Information for a battery matching the tag can only be returned. Whenever this value does not match the battery's current tag, the IOCTL request will be completed with ERROR_FILE_NOT_FOUND, which indicates to the caller that the battery for which it has a tag for no longer exists. The caller may opt to use the IOCTL_BATTERY_QUERY_TAG operation to determine the tag of the newly installed battery, if one exists. (See Battery Tags for more information.)

When a query information request is made, this value is verified. In addition, if the request is in progress while this value changes, the request is aborted with the status of ERROR_FILE_NOT_FOUND.

InformationLevel
Value that represents the battery information to be set. The type of data in the buffer element of the BATTERY_SET_INFORMATION structure depends on the value of InformationLevel. This will be one of the following values:
Information Level Return
BatteryCriticalBias Sets the battery's critical bias adjustment. Note it is not envisioned that this value would normally be changed by software, and is present in the interfaces only as a maintenance feature. Not all batteries can maintain such a setting, and the battery information should be read to confirm that the battery accepted the setting.
BatteryCharge Setting this value informs the battery device that the user has requested that the battery should be charging at this time. For example, with a smart battery/charger/selector, the application could charge one battery at a time. The Buffer element of this structure is ignored.
BatteryDischarge Setting this value informs the battery device that the user has requested that the battery be discharging at this time. For example, this could be used to indicate which battery the user currently wants to power the system. The Buffer element of this structure is ignored.

Buffer
The battery information to be set. The type of data depends on the value of InformationLevel.

Remarks

The BATTERY_SET_INFORMATION structure is a variable-length structure, and you must allocate a buffer of suitable size for the information you want to include in the structure.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Batclass.h.

See Also

Device Input and Output Overview, Device Input and Output Structures, DeviceIoControl, IOCTL_BATTERY_SET_INFORMATION