tests/killdaemons.py
branchstable
changeset 1359 e23422941bae
parent 1332 e307d04d3c4d
child 1372 8d921a12dd31
equal deleted inserted replaced
1358:805a5c2fe9c8 1359:e23422941bae
    14 
    14 
    15     def kill(pid, logfn, tryhard=True):
    15     def kill(pid, logfn, tryhard=True):
    16         logfn('# Killing daemon process %d' % pid)
    16         logfn('# Killing daemon process %d' % pid)
    17         PROCESS_TERMINATE = 1
    17         PROCESS_TERMINATE = 1
    18         PROCESS_QUERY_INFORMATION = 0x400
    18         PROCESS_QUERY_INFORMATION = 0x400
    19         SYNCHRONIZE = 0x00100000L
    19         SYNCHRONIZE = 0x00100000
    20         WAIT_OBJECT_0 = 0
    20         WAIT_OBJECT_0 = 0
    21         WAIT_TIMEOUT = 258
    21         WAIT_TIMEOUT = 258
    22         handle = ctypes.windll.kernel32.OpenProcess(
    22         handle = ctypes.windll.kernel32.OpenProcess(
    23                 PROCESS_TERMINATE|SYNCHRONIZE|PROCESS_QUERY_INFORMATION,
    23                 PROCESS_TERMINATE|SYNCHRONIZE|PROCESS_QUERY_INFORMATION,
    24                 False, pid)
    24                 False, pid)
    87         pass
    87         pass
    88 
    88 
    89 if __name__ == '__main__':
    89 if __name__ == '__main__':
    90     path, = sys.argv[1:]
    90     path, = sys.argv[1:]
    91     killdaemons(path)
    91     killdaemons(path)
    92