tests/killdaemons.py
branchstable
changeset 1331 7d8bb8590b55
parent 1330 e2fe607966f6
child 1332 e307d04d3c4d
equal deleted inserted replaced
1330:e2fe607966f6 1331:7d8bb8590b55
    19         WAIT_OBJECT_0 = 0
    19         WAIT_OBJECT_0 = 0
    20         WAIT_TIMEOUT = 258
    20         WAIT_TIMEOUT = 258
    21         handle = ctypes.windll.kernel32.OpenProcess(
    21         handle = ctypes.windll.kernel32.OpenProcess(
    22                 PROCESS_TERMINATE|SYNCHRONIZE, False, pid)
    22                 PROCESS_TERMINATE|SYNCHRONIZE, False, pid)
    23         if handle == 0:
    23         if handle == 0:
    24             # TODO: call _check(0, expected) to check if "process not found"
    24             _check(0, 87) # err 87 when process not found
    25             return # process not found, already finished
    25             return # process not found, already finished
    26         try:
    26         try:
    27             _check(ctypes.windll.kernel32.TerminateProcess(handle, -1), 5)
    27             _check(ctypes.windll.kernel32.TerminateProcess(handle, -1), 5)
    28             #      windows error 5 when process does not exist or no access TODO
    28             #      windows error 5 when process does not exist or no access TODO
    29 
    29