VirtualBox

Changeset 44432 in vbox for trunk/src


Ignore:
Timestamp:
Jan 28, 2013 4:11:29 PM (12 years ago)
Author:
vboxsync
Message:

Reverted r83294 - doesn't work with DefaultInstall.Service sections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Installer/VBoxDrvInst.cpp

    r44339 r44432  
    5757} DIFXAPI_LOG;
    5858
    59 typedef void (WINAPI * DIFXLOGCALLBACK_W) (DIFXAPI_LOG Event, DWORD Error, PCWSTR EventDescription, PVOID CallbackContext);
    60 typedef void ( __cdecl* DIFXAPILOGCALLBACK_W) (DIFXAPI_LOG Event, DWORD Error, PCWSTR EventDescription, PVOID CallbackContext);
     59typedef void (WINAPI * DIFXLOGCALLBACK_W)( DIFXAPI_LOG Event, DWORD Error, PCWSTR EventDescription, PVOID CallbackContext);
     60typedef void ( __cdecl* DIFXAPILOGCALLBACK_W)( DIFXAPI_LOG Event, DWORD Error, PCWSTR EventDescription, PVOID CallbackContext);
    6161
    6262typedef DWORD (WINAPI *fnDriverPackageInstall) (PCTSTR DriverPackageInfPath, DWORD Flags, PCINSTALLERINFO pInstallerInfo, BOOL *pNeedReboot);
     
    6868typedef VOID (WINAPI *fnDIFXAPISetLogCallback) (DIFXAPILOGCALLBACK_W LogCallback, PVOID CallbackContext);
    6969fnDIFXAPISetLogCallback g_pfnDIFXAPISetLogCallback = NULL;
    70 
    71 typedef HRESULT (WINAPI *fnLaunchINFSectionEx) (HWND hwnd, HINSTANCE hInst, PSTR pszParams, INT nShow);
    72 fnLaunchINFSectionEx g_pfnLaunchINFSectionEx = NULL;
    7370
    7471/* Defines */
     
    361358 *
    362359 * @return  Exit code (EXIT_OK, EXIT_FAIL)
    363  * @param   pszInf              Full qualified path of the .INF file to use.
    364360 * @param   pszSection          Section to execute; usually it's "DefaultInstall".
    365361 * @param   iMode               Execution mode to use (see MSDN).
     362 * @param   pszInf              Full qualified path of the .INF file to use.
    366363 */
    367 int ExecuteInfFile(const _TCHAR *pszInf, const _TCHAR *pszSection, int iMode)
     364int ExecuteInfFile(const _TCHAR *pszSection, int iMode, const _TCHAR *pszInf)
    368365{
    369366    _tprintf(_T("Executing INF-File: %ws (Section: %ws) ...\n"), pszInf, pszSection);
    370367
    371368    /* Executed by the installer that already has proper privileges. */
    372 
    373     HRESULT hr = S_OK;
    374     HMODULE hAdvPack = LoadLibrary(_T("advpack.dll"));
    375     if (NULL == hAdvPack)
    376     {
    377         _tprintf(_T("ERROR: Unable to locate advpack.dll!\n"));
    378         hr = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
    379     }
    380     else
    381     {
    382         g_pfnLaunchINFSectionEx = (fnLaunchINFSectionEx)GetProcAddress(hAdvPack, "LaunchINFSectionEx");
    383         if (g_pfnLaunchINFSectionEx == NULL)
    384         {
    385             _tprintf(_T("ERROR: Unable to retrieve entry point for LaunchINFSectionEx!\n"));
    386             hr = HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND);
    387         }
    388     }
     369    _TCHAR szCommandLine[_MAX_PATH + 1] = { 0 };
     370    swprintf(szCommandLine, sizeof(szCommandLine), TEXT( "%ws %d %ws" ), pszSection, iMode, pszInf);
    389371
    390372#ifdef DEBUG
    391     _tprintf (_T( "pfnLaunchINFSectionEx=%p\n"), g_pfnLaunchINFSectionEx);
     373    _tprintf (_T( "Commandline: %ws\n"), szCommandLine);
    392374#endif
    393375
    394     if (!g_pfnLaunchINFSectionEx)
    395     {
    396         _TCHAR szCommandLine[_MAX_PATH + 1] = { 0 };
    397 
    398         swprintf(szCommandLine, sizeof(szCommandLine), TEXT("%ws %d %ws"),
    399                  pszSection, iMode, pszInf);
    400 
    401         InstallHinfSection(NULL /* hWnd */, NULL /* hInst */,
    402                            szCommandLine, SW_SHOW);
    403         /* No return value given! */
    404     }
    405     else
    406     {
    407         char szCommandLine[_MAX_PATH + 1] = { 0 };
    408 
    409         /* 4 means silent mode. */
    410         _snprintf(szCommandLine, sizeof(szCommandLine), "%ws,%ws,,4",
    411                   pszInf, pszSection);
    412 
    413         hr = g_pfnLaunchINFSectionEx(NULL /* hWnd */, NULL /* hInst */,
    414                                      szCommandLine, 0 /* Not used */);
    415         if (FAILED(hr))
    416             _tprintf(_T("ERROR: LaunchINFSectionEx failed: 0x%08lx\n"), hr);
    417     }
    418 
    419     if (NULL != hAdvPack)
    420        FreeLibrary(hAdvPack);
     376    InstallHinfSection(NULL, NULL, szCommandLine, SW_SHOW);
     377    /* No return value given! */
    421378
    422379    return EXIT_OK;
     
    11101067            {
    11111068                _sntprintf(szINF, sizeof(szINF) / sizeof(TCHAR), _T("%ws"), argv[3]);
    1112                 rc = ExecuteInfFile(szINF, _T("DefaultInstall"), 132);
     1069                rc = ExecuteInfFile(_T("DefaultInstall"), 132, szINF);
    11131070            }
    11141071        }
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