VirtualBox

Changeset 46709 in vbox for trunk/src/VBox/Additions/WINNT


Ignore:
Timestamp:
Jun 20, 2013 2:51:52 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
86624
Message:

Additions/win: fix location

File:
1 edited

Legend:

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

    r46593 r46709  
    138138 * @param   pszName             The DLL name.
    139139 */
    140 static HMODULE loadSystemDll(const char *pszName)
     140static HMODULE loadInstalledDll(const char *pszName)
    141141{
    142142    char   szPath[MAX_PATH];
    143     UINT   cchPath = GetSystemDirectoryA(szPath, sizeof(szPath));
    144     size_t cbName  = strlen(pszName) + 1;
     143    UINT   cchPath = GetModuleFileNameA(NULL, szPath, sizeof(szPath));
     144    if (cchPath && cchPath <= sizeof(szPath))
     145    {
     146        char *pszSlashFile = strrchr(szPath, '\\');
     147        if (pszSlashFile)
     148            cchPath = pszSlashFile - szPath;
     149    }
    145150    if (cchPath + 1 + cbName > sizeof(szPath))
    146151        return NULL;
     
    164169{
    165170    HRESULT hr = S_OK;
    166     HMODULE hDIFxAPI = loadSystemDll("DIFxAPI.dll");
     171    HMODULE hDIFxAPI = loadInstalledDll("DIFxAPI.dll");
    167172    if (NULL == hDIFxAPI)
    168173    {
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