VirtualBox

Changeset 83807 in vbox for trunk


Ignore:
Timestamp:
Apr 18, 2020 11:30:25 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137333
Message:

VBoxInstallHelper.cpp,VBoxSerial.cpp: VC++ 14.1 says we've been using the wrong format specifier for VBOX_VENDOR_SHORT when accessing the branding path. Probably outdated/unused code. bugref:8489

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp

    r82968 r83807  
    5454
    5555/*********************************************************************************************************************************
    56 *   Header Files                                                                                                                 *
     56*   Defined Constants And Macros                                                                                                 *
    5757*********************************************************************************************************************************/
    5858#ifdef DEBUG
     
    313313
    314314        if (wcsicmp(L"General", pwszSection) != 0)
    315             swprintf_s(wszKey, RT_ELEMENTS(wszKey), L"SOFTWARE\\%s\\VirtualBox\\Branding\\%s", VBOX_VENDOR_SHORT, pwszSection);
     315            swprintf_s(wszKey, RT_ELEMENTS(wszKey), L"SOFTWARE\\%S\\VirtualBox\\Branding\\%s", VBOX_VENDOR_SHORT, pwszSection);
    316316        else
    317             swprintf_s(wszKey, RT_ELEMENTS(wszKey), L"SOFTWARE\\%s\\VirtualBox\\Branding", VBOX_VENDOR_SHORT);
     317            swprintf_s(wszKey, RT_ELEMENTS(wszKey), L"SOFTWARE\\%S\\VirtualBox\\Branding", VBOX_VENDOR_SHORT);
    318318
    319319        rc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, wszKey, 0, KEY_WRITE, &hkBranding);
     
    885885        {
    886886            WCHAR wszInf[MAX_PATH];
    887             DWORD cchInf = RT_ELEMENTS(wszInf) - sizeof(NETLWF_INF_NAME) - 1;
    888             UINT uErr = MsiGetPropertyW(hModule, L"CustomActionData", wszInf, &cchInf);
     887            DWORD cwcInf = RT_ELEMENTS(wszInf) - sizeof(NETLWF_INF_NAME) - 1;
     888            uErr = MsiGetPropertyW(hModule, L"CustomActionData", wszInf, &cwcInf);
    889889            if (uErr == ERROR_SUCCESS)
    890890            {
    891                 if (cchInf)
     891                if (cwcInf)
    892892                {
    893                     if (wszInf[cchInf - 1] != L'\\')
     893                    if (wszInf[cwcInf - 1] != L'\\')
    894894                    {
    895                         wszInf[cchInf++] = L'\\';
    896                         wszInf[cchInf]   = L'\0';
     895                        wszInf[cwcInf++] = L'\\';
     896                        wszInf[cwcInf]   = L'\0';
    897897                    }
    898898
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