Muokkaa

Jaa


BATTERY_SET_INFORMATION structure

Contains battery information to be set. This structure is used with the IOCTL_BATTERY_SET_INFORMATION control code.

Syntax

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

Members

BatteryTag

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

The battery information to be set. The type of data in the Buffer member depends on the value of this member. This member can be one of the following values.

Value Meaning
BatteryCharge
1
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 member of this structure is ignored.
BatteryCriticalBias
0
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.
BatteryDischarge
2
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 member of this structure is ignored.

Buffer

The battery information to be set. The 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 to be included in the structure.

Requirements

Requirement Value
Minimum supported client
Windows XP [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Header
Poclass.h;
Batclass.h on Windows Server 2008 R2, Windows 7, Windows Server 2008, Windows Vista, Windows Server 2003 and Windows XP

See also

IOCTL_BATTERY_SET_INFORMATION