Update vendored windows libs

This commit is contained in:
Labrys of Knossos 2022-11-28 05:59:32 -05:00
commit b1cefa94e5
226 changed files with 33472 additions and 11882 deletions

View file

@ -2,24 +2,23 @@ import ctypes.wintypes
class SYSTEM_POWER_STATUS(ctypes.Structure):
_fields_ = (
('ac_line_status', ctypes.wintypes.BYTE),
('battery_flag', ctypes.wintypes.BYTE),
('battery_life_percent', ctypes.wintypes.BYTE),
('reserved', ctypes.wintypes.BYTE),
('battery_life_time', ctypes.wintypes.DWORD),
('battery_full_life_time', ctypes.wintypes.DWORD),
)
_fields_ = (
('ac_line_status', ctypes.wintypes.BYTE),
('battery_flag', ctypes.wintypes.BYTE),
('battery_life_percent', ctypes.wintypes.BYTE),
('reserved', ctypes.wintypes.BYTE),
('battery_life_time', ctypes.wintypes.DWORD),
('battery_full_life_time', ctypes.wintypes.DWORD),
)
@property
def ac_line_status_string(self):
return {
0: 'offline', 1: 'online', 255: 'unknown'}[self.ac_line_status]
@property
def ac_line_status_string(self):
return {0: 'offline', 1: 'online', 255: 'unknown'}[self.ac_line_status]
LPSYSTEM_POWER_STATUS = ctypes.POINTER(SYSTEM_POWER_STATUS)
GetSystemPowerStatus = ctypes.windll.kernel32.GetSystemPowerStatus
GetSystemPowerStatus.argtypes = LPSYSTEM_POWER_STATUS,
GetSystemPowerStatus.argtypes = (LPSYSTEM_POWER_STATUS,)
GetSystemPowerStatus.restype = ctypes.wintypes.BOOL
SetThreadExecutionState = ctypes.windll.kernel32.SetThreadExecutionState
@ -28,10 +27,11 @@ SetThreadExecutionState.restype = ctypes.c_uint
class ES:
"""
Execution state constants
"""
continuous = 0x80000000
system_required = 1
display_required = 2
awaymode_required = 0x40
"""
Execution state constants
"""
continuous = 0x80000000
system_required = 1
display_required = 2
awaymode_required = 0x40