VirtualBox

vbox的更動 59065 路徑 trunk/src/VBox/HostDrivers


忽略:
時間撮記:
2015-12-9 上午08:43:53 (9 年 以前)
作者:
vboxsync
訊息:

NetFlt/win: Report errors via DbgPrint so they could be picked up by DebugView in the field (bugref:7933)

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp

    r58651 r59065  
    6868RT_C_DECLS_END
    6969
     70#define LogError(x) DbgPrint x
     71
    7072#if 0
    7173#undef Log
     
    547549    else
    548550    {
    549         Log(("ERROR! vboxNetLwfWinOidRequest: NdisAllocateCloneOidRequest failed with 0x%x\n", Status));
     551        LogError(("vboxNetLwfWinOidRequest: NdisAllocateCloneOidRequest failed with 0x%x\n", Status));
    550552    }
    551553    LogFlow(("<==vboxNetLwfWinOidRequest: Status=0x%x\n", Status));
     
    610612    if (Status != NDIS_STATUS_SUCCESS)
    611613    {
    612         Log(("ERROR! vboxNetLwfWinGetPacketFilter: vboxNetLwfWinSyncOidRequest(query, OID_GEN_CURRENT_PACKET_FILTER) failed with 0x%x\n", Status));
     614        LogError(("vboxNetLwfWinGetPacketFilter: vboxNetLwfWinSyncOidRequest(query, OID_GEN_CURRENT_PACKET_FILTER) failed with 0x%x\n", Status));
    613615        return FALSE;
    614616    }
    615617    if (Rq.Request.DATA.QUERY_INFORMATION.BytesWritten != sizeof(pModuleCtx->uPacketFilter))
    616618    {
    617         Log(("ERROR! vboxNetLwfWinGetPacketFilter: vboxNetLwfWinSyncOidRequest(query, OID_GEN_CURRENT_PACKET_FILTER) failed to write neccessary amount (%d bytes), actually written %d bytes\n", sizeof(pModuleCtx->uPacketFilter), Rq.Request.DATA.QUERY_INFORMATION.BytesWritten));
     619        LogError(("vboxNetLwfWinGetPacketFilter: vboxNetLwfWinSyncOidRequest(query, OID_GEN_CURRENT_PACKET_FILTER) failed to write neccessary amount (%d bytes), actually written %d bytes\n", sizeof(pModuleCtx->uPacketFilter), Rq.Request.DATA.QUERY_INFORMATION.BytesWritten));
    618620    }
    619621
     
    639641    if (Status != NDIS_STATUS_SUCCESS)
    640642    {
    641         Log(("ERROR! vboxNetLwfWinSetPacketFilter: vboxNetLwfWinSyncOidRequest(query, OID_GEN_CURRENT_PACKET_FILTER) failed with 0x%x\n", Status));
     643        LogError(("vboxNetLwfWinSetPacketFilter: vboxNetLwfWinSyncOidRequest(query, OID_GEN_CURRENT_PACKET_FILTER) failed with 0x%x\n", Status));
    642644        return Status;
    643645    }
    644646    if (Rq.Request.DATA.QUERY_INFORMATION.BytesWritten != sizeof(uFilter))
    645647    {
    646         Log(("ERROR! vboxNetLwfWinSetPacketFilter: vboxNetLwfWinSyncOidRequest(query, OID_GEN_CURRENT_PACKET_FILTER) failed to write neccessary amount (%d bytes), actually written %d bytes\n", sizeof(uFilter), Rq.Request.DATA.QUERY_INFORMATION.BytesWritten));
     648        LogError(("vboxNetLwfWinSetPacketFilter: vboxNetLwfWinSyncOidRequest(query, OID_GEN_CURRENT_PACKET_FILTER) failed to write neccessary amount (%d bytes), actually written %d bytes\n", sizeof(uFilter), Rq.Request.DATA.QUERY_INFORMATION.BytesWritten));
    647649        return NDIS_STATUS_FAILURE;
    648650    }
     
    675677    if (Status != NDIS_STATUS_SUCCESS)
    676678    {
    677         Log(("ERROR! vboxNetLwfWinSetPacketFilter: vboxNetLwfWinSyncOidRequest(set, OID_GEN_CURRENT_PACKET_FILTER, vvv below vvv) failed with 0x%x\n", Status));
     679        LogError(("vboxNetLwfWinSetPacketFilter: vboxNetLwfWinSyncOidRequest(set, OID_GEN_CURRENT_PACKET_FILTER, vvv below vvv) failed with 0x%x\n", Status));
    678680        vboxNetLwfWinDumpFilterTypes(uFilter);
    679681    }
     
    782784    if (rc != STATUS_SUCCESS)
    783785    {
    784         Log(("ERROR! vboxNetLwfWinAttach: RtlUnicodeStringToAnsiString(%ls) failed with 0x%x\n",
     786        LogError(("vboxNetLwfWinAttach: RtlUnicodeStringToAnsiString(%ls) failed with 0x%x\n",
    785787             pParameters->BaseMiniportName, rc));
    786788        return NDIS_STATUS_FAILURE;
    787789    }
    788790    DbgPrint("vboxNetLwfWinAttach: friendly name=%wZ\n", pParameters->BaseMiniportInstanceName);
    789     DbgPrint("vboxNetLwfWinAttach: name=%Z\n", strMiniportName);
     791    DbgPrint("vboxNetLwfWinAttach: name=%Z\n", &strMiniportName);
    790792
    791793    UINT cbModuleWithNameExtra = sizeof(VBOXNETLWF_MODULE) + strMiniportName.Length;
     
    796798    if (!pModuleCtx)
    797799    {
     800        LogError(("vboxNetLwfWinAttach: Failed to allocate module context for %ls\n", pParameters->BaseMiniportName));
    798801        RtlFreeAnsiString(&strMiniportName);
    799802        return NDIS_STATUS_RESOURCES;
     
    808811    if (!pModuleCtx->hWorkItem)
    809812    {
    810         Log(("ERROR! vboxNetLwfWinAttach: Failed to allocate work item for %ls\n",
    811              pParameters->BaseMiniportName));
     813        LogError(("vboxNetLwfWinAttach: Failed to allocate work item for %ls\n",
     814                pParameters->BaseMiniportName));
    812815        NdisFreeMemory(pModuleCtx, 0, 0);
    813816        return NDIS_STATUS_RESOURCES;
     
    848851    if (!pModuleCtx->hPool)
    849852    {
    850         Log(("ERROR! vboxNetLwfWinAttach: NdisAllocateNetBufferListPool failed\n"));
     853        LogError(("vboxNetLwfWinAttach: NdisAllocateNetBufferListPool failed\n"));
    851854        NdisFreeIoWorkItem(pModuleCtx->hWorkItem);
    852855        NdisFreeMemory(pModuleCtx, 0, 0);
     
    864867    if (Status != NDIS_STATUS_SUCCESS)
    865868    {
    866         Log(("ERROR! vboxNetLwfWinAttach: NdisFSetAttributes failed with 0x%x\n", Status));
     869        LogError(("vboxNetLwfWinAttach: NdisFSetAttributes failed with 0x%x\n", Status));
    867870        NdisFreeNetBufferListPool(pModuleCtx->hPool);
    868871        Log4(("vboxNetLwfWinAttach: freed NBL+NB pool 0x%p\n", pModuleCtx->hPool));
     
    11731176    if (!pMdl)
    11741177    {
    1175         Log(("ERROR! vboxNetLwfWinSGtoNB: failed to allocate an MDL\n"));
     1178        LogError(("vboxNetLwfWinSGtoNB: failed to allocate an MDL\n"));
    11761179        LogFlow(("<==vboxNetLwfWinSGtoNB: return NULL\n"));
    11771180        return NULL;
     
    11851188        if (!pMdlCurr->Next)
    11861189        {
    1187             Log(("ERROR! vboxNetLwfWinSGtoNB: failed to allocate an MDL\n"));
     1190            LogError(("vboxNetLwfWinSGtoNB: failed to allocate an MDL\n"));
    11881191            /* Tear down all MDL we chained so far */
    11891192            vboxNetLwfWinFreeMdlChain(pMdl);
     
    12071210    else
    12081211    {
    1209         Log(("ERROR! vboxNetLwfWinSGtoNB: failed to allocate an NBL+NB\n"));
     1212        LogError(("vboxNetLwfWinSGtoNB: failed to allocate an NBL+NB\n"));
    12101213        vboxNetLwfWinFreeMdlChain(pMdl);
    12111214    }
     
    12341237        else
    12351238        {
    1236             Log(("ERROR! vboxNetLwfWinSGtoNB: failed to obtain the buffer pointer (size=%u)\n", pSG->cbTotal));
     1239            LogError(("vboxNetLwfWinSGtoNB: failed to obtain the buffer pointer (size=%u)\n", pSG->cbTotal));
    12371240            NdisAdvanceNetBufferDataStart(pBuffer, pSG->cbTotal, false, NULL); /** @todo why bother? */
    12381241            NdisFreeNetBufferList(pBufList);
     
    12421245    else
    12431246    {
    1244         Log(("ERROR! vboxNetLwfWinSGtoNB: NdisRetreatNetBufferDataStart failed with 0x%x (size=%u)\n", Status, pSG->cbTotal));
     1247        LogError(("vboxNetLwfWinSGtoNB: NdisRetreatNetBufferDataStart failed with 0x%x (size=%u)\n", Status, pSG->cbTotal));
    12451248        NdisFreeNetBufferList(pBufList);
    12461249        pBufList = NULL;
     
    17791782    else
    17801783    {
    1781         Log(("ERROR! vboxNetLwfWinRegister: failed to register filter driver, status=0x%x", Status));
     1784        LogError(("vboxNetLwfWinRegister: failed to register filter driver, status=0x%x", Status));
    17821785    }
    17831786    return Status;
     
    18021805        if (Status != STATUS_SUCCESS)
    18031806        {
    1804             LogRel(("NETLWF: IDC initialization failed (system thread creation, status=0x%x)\n", Status));
     1807            LogError(("vboxNetLwfWinStartInitIdcThread: IDC initialization failed (system thread creation, status=0x%x)\n", Status));
    18051808            /*
    18061809             * We failed to init IDC and there will be no second chance.
     
    19371940        case LwfIdcState_Stopping:
    19381941            /* Impossible, but another thread is alreading doing FiniIdc, bail out */
    1939             Log(("ERROR! vboxNetLwfWinTryFiniIdc: called in 'Stopping' state\n"));
     1942            LogError(("vboxNetLwfWinTryFiniIdc: called in 'Stopping' state\n"));
    19401943            rc = VERR_INVALID_STATE;
    19411944            break;
     
    19521955            else
    19531956            {
    1954                 Log(("ERROR! vboxNetLwfWinTryFiniIdc: ObReferenceObjectByHandle(%p) failed with 0x%x\n",
     1957                LogError(("vboxNetLwfWinTryFiniIdc: ObReferenceObjectByHandle(%p) failed with 0x%x\n",
    19551958                     g_VBoxNetLwfGlobals.hInitIdcThread, Status));
    19561959            }
     
    20952098        if (Status != STATUS_SUCCESS)
    20962099        {
    2097             Log(("ERROR! vboxNetFltPortOsXmit: KeWaitForMultipleObjects() failed with 0x%x\n", Status));
     2100            LogError(("vboxNetFltPortOsXmit: KeWaitForMultipleObjects() failed with 0x%x\n", Status));
    20982101            if (Status == STATUS_TIMEOUT)
    20992102                rc = VERR_TIMEOUT;
     
    22772280        }
    22782281        else
    2279             Log(("ERROR! vboxNetLwfWinRegisterIpAddrNotifier: GetUnicastIpAddressTable failed with %x\n", Status));
     2282            LogError(("vboxNetLwfWinRegisterIpAddrNotifier: GetUnicastIpAddressTable failed with %x\n", Status));
    22802283        /* Now we can register a callback function to keep track of address changes. */
    22812284        Status = NotifyUnicastIpAddressChange(AF_UNSPEC, vboxNetLwfWinIpAddrChangeCallback,
     
    22842287            Log(("vboxNetLwfWinRegisterIpAddrNotifier: notifier=%p\n", pThis->u.s.WinIf.hNotifier));
    22852288        else
    2286             Log(("ERROR! vboxNetLwfWinRegisterIpAddrNotifier: NotifyUnicastIpAddressChange failed with %x\n", Status));
     2289            LogError(("vboxNetLwfWinRegisterIpAddrNotifier: NotifyUnicastIpAddressChange failed with %x\n", Status));
    22872290    }
    22882291    else
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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