def get_process_handle ( self ) : # The handle doesn't need to be closed. # See http://msdn.microsoft.com/en-us/library/ms681423(VS.85).aspx hProcess = self . raw . u . CreateProcessInfo . hProcess if hProcess in ( 0 , win32 . NULL , win32 . INVALID_HANDLE_VALUE ) : hProcess = None else : hProcess = ProcessHandle ( hProcess , False , win32 . PROCESS_ALL_ACCESS ) return hProcess
python win32api get handle to process
def get_process_handle(self):
        """
        @rtype:  L{ProcessHandle}
        @return: Process handle received from the system.
            Returns C{None} if the handle is not available.
        """
        # The handle doesn't need to be closed.
        # See http://msdn.microsoft.com/en-us/library/ms681423(VS.85).aspx
        hProcess = self.raw.u.CreateProcessInfo.hProcess
        if hProcess in (0, win32.NULL, win32.INVALID_HANDLE_VALUE):
            hProcess = None
        else:
            hProcess = ProcessHandle(hProcess, False, win32.PROCESS_ALL_ACCESS)
        return hProcess