VirtualBox

Ignore:
Timestamp:
Sep 13, 2011 1:09:39 PM (13 years ago)
Author:
vboxsync
Message:

VBoxNetCfg.cpp: Mark non-standard logging as such.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/cfg/VBoxNetCfg.cpp

    r37301 r38732  
    3737
    3838
    39 #ifndef Assert
     39#ifndef Assert   /** @todo r=bird: where would this be defined? */
    4040//# ifdef DEBUG
    4141//#  define Assert(_expr) assert(_expr)
     
    4949
    5050static VOID DoLogging(LPCSTR szString, ...);
    51 #define Log DoLogging
    52 #define LogFlow(x) DoLogging x
    53 
    54 #define DbgLog
    55 
    56 #define VBOX_NETCFG_LOCK_TIME_OUT     5000
     51#define NonStandardLog DoLogging
     52#define NonStandardLogFlow(x) DoLogging x
     53
     54#define DbgLog                              /** @todo r=bird: What does this do? */
     55
     56#define VBOX_NETCFG_LOCK_TIME_OUT     5000  /** @todo r=bird: What does this do? */
    5757
    5858
     
    6666    if (FAILED(hr))
    6767    {
    68         LogFlow(("QueryInterface failed, hr (0x%x)\n", hr));
     68        NonStandardLogFlow(("QueryInterface failed, hr (0x%x)\n", hr));
    6969        return hr;
    7070    }
     
    7373    if (hr == S_FALSE)
    7474    {
    75         LogFlow(("Write lock busy\n"));
     75        NonStandardLogFlow(("Write lock busy\n"));
    7676    }
    7777    else if (FAILED(hr))
    7878    {
    79         LogFlow(("AcquireWriteLock failed, hr (0x%x)\n", hr));
     79        NonStandardLogFlow(("AcquireWriteLock failed, hr (0x%x)\n", hr));
    8080    }
    8181
     
    9090    if (FAILED(hr))
    9191    {
    92         LogFlow(("QueryInterface failed, hr (0x%x)\n", hr));
     92        NonStandardLogFlow(("QueryInterface failed, hr (0x%x)\n", hr));
    9393        return hr;
    9494    }
     
    9696    hr = pLock->ReleaseWriteLock();
    9797    if (FAILED(hr))
    98         LogFlow(("ReleaseWriteLock failed, hr (0x%x)\n", hr));
     98        NonStandardLogFlow(("ReleaseWriteLock failed, hr (0x%x)\n", hr));
    9999
    100100    pLock->Release();
     
    112112    if (FAILED(hr))
    113113    {
    114         LogFlow(("CoCreateInstance failed, hr (0x%x)\n", hr));
     114        NonStandardLogFlow(("CoCreateInstance failed, hr (0x%x)\n", hr));
    115115        return hr;
    116116    }
     
    121121        if (hr == S_FALSE)
    122122        {
    123             LogFlow(("Write lock is busy\n", hr));
     123            NonStandardLogFlow(("Write lock is busy\n", hr));
    124124            hr = NETCFG_E_NO_WRITE_LOCK;
    125125        }
     
    135135        }
    136136        else
    137             LogFlow(("Initialize failed, hr (0x%x)\n", hr));
     137            NonStandardLogFlow(("Initialize failed, hr (0x%x)\n", hr));
    138138    }
    139139
     
    147147    if (FAILED(hr))
    148148    {
    149         LogFlow(("Uninitialize failed, hr (0x%x)\n", hr));
     149        NonStandardLogFlow(("Uninitialize failed, hr (0x%x)\n", hr));
    150150        return hr;
    151151    }
     
    155155        hr = vboxNetCfgWinINetCfgUnlock(pNetCfg);
    156156        if (FAILED(hr))
    157             LogFlow(("vboxNetCfgWinINetCfgUnlock failed, hr (0x%x)\n", hr));
     157            NonStandardLogFlow(("vboxNetCfgWinINetCfgUnlock failed, hr (0x%x)\n", hr));
    158158    }
    159159
     
    169169    if (FAILED(hr))
    170170    {
    171         LogFlow(("Reset failed, hr (0x%x)\n", hr));
     171        NonStandardLogFlow(("Reset failed, hr (0x%x)\n", hr));
    172172        return hr;
    173173    }
     
    195195                }
    196196                else
    197                     LogFlow(("GetInstanceGuid failed, hr (0x%x)\n", hr));
     197                    NonStandardLogFlow(("GetInstanceGuid failed, hr (0x%x)\n", hr));
    198198            }
    199199        }
     
    217217        if (hr == S_FALSE)
    218218        {
    219             LogFlow(("Component not found\n"));
     219            NonStandardLogFlow(("Component not found\n"));
    220220        }
    221221        else if (FAILED(hr))
    222222        {
    223             LogFlow(("vboxNetCfgWinGetComponentByGuidEnum failed, hr (0x%x)\n", hr));
     223            NonStandardLogFlow(("vboxNetCfgWinGetComponentByGuidEnum failed, hr (0x%x)\n", hr));
    224224        }
    225225        pEnumNcc->Release();
    226226    }
    227227    else
    228         LogFlow(("EnumComponents failed, hr (0x%x)\n", hr));
     228        NonStandardLogFlow(("EnumComponents failed, hr (0x%x)\n", hr));
    229229    return hr;
    230230}
     
    234234    HRESULT hr = pNetCfg->QueryNetCfgClass(pguidClass, IID_INetCfgClassSetup, (void**)ppSetup);
    235235    if (FAILED(hr))
    236         LogFlow(("QueryNetCfgClass failed, hr (0x%x)\n", hr));
     236        NonStandardLogFlow(("QueryNetCfgClass failed, hr (0x%x)\n", hr));
    237237    return hr;
    238238}
     
    245245    if (FAILED(hr))
    246246    {
    247         LogFlow(("vboxNetCfgWinQueryInstaller failed, hr (0x%x)\n", hr));
     247        NonStandardLogFlow(("vboxNetCfgWinQueryInstaller failed, hr (0x%x)\n", hr));
    248248        return hr;
    249249    }
     
    265265        Assert(tmpHr == S_OK);
    266266        if (tmpHr != S_OK)
    267             LogFlow(("Apply failed, hr (0x%x)\n", tmpHr));
     267            NonStandardLogFlow(("Apply failed, hr (0x%x)\n", tmpHr));
    268268    }
    269269    else
    270         LogFlow(("Install failed, hr (0x%x)\n", hr));
     270        NonStandardLogFlow(("Install failed, hr (0x%x)\n", hr));
    271271
    272272    pSetup->Release();
     
    281281    UINT i = 0;
    282282
    283     LogFlow(("Installing %u INF files ...\n", cInfPaths));
     283    NonStandardLogFlow(("Installing %u INF files ...\n", cInfPaths));
    284284
    285285    for (; i < cInfPaths; i++)
    286286    {
    287         LogFlow(("Installing INF file \"%ws\" ...\n", apInfPaths[i]));
     287        NonStandardLogFlow(("Installing INF file \"%ws\" ...\n", apInfPaths[i]));
    288288        hr = VBoxDrvCfgInfInstall(apInfPaths[i]);
    289289        if (FAILED(hr))
    290290        {
    291             LogFlow(("VBoxNetCfgWinInfInstall failed, hr (0x%x)\n", hr));
     291            NonStandardLogFlow(("VBoxNetCfgWinInfInstall failed, hr (0x%x)\n", hr));
    292292            break;
    293293        }
     
    298298        hr = VBoxNetCfgWinInstallComponent(pNetCfg, pszwComponentId, pguidClass, ppComponent);
    299299        if (FAILED(hr))
    300             LogFlow(("VBoxNetCfgWinInstallComponent failed, hr (0x%x)\n", hr));
     300            NonStandardLogFlow(("VBoxNetCfgWinInstallComponent failed, hr (0x%x)\n", hr));
    301301    }
    302302
     
    316316    if (FAILED(hr))
    317317    {
    318         LogFlow(("GetClassGuid failed, hr (0x%x)\n", hr));
     318        NonStandardLogFlow(("GetClassGuid failed, hr (0x%x)\n", hr));
    319319        return hr;
    320320    }
     
    324324    if (FAILED(hr))
    325325    {
    326         LogFlow(("vboxNetCfgWinQueryInstaller failed, hr (0x%x)\n", hr));
     326        NonStandardLogFlow(("vboxNetCfgWinQueryInstaller failed, hr (0x%x)\n", hr));
    327327        return hr;
    328328    }
     
    337337        hr = pNetCfg->Apply();
    338338        if (FAILED(hr))
    339             LogFlow(("Apply failed, hr (0x%x)\n", hr));
     339            NonStandardLogFlow(("Apply failed, hr (0x%x)\n", hr));
    340340    }
    341341    else
    342         LogFlow(("DeInstall failed, hr (0x%x)\n", hr));
     342        NonStandardLogFlow(("DeInstall failed, hr (0x%x)\n", hr));
    343343
    344344    if (pSetup)
     
    386386                }
    387387                else
    388                     LogFlow(("Next failed, hr (0x%x)\n", hr));
     388                    NonStandardLogFlow(("Next failed, hr (0x%x)\n", hr));
    389389                break;
    390390            }
     
    418418                    {
    419419                        hr = S_FALSE;
    420                         Log(("!!!REBOOT REQUIRED!!!\n"));
     420                        NonStandardLog(("!!!REBOOT REQUIRED!!!\n"));
    421421                    }
    422422                }
     
    425425            {
    426426                DWORD dwErr = GetLastError();
    427                 LogFlow(("SetupDiCallClassInstaller failed with %ld\n", dwErr));
     427                NonStandardLogFlow(("SetupDiCallClassInstaller failed with %ld\n", dwErr));
    428428                hr = HRESULT_FROM_WIN32(dwErr);
    429429            }
     
    432432        {
    433433            DWORD dwErr = GetLastError();
    434             LogFlow(("SetupDiSetSelectedDevice failed with %ld\n", dwErr));
     434            NonStandardLogFlow(("SetupDiSetSelectedDevice failed with %ld\n", dwErr));
    435435            hr = HRESULT_FROM_WIN32(dwErr);
    436436        }
     
    439439    {
    440440        DWORD dwErr = GetLastError();
    441         LogFlow(("SetupDiSetClassInstallParams failed with %ld\n", dwErr));
     441        NonStandardLogFlow(("SetupDiSetClassInstallParams failed with %ld\n", dwErr));
    442442        hr = HRESULT_FROM_WIN32(dwErr);
    443443    }
     
    486486                if (winEr != ERROR_INSUFFICIENT_BUFFER)
    487487                {
    488                     LogFlow(("SetupDiGetDeviceRegistryPropertyW (1) failed winErr(%d)\n", winEr));
     488                    NonStandardLogFlow(("SetupDiGetDeviceRegistryPropertyW (1) failed winErr(%d)\n", winEr));
    489489                    hr = HRESULT_FROM_WIN32(winEr);
    490490                    break;
     
    506506                {
    507507                    winEr = GetLastError();
    508                     LogFlow(("SetupDiGetDeviceRegistryPropertyW (2) failed winErr(%d)\n", winEr));
     508                    NonStandardLogFlow(("SetupDiGetDeviceRegistryPropertyW (2) failed winErr(%d)\n", winEr));
    509509                    hr = HRESULT_FROM_WIN32(winEr);
    510510                    break;
     
    541541    {
    542542        DWORD winEr = GetLastError();
    543         LogFlow(("SetupDiGetClassDevsExW failed winErr(%d)\n", winEr));
     543        NonStandardLogFlow(("SetupDiGetClassDevsExW failed winErr(%d)\n", winEr));
    544544        hr = HRESULT_FROM_WIN32(winEr);
    545545    }
     
    824824        }
    825825        else
    826             LogFlow(("ExecQuery failed (0x%x)\n", hr));
     826            NonStandardLogFlow(("ExecQuery failed (0x%x)\n", hr));
    827827    }
    828828    else
    829829    {
    830830        DWORD winEr = GetLastError();
    831         LogFlow(("StringFromGUID2 failed winEr (%d)\n", winEr));
     831        NonStandardLogFlow(("StringFromGUID2 failed winEr (%d)\n", winEr));
    832832        hr = HRESULT_FROM_WIN32( winEr );
    833833    }
     
    10281028            }
    10291029            else
    1030                 LogFlow(("CoSetProxyBlanket failed, hr (0x%x)\n", hr));
     1030                NonStandardLogFlow(("CoSetProxyBlanket failed, hr (0x%x)\n", hr));
    10311031
    10321032            pSvc->Release();
    10331033        }
    10341034        else
    1035             LogFlow(("ConnectServer failed, hr (0x%x)\n", hr));
     1035            NonStandardLogFlow(("ConnectServer failed, hr (0x%x)\n", hr));
    10361036        pLoc->Release();
    10371037    }
    10381038    else
    1039         LogFlow(("CoCreateInstance failed, hr (0x%x)\n", hr));
     1039        NonStandardLogFlow(("CoCreateInstance failed, hr (0x%x)\n", hr));
    10401040    return hr;
    10411041}
     
    10521052    }
    10531053    else
    1054         LogFlow(("Get failed, hr (0x%x)\n", hr));
     1054        NonStandardLogFlow(("Get failed, hr (0x%x)\n", hr));
    10551055    return hr;
    10561056}
     
    18041804    }
    18051805    else
    1806         LogFlow(("GetAdaptersAddresses err (%d)\n", dwRc));
     1806        NonStandardLogFlow(("GetAdaptersAddresses err (%d)\n", dwRc));
    18071807
    18081808    if (pAddresses)
     
    18291829    if (hr == S_OK)
    18301830    {
    1831         Log("NetFlt is installed currently, uninstalling ...\n");
     1831        NonStandardLog("NetFlt is installed currently, uninstalling ...\n");
    18321832
    18331833        hr = VBoxNetCfgWinUninstallComponent(pNc, pNcc);
     
    18371837    else if (hr == S_FALSE)
    18381838    {
    1839         Log("NetFlt is not installed currently\n");
     1839        NonStandardLog("NetFlt is not installed currently\n");
    18401840        hr = S_OK;
    18411841    }
    18421842    else
    18431843    {
    1844         LogFlow(("FindComponent failed, hr (0x%x)\n", hr));
     1844        NonStandardLogFlow(("FindComponent failed, hr (0x%x)\n", hr));
    18451845        hr = S_OK;
    18461846    }
     
    18631863    if (SUCCEEDED(hr))
    18641864    {
    1865         Log("NetFlt will be installed ...\n");
     1865        NonStandardLog("NetFlt will be installed ...\n");
    18661866        hr = VBoxNetCfgWinInstallInfAndComponent(pNc, VBOXNETCFGWIN_NETFLT_ID,
    18671867                                                 &GUID_DEVCLASS_NETSERVICE,
     
    19501950                                            hr = pNetCfgBindings->MoveAfter(pNetCfgBindPath, NULL);
    19511951                                            if (FAILED(hr))
    1952                                                 LogFlow(("Unable to move interface, hr (0x%x)\n", hr));
     1952                                                NonStandardLogFlow(("Unable to move interface, hr (0x%x)\n", hr));
    19531953                                            bFoundIface = true;
    19541954                                        }
     
    19571957                                }
    19581958                                else
    1959                                     LogFlow(("GetLowerComponent failed, hr (0x%x)\n", hr));
     1959                                    NonStandardLogFlow(("GetLowerComponent failed, hr (0x%x)\n", hr));
    19601960                                pNetCfgBindIfce->Release();
    19611961                            }
     
    19651965                                    hr = S_OK;
    19661966                                else
    1967                                     LogFlow(("Next binding interface failed, hr (0x%x)\n", hr));
     1967                                    NonStandardLogFlow(("Next binding interface failed, hr (0x%x)\n", hr));
    19681968                                break;
    19691969                            }
     
    19721972                    }
    19731973                    else
    1974                         LogFlow(("EnumBindingInterfaces failed, hr (0x%x)\n", hr));
     1974                        NonStandardLogFlow(("EnumBindingInterfaces failed, hr (0x%x)\n", hr));
    19751975                    pNetCfgBindPath->Release();
    19761976                }
     
    19801980                        hr = S_OK;
    19811981                    else
    1982                         LogFlow(("Next bind path failed, hr (0x%x)\n", hr));
     1982                        NonStandardLogFlow(("Next bind path failed, hr (0x%x)\n", hr));
    19831983                    break;
    19841984                }
     
    19871987        }
    19881988        else
    1989             LogFlow(("EnumBindingPaths failed, hr (0x%x)\n", hr));
     1989            NonStandardLogFlow(("EnumBindingPaths failed, hr (0x%x)\n", hr));
    19901990        pNetCfgBindings->Release();
    19911991    }
    19921992    else
    1993         LogFlow(("QueryInterface for IID_INetCfgComponentBindings failed, hr (0x%x)\n", hr));
     1993        NonStandardLogFlow(("QueryInterface for IID_INetCfgComponentBindings failed, hr (0x%x)\n", hr));
    19941994    return TRUE;
    19951995}
     
    21302130    if (1) { \
    21312131        hrc = E_FAIL; \
    2132         Log strAndArgs; \
     2132        NonStandardLog strAndArgs; \
    21332133        break; \
    21342134    } else do {} while (0)
     
    24292429                    {
    24302430                        DWORD winEr = GetLastError();
    2431                         LogFlow(("SetupDiSetDeviceInstallParams failed, winEr (%d)\n", winEr));
     2431                        NonStandardLogFlow(("SetupDiSetDeviceInstallParams failed, winEr (%d)\n", winEr));
    24322432                        break;
    24332433                    }
     
    24352435                else
    24362436                {
    2437                     LogFlow(("SetupDiSetDeviceInstallParams faileed: INF path is too long\n"));
     2437                    NonStandardLogFlow(("SetupDiSetDeviceInstallParams faileed: INF path is too long\n"));
    24382438                    break;
    24392439                }
     
    24422442            {
    24432443                DWORD winEr = GetLastError();
    2444                 LogFlow(("SetupDiGetDeviceInstallParams failed, winEr (%d)\n", winEr));
     2444                NonStandardLogFlow(("SetupDiGetDeviceInstallParams failed, winEr (%d)\n", winEr));
    24452445            }
    24462446        }
     
    25632563                {
    25642564                    DWORD winEr = GetLastError();
    2565                     LogFlow(("SetupDiSetDeviceInstallParams failed, winEr (%d)\n", winEr));
     2565                    NonStandardLogFlow(("SetupDiSetDeviceInstallParams failed, winEr (%d)\n", winEr));
    25662566                }
    25672567                Assert(fResult);
     
    25702570            {
    25712571                DWORD winEr = GetLastError();
    2572                 LogFlow(("SetupInitDefaultQueueCallback failed, winEr (%d)\n", winEr));
     2572                NonStandardLogFlow(("SetupInitDefaultQueueCallback failed, winEr (%d)\n", winEr));
    25732573            }
    25742574        }
     
    25762576        {
    25772577            DWORD winEr = GetLastError();
    2578             LogFlow(("SetupDiGetDeviceInstallParams failed, winEr (%d)\n", winEr));
     2578            NonStandardLogFlow(("SetupDiGetDeviceInstallParams failed, winEr (%d)\n", winEr));
    25792579        }
    25802580
     
    27122712            if (!*lppszName)
    27132713            {
    2714                 LogFlow(("SysAllocString failed\n"));
     2714                NonStandardLogFlow(("SysAllocString failed\n"));
    27152715                hrc = HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY);
    27162716            }
     
    27212721            hrc = CLSIDFromString(pWCfgGuidString, (LPCLSID)pGuid);
    27222722            if (FAILED(hrc))
    2723                 LogFlow(("CLSIDFromString failed, hrc (0x%x)\n", hrc));
     2723                NonStandardLogFlow(("CLSIDFromString failed, hrc (0x%x)\n", hrc));
    27242724        }
    27252725
     
    27542754            }
    27552755            else
    2756                 LogFlow(("Enumeration failed, hr 0x%x\n", hr));
     2756                NonStandardLogFlow(("Enumeration failed, hr 0x%x\n", hr));
    27572757            VBoxNetCfgWinReleaseINetCfg(pNetCfg, TRUE);
    27582758        }
    27592759        else if (hr == NETCFG_E_NO_WRITE_LOCK && lpszApp)
    27602760        {
    2761             LogFlow(("Application %ws is holding the lock, failed\n", lpszApp));
     2761            NonStandardLogFlow(("Application %ws is holding the lock, failed\n", lpszApp));
    27622762            CoTaskMemFree(lpszApp);
    27632763        }
    27642764        else
    2765             LogFlow(("VBoxNetCfgWinQueryINetCfg failed, hr 0x%x\n", hr));
     2765            NonStandardLogFlow(("VBoxNetCfgWinQueryINetCfg failed, hr 0x%x\n", hr));
    27662766    }
    27672767    return hrc;
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