mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
parent
9cf42b56d5
commit
1cb66f6af9
|
@ -185,6 +185,10 @@ func systemGet(idx int) (*battery, error) {
|
||||||
return nil, errno
|
return nil, errno
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cbRequired == 0 {
|
||||||
|
return nil, errors.New("no buffer information returned")
|
||||||
|
}
|
||||||
|
|
||||||
// The god damn struct with ANYSIZE_ARRAY of utf16 in it is crazy.
|
// The god damn struct with ANYSIZE_ARRAY of utf16 in it is crazy.
|
||||||
// So... let's emulate it with array of uint16 ;-D.
|
// So... let's emulate it with array of uint16 ;-D.
|
||||||
// Keep in mind that the first two elements are actually cbSize.
|
// Keep in mind that the first two elements are actually cbSize.
|
||||||
|
@ -250,7 +254,7 @@ func systemGet(idx int) (*battery, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if bqi.BatteryTag == 0 {
|
if bqi.BatteryTag == 0 {
|
||||||
return nil, errors.New("BatteryTag not returned")
|
return nil, errors.New("battery tag not returned")
|
||||||
}
|
}
|
||||||
|
|
||||||
b := &battery{}
|
b := &battery{}
|
||||||
|
@ -274,6 +278,7 @@ func systemGet(idx int) (*battery, error) {
|
||||||
b.Full = float64(bi.FullChargedCapacity)
|
b.Full = float64(bi.FullChargedCapacity)
|
||||||
|
|
||||||
bws := batteryWaitStatus{BatteryTag: bqi.BatteryTag}
|
bws := batteryWaitStatus{BatteryTag: bqi.BatteryTag}
|
||||||
|
|
||||||
var bs batteryStatus
|
var bs batteryStatus
|
||||||
err = windows.DeviceIoControl(
|
err = windows.DeviceIoControl(
|
||||||
handle,
|
handle,
|
||||||
|
|
Loading…
Reference in a new issue