~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/win32utils.py

  • Committer: Martin
  • Date: 2011-05-27 03:06:26 UTC
  • mto: (5425.4.22 220464-stale-locks)
  • mto: This revision was merged to the branch mainline in revision 5970.
  • Revision ID: gzlist@googlemail.com-20110527030626-tzspe5y4wta5n1y8
Get the code for ERROR_ACCESS_DENIED right

Show diffs side-by-side

added added

removed removed

Lines of Context:
584
584
        try:
585
585
            handle = win32api.OpenProcess(1, False, pid) # PROCESS_TERMINATE
586
586
        except pywintypes.error, e:
587
 
            if e[0] == 1: # ERROR_ACCESS_DENIED
 
587
            if e[0] == 5: # ERROR_ACCESS_DENIED
588
588
                # Probably something alive we're not allowed to kill
589
589
                return False
590
590
            elif e[0] == 87: # ERROR_INVALID_PARAMETER
605
605
        handle = _OpenProcess(1, False, pid) # PROCESS_TERMINATE
606
606
        if not handle:
607
607
            errorcode = ctypes.GetLastError()
608
 
            if errorcode == 1: # ERROR_ACCESS_DENIED
 
608
            if errorcode == 5: # ERROR_ACCESS_DENIED
609
609
                # Probably something alive we're not allowed to kill
610
610
                return False
611
611
            elif errorcode == 87: # ERROR_INVALID_PARAMETER