VirtualBox

Ignore:
Timestamp:
Nov 20, 2024 4:09:39 PM (2 months ago)
Author:
vboxsync
Message:

Windows driver installation: Added VBOX_WIN_DRIVERINSTALL_F_NO_DESTROY and internal VBoxWinDrvInstTestXXX functions, required for testcase(s). bugref:10762

Location:
trunk/src/VBox/GuestHost/installation
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/installation/VBoxWinDrvInst.cpp

    r107059 r107061  
    5959
    6060#include "VBoxWinDrvCommon.h"
     61#include "VBoxWinDrvInstInternal.h"
    6162
    6263
     
    139140DECL_HIDDEN_DATA(PFNSETUPUNINSTALLOEMINFW)               g_pfnSetupUninstallOEMInfW               = NULL; /* For XP+.  */
    140141DECL_HIDDEN_DATA(PFNSETUPSETNONINTERACTIVEMODE)          g_pfnSetupSetNonInteractiveMode          = NULL; /* For W2K+. */
    141 
    142 
    143 /**
    144  * Enumeration specifying the driver (un)installation mode.
    145  */
    146 typedef enum VBOXWINDRVINSTMODE
    147 {
    148     /** Invalid mode; do not use. */
    149     VBOXWINDRVINSTMODE_INVALID = 0,
    150     /** Install a driver. */
    151     VBOXWINDRVINSTMODE_INSTALL,
    152     /** Install by executing an INF section. */
    153     VBOXWINDRVINSTMODE_INSTALL_INFSECTION,
    154     /** Uninstall a driver. */
    155     VBOXWINDRVINSTMODE_UNINSTALL,
    156     /** Uninstall by executing an INF section. */
    157     VBOXWINDRVINSTMODE_UNINSTALL_INFSECTION
    158 } VBOXWINDRVINSTMODE;
    159 
    160 /**
    161  * Structure for keeping driver (un)installation parameters.
    162  */
    163 typedef struct VBOXWINDRVINSTPARMS
    164 {
    165     /** Installation mode. */
    166     VBOXWINDRVINSTMODE enmMode;
    167     /** Installation flags of type VBOX_WIN_DRIVERINSTALL_F_XXX. */
    168     uint32_t           fFlags;
    169     /** INF file to use for (un)installation. */
    170     PRTUTF16           pwszInfFile;
    171     /** Union keeping specific parameters, depending on \a enmMode. */
    172     union
    173     {
    174         struct
    175         {
    176             /** Model including decoration (e.g. "VBoxUSB.NTAMD64"); optional and might be NULL. */
    177             PRTUTF16   pwszModel;
    178             /** Hardware (Pnp) ID; optional and might be NULL. */
    179             PRTUTF16   pwszPnpId;
    180             /** Name of section to install. */
    181             PRTUTF16   pwszSection;
    182         } UnInstall;
    183         struct
    184         {
    185             /** Section within in the INF file to execute. */
    186             PRTUTF16   pwszSection;
    187         } ExecuteInf;
    188     } u;
    189 } VBOXWINDRVINSTPARMS;
    190 /** Pointer to driver installation parameters. */
    191 typedef VBOXWINDRVINSTPARMS *PVBOXWINDRVINSTPARMS;
    192142
    193143/**
     
    18131763    }
    18141764
    1815     vboxWinDrvInstParmsDestroy(&pCtx->Parms);
     1765    if (!(fFlags & VBOX_WIN_DRIVERINSTALL_F_NO_DESTROY))
     1766        vboxWinDrvInstParmsDestroy(&pCtx->Parms);
    18161767
    18171768    if (RT_FAILURE(rc))
     
    18821833        rc = vboxWinDrvInstMain(pCtx, &pCtx->Parms);
    18831834
    1884     vboxWinDrvInstParmsDestroy(&pCtx->Parms);
     1835    if (!(fFlags & VBOX_WIN_DRIVERINSTALL_F_NO_DESTROY))
     1836        vboxWinDrvInstParmsDestroy(&pCtx->Parms);
    18851837
    18861838    if (RT_FAILURE(rc))
     
    19191871    rc = vboxWinDrvInstMain(pCtx, &pCtx->Parms);
    19201872
    1921     vboxWinDrvInstParmsDestroy(&pCtx->Parms);
     1873    if (!(fFlags & VBOX_WIN_DRIVERINSTALL_F_NO_DESTROY))
     1874        vboxWinDrvInstParmsDestroy(&pCtx->Parms);
    19221875
    19231876    return rc;
     
    19521905}
    19531906
     1907#ifdef TESTCASE
     1908/**
     1909 * Returns the internal parameters of an (un)installation.
     1910 *
     1911 * @returns Internal parameters of an (un)installation.
     1912 * @param   hDrvInst            Windows driver installer handle to use.
     1913 */
     1914PVBOXWINDRVINSTPARMS VBoxWinDrvInstTestGetParms(VBOXWINDRVINST hDrvInst)
     1915{
     1916    PVBOXWINDRVINSTINTERNAL pCtx = hDrvInst;
     1917    VBOXWINDRVINST_VALID_RETURN_RC((hDrvInst), NULL);
     1918
     1919    return &pCtx->Parms;
     1920}
     1921
     1922/**
     1923 * Detroys internal parameters of an (un)installation.
     1924 *
     1925 * @param   pParms              Internal parameters of an (un)installation to destroy.
     1926 */
     1927void VBoxWinDrvInstTestParmsDestroy(PVBOXWINDRVINSTPARMS pParms)
     1928{
     1929    vboxWinDrvInstParmsDestroy(pParms);
     1930}
     1931#endif /* TESTCASE */
     1932
Note: See TracChangeset for help on using the changeset viewer.

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