VirtualBox

Ignore:
Timestamp:
Apr 7, 2017 7:54:01 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114453
Message:

ValidationKit: get rid of leftover verification dialogs explicitly, as killing drvinst with children does not get this job done on Windows 10 (but don't ask me why driver verification can't verify the publisher sporadically, makes no sense)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/VBox/ValidationKit/testdriver/vboxinstaller.py

    r66376 r66466  
    784784
    785785    def _killProcessesByName(self, sName, sDesc, fChildren = False):
    786         """ Checks whether the named process is present or not. """
     786        """ Kills the named process, optionally including children. """
    787787        cKilled = 0;
    788788        aoProcesses = utils.processListAll();
     
    800800                            utils.processKill(oChild.iPid);
    801801                            cKilled += 1;
     802        return cKilled;
     803
     804    def _killProcessesByNameAndArgSubstr(self, sName, sArg, sDesc):
     805        """ Kills the named process, if one of its args contains the string. """
     806        cKilled = 0;
     807        aoProcesses = utils.processListAll();
     808        for oProcess in aoProcesses:
     809            sBase = oProcess.getBaseImageNameNoExeSuff();
     810            if sBase is not None and sBase.lower() == sName and any(sArg in s for s in oProcess.asArgs):
     811               
     812                reporter.log('Killing %s process: %s (%s)' % (sDesc, oProcess.iPid, sBase));
     813                utils.processKill(oProcess.iPid);
     814                cKilled += 1;
    802815        return cKilled;
    803816
     
    826839
    827840        # Before we start uninstalling anything, just ruthlessly kill any
    828         # msiexec and drvinst process we might find hanging around.
     841        # msiexec, drvinst and some rundll process we might find hanging around.
     842        if self._isProcessPresent('rundll32'):
     843            cTimes = 0;
     844            while cTimes < 3:
     845                cTimes += 1;
     846                cKilled = self._killProcessesByNameAndArgSubstr('rundll32', 'InstallSecurityPromptRunDllW', 'MSI driver installation');
     847                if cKilled <= 0:
     848                    break;
     849                time.sleep(10); # Give related drvinst process a chance to clean up after we killed the verification dialog.
     850
    829851        if self._isProcessPresent('drvinst'):
    830852            time.sleep(15);     # In the hope that it goes away.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette