def is_critical(self):
"""Determines if process is 'critical' or not, so we can prevent
terminating it
"""
if not self.h_process:
self.open()
if self.critical:
return True
NT_SUCCESS = lambda val: val >= 0
val = c_ulong(0)
retlen = c_ulong(0)
ret = NTDLL.NtQueryInformationProcess(self.h_process, 29, byref(val), sizeof(val), byref(retlen))
if NT_SUCCESS(ret) and val.value:
return True
return False
评论列表
文章目录