Changeset 62697 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Jul 29, 2016 3:56:55 PM (8 years ago)
- Location:
- trunk/src/VBox/HostDrivers
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/cfg/VBoxNetCfg.cpp
r62681 r62697 19 19 #define _WIN32_DCOM 20 20 21 22 21 #include <devguid.h> 23 22 #include <stdio.h> … … 38 37 #include <Ws2tcpip.h> 39 38 #include <ws2ipdef.h> 40 #include < netioapi.h>41 #include <ip hlpapi.h>39 #include <iprt/win/netioapi.h> 40 #include <iprt/win/iphlpapi.h> 42 41 43 42 … … 498 497 VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinRenameConnection(LPWSTR pGuid, PCWSTR NewName); 499 498 500 static BOOL vboxNetCfgWinRemoveAllNetDevicesOfIdCallback(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pDev, PVOID pContext) 501 { 499 static BOOL vboxNetCfgWinRemoveAllNetDevicesOfIdCallback(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pDev, PVOID pvContext) 500 { 501 RT_NOREF1(pvContext); 502 502 SP_REMOVEDEVICE_PARAMS rmdParams; 503 503 memset(&rmdParams, 0, sizeof(SP_REMOVEDEVICE_PARAMS)); … … 674 674 } 675 675 676 typedef BOOL (* VBOXNETCFGWIN_NETENUM_CALLBACK)(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pDev, PVOID pContext);676 typedef BOOL (*PFNVBOXNETCFGWINNETENUMCALLBACK)(HDEVINFO hDevInfo, PSP_DEVINFO_DATA pDev, PVOID pContext); 677 677 VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinEnumNetDevices(LPCWSTR pwszPnPId, 678 VBOXNETCFGWIN_NETENUM_CALLBACK callback, PVOID pContext)678 PFNVBOXNETCFGWINNETENUMCALLBACK pfnCallback, PVOID pvContext) 679 679 { 680 680 NonStandardLogFlow(("VBoxNetCfgWinEnumNetDevices: Searching for: %S\n", pwszPnPId)); … … 690 690 if (hDevInfo != INVALID_HANDLE_VALUE) 691 691 { 692 DWORD winEr ;692 DWORD winEr = NO_ERROR; 693 693 694 694 DWORD dwDevId = 0; … … 771 771 if (!wcsnicmp(pCurId, pwszPnPId, cPnPId)) 772 772 { 773 if (! callback(hDevInfo, &Dev, pContext))773 if (!pfnCallback(hDevInfo, &Dev, pvContext)) 774 774 break; 775 775 } … … 1118 1118 { 1119 1119 VARIANT vtServiceName; 1120 BOOL bIsHostOnly = FALSE;1121 1120 VariantInit(&vtServiceName); 1122 1121 … … 1198 1197 } 1199 1198 1199 #if 0 /* unused */ 1200 1200 1201 1201 static HRESULT netIfWinHasIpSettings(IWbemClassObject * pAdapterConfig, SAFEARRAY * pCheckIp, SAFEARRAY * pCheckMask, bool *pFound) … … 1273 1273 } 1274 1274 1275 #endif /* unused */ 1276 1275 1277 static HRESULT netIfWinCreateIWbemServices(IWbemServices ** ppSvc) 1276 1278 { … … 1378 1380 static HRESULT netIfWinCreateIpArray(SAFEARRAY **ppArray, in_addr* aIp, UINT cIp) 1379 1381 { 1380 HRESULT hr ;1382 HRESULT hr = S_OK; /* MSC maybe used uninitialized */ 1381 1383 SAFEARRAY * pIpArray = SafeArrayCreateVector(VT_BSTR, 0, cIp); 1382 1384 if (pIpArray) … … 1408 1410 } 1409 1411 1412 #if 0 /* unused */ 1410 1413 static HRESULT netIfWinCreateIpArrayV4V6(SAFEARRAY **ppArray, BSTR Ip) 1411 1414 { … … 1434 1437 return hr; 1435 1438 } 1439 #endif 1436 1440 1437 1441 … … 1450 1454 } 1451 1455 1456 #if 0 /* unused */ 1452 1457 static HRESULT netIfWinCreateIpArrayVariantV4V6(VARIANT * pIpAddresses, BSTR Ip) 1453 1458 { … … 1463 1468 return hr; 1464 1469 } 1465 1466 static HRESULT netIfWinEnableStatic(IWbemServices * pSvc, const GUID * pGuid, BSTR ObjPath, VARIANT * pIp, VARIANT * pMask) 1470 #endif 1471 1472 static HRESULT netIfWinEnableStatic(IWbemServices *pSvc, const GUID *pGuid, BSTR ObjPath, VARIANT *pIp, VARIANT *pMask) 1467 1473 { 1468 1474 ComPtr<IWbemClassObject> pClass; … … 1491 1497 switch (winEr) 1492 1498 { 1493 case 0:1499 case 0: 1494 1500 { 1495 1501 hr = S_OK; 1496 1502 // bool bFound; 1497 1503 // HRESULT tmpHr = netIfWinWaitIpSettings(pSvc, pGuid, pIp->parray, pMask->parray, 180, &bFound); 1504 NOREF(pGuid); 1505 break; 1498 1506 } 1499 break; 1500 default: 1501 hr = HRESULT_FROM_WIN32( winEr ); 1502 break; 1507 default: 1508 hr = HRESULT_FROM_WIN32( winEr ); 1509 break; 1503 1510 } 1504 1511 } … … 1531 1538 return hr; 1532 1539 } 1540 1541 #if 0 /* unused */ 1533 1542 1534 1543 static HRESULT netIfWinEnableStaticV4V6(IWbemServices * pSvc, const GUID * pGuid, BSTR ObjPath, BSTR Ip, BSTR Mask) … … 1620 1629 return hr; 1621 1630 } 1631 1632 #endif /* unused */ 1622 1633 1623 1634 static HRESULT netIfWinEnableDHCP(IWbemServices * pSvc, BSTR ObjPath) … … 2172 2183 static HRESULT vboxNetCfgWinNetAdpUninstall(IN INetCfg *pNc, LPCWSTR pwszId, DWORD InfRmFlags) 2173 2184 { 2174 HRESULT hr = S_OK;2185 NOREF(pNc); 2175 2186 NonStandardLog("Finding NetAdp driver package and trying to uninstall it ...\n"); 2176 2187 2177 2188 VBoxDrvCfgInfUninstallAllF(L"Net", pwszId, InfRmFlags); 2178 2189 NonStandardLog("NetAdp is not installed currently\n"); 2179 return hr;2190 return S_OK; 2180 2191 } 2181 2192 … … 2291 2302 const WCHAR * pSuffix = wcsrchr( DevName, L'#' ); 2292 2303 ULONG cbSize = sizeof(VBOX_CONNECTION_NAME); 2293 ULONG cbSufSize = 0;2294 2304 2295 2305 if (pSuffix) … … 2317 2327 static BOOL vboxNetCfgWinAdjustHostOnlyNetworkInterfacePriority(IN INetCfg *pNc, IN INetCfgComponent *pNcc, PVOID pContext) 2318 2328 { 2329 RT_NOREF1(pNc); 2319 2330 INetCfgComponentBindings *pNetCfgBindings; 2320 2331 GUID *pGuid = (GUID*)pContext; … … 2652 2663 { 2653 2664 BOOL ok; 2654 DWORD ret = 0;2655 2665 GUID netGuid; 2656 2666 SP_DEVINFO_DATA DeviceInfoData; … … 2663 2673 2664 2674 /* copy the net class GUID */ 2665 memcpy 2675 memcpy(&netGuid, &GUID_DEVCLASS_NET, sizeof (GUID_DEVCLASS_NET)); 2666 2676 2667 2677 /* return a device info set contains all installed devices of the Net class */ 2668 hDeviceInfo = SetupDiGetClassDevs 2678 hDeviceInfo = SetupDiGetClassDevs(&netGuid, NULL, NULL, DIGCF_PRESENT); 2669 2679 2670 2680 if (hDeviceInfo == INVALID_HANDLE_VALUE) 2671 SetErrBreak 2681 SetErrBreak(("SetupDiGetClassDevs failed (0x%08X)", GetLastError())); 2672 2682 2673 2683 /* enumerate the driver info list */ … … 2676 2686 TCHAR *deviceHwid; 2677 2687 2678 ok = SetupDiEnumDeviceInfo 2688 ok = SetupDiEnumDeviceInfo(hDeviceInfo, index, &DeviceInfoData); 2679 2689 2680 2690 if (!ok) … … 2690 2700 2691 2701 /* try to get the hardware ID registry property */ 2692 ok = SetupDiGetDeviceRegistryProperty 2693 2694 2695 2696 2697 2698 2702 ok = SetupDiGetDeviceRegistryProperty(hDeviceInfo, 2703 &DeviceInfoData, 2704 SPDRP_HARDWAREID, 2705 NULL, 2706 NULL, 2707 0, 2708 &size); 2699 2709 if (!ok) 2700 2710 { … … 2705 2715 } 2706 2716 2707 deviceHwid = (TCHAR *) malloc 2708 ok = SetupDiGetDeviceRegistryProperty 2709 2710 2711 2712 2713 2714 2717 deviceHwid = (TCHAR *) malloc(size); 2718 ok = SetupDiGetDeviceRegistryProperty(hDeviceInfo, 2719 &DeviceInfoData, 2720 SPDRP_HARDWAREID, 2721 NULL, 2722 (PBYTE)deviceHwid, 2723 size, 2724 NULL); 2715 2725 if (!ok) 2716 2726 { 2717 free 2727 free(deviceHwid); 2718 2728 deviceHwid = NULL; 2719 2729 index++; … … 2730 2740 for (TCHAR *t = deviceHwid; 2731 2741 t && *t && t < &deviceHwid[size / sizeof(TCHAR)]; 2732 t += _tcslen 2733 { 2734 if (!_tcsicmp 2742 t += _tcslen(t) + 1) 2743 { 2744 if (!_tcsicmp(DRIVERHWID, t)) 2735 2745 { 2736 2746 /* get the device instance ID */ … … 3493 3503 HRESULT vboxNetCfgWinSetupMetric(IN HKEY hKey) 3494 3504 { 3495 HRESULT rc = S_OK;3496 3505 HINSTANCE hModule = NULL; 3497 NET_LUID luid; 3498 int loopbackMetric; 3499 3500 rc = vboxLoadIpHelpFunctions(hModule); 3501 3506 HRESULT rc = vboxLoadIpHelpFunctions(hModule); 3502 3507 if (SUCCEEDED(rc)) 3508 { 3509 NET_LUID luid; 3503 3510 rc = vboxNetCfgWinGetInterfaceLUID(hKey, &luid); 3504 3505 if (SUCCEEDED(rc)) 3506 rc = vboxNetCfgWinGetLoopbackMetric(&loopbackMetric); 3507 3508 if (SUCCEEDED(rc)) 3509 rc = vboxNetCfgWinSetInterfaceMetric(&luid, loopbackMetric - 1); 3511 if (SUCCEEDED(rc)) 3512 { 3513 int loopbackMetric; 3514 rc = vboxNetCfgWinGetLoopbackMetric(&loopbackMetric); 3515 if (SUCCEEDED(rc)) 3516 rc = vboxNetCfgWinSetInterfaceMetric(&luid, loopbackMetric - 1); 3517 } 3518 } 3510 3519 3511 3520 g_pfnInitializeIpInterfaceEntry = NULL; -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp
r62683 r62697 49 49 #include <iprt/nt/ntddk.h> 50 50 #include <iprt/nt/ndis.h> 51 #include < netioapi.h>51 #include <iprt/win/netioapi.h> 52 52 #include <mstcpip.h> 53 53 -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/nobj/VBoxNetFltNobj.cpp
r62691 r62697 94 94 STDMETHODIMP VBoxNetFltNobj::ApplyPnpChanges(IN INetCfgPnpReconfigCallback *pCallback) 95 95 { 96 RT_NOREF1(pCallback); 96 97 return S_OK; 97 98 } … … 536 537 STDMETHODIMP VBoxNetFltNobj::QueryBindingPath(IN DWORD dwChangeFlag, IN INetCfgBindingPath *pNetCfgBP) 537 538 { 539 RT_NOREF1(dwChangeFlag); 538 540 if (vboxNetFltWinNotifyShouldBind(pNetCfgBP)) 539 541 return S_OK; -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/nobj/VBoxNetFltNobj.h
r62679 r62697 38 38 public: 39 39 VBoxNetFltNobj(); 40 ~VBoxNetFltNobj();40 virtual ~VBoxNetFltNobj(); 41 41 42 42 BEGIN_COM_MAP(VBoxNetFltNobj) … … 71 71 }; 72 72 73 #endif /* #ifndef___VBoxNetFltNobj_h___ */73 #endif /* !___VBoxNetFltNobj_h___ */ -
trunk/src/VBox/HostDrivers/VBoxUSB/win/cmn/VBoxDrvTool.h
r62490 r62697 15 15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 16 16 */ 17 17 18 #ifndef ___VBoxDrvTool_win_h___ 18 19 #define ___VBoxDrvTool_win_h___ 20 19 21 #include <VBox/cdefs.h> 20 22 #include <iprt/stdint.h> 21 23 #include <iprt/assert.h> 22 24 #include <iprt/asm.h> 25 #include <iprt/nt/wdm.h> 26 23 27 24 28 RT_C_DECLS_BEGIN 25 #if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)26 # define _InterlockedExchange _InterlockedExchange_StupidDDKVsCompilerCrap27 # define _InterlockedExchangeAdd _InterlockedExchangeAdd_StupidDDKVsCompilerCrap28 # define _InterlockedCompareExchange _InterlockedCompareExchange_StupidDDKVsCompilerCrap29 # define _InterlockedAddLargeStatistic _InterlockedAddLargeStatistic_StupidDDKVsCompilerCrap30 # pragma warning(disable : 4163)31 #endif32 #if (_MSC_VER >= 1600) && !defined(VBOX_WITH_PATCHED_DDK)33 # define _interlockedbittestandset _interlockedbittestandset_StillStupidDdkVsCompilerCrap34 # define _interlockedbittestandreset _interlockedbittestandreset_StillStupidDdkVsCompilerCrap35 # define _interlockedbittestandset64 _interlockedbittestandset64_StillStupidDdkVsCompilerCrap36 # define _interlockedbittestandreset64 _interlockedbittestandreset64_StillStupidDdkVsCompilerCrap37 # pragma warning(disable : 4163)38 #endif39 40 #include <wdm.h>41 42 #if (_MSC_VER >= 1400) && !defined(VBOX_WITH_PATCHED_DDK)43 # pragma warning(default : 4163)44 # undef _InterlockedExchange45 # undef _InterlockedExchangeAdd46 # undef _InterlockedCompareExchange47 # undef _InterlockedAddLargeStatistic48 #endif49 #if (_MSC_VER >= 1600) && !defined(VBOX_WITH_PATCHED_DDK)50 # pragma warning(default : 4163)51 # undef _interlockedbittestandset52 # undef _interlockedbittestandreset53 # undef _interlockedbittestandset6454 # undef _interlockedbittestandreset6455 #endif56 57 29 58 30 #if 0 … … 116 88 RT_C_DECLS_END 117 89 118 #endif /* #ifndef ___VBoxDrvTool_win_h___ */ 90 #endif 91 -
trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbDev.cpp
r62490 r62697 3 3 * VBoxUsbDev.cpp - USB device. 4 4 */ 5 5 6 /* 6 7 * Copyright (C) 2011-2016 Oracle Corporation … … 14 15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 15 16 */ 17 18 19 /********************************************************************************************************************************* 20 * Header Files * 21 *********************************************************************************************************************************/ 16 22 #include "VBoxUsbCmn.h" 17 23 #include <iprt/assert.h> 18 24 #include <VBox/log.h> 19 25 26 27 /********************************************************************************************************************************* 28 * Defined Constants And Macros * 29 *********************************************************************************************************************************/ 20 30 #define VBOXUSB_MEMTAG 'bUBV' 31 32 21 33 22 34 DECLHIDDEN(PVOID) vboxUsbMemAlloc(SIZE_T cbBytes) … … 97 109 static VOID vboxUsbDdiUnload(PDRIVER_OBJECT pDriverObject) 98 110 { 111 RT_NOREF1(pDriverObject); 99 112 LogRel(("VBoxUsb::DriverUnload. Built Date (%s) Time (%s)\n", __DATE__, __TIME__)); 100 113 VBoxDrvToolStrFree(&g_VBoxUsbGlobals.RegPath); … … 161 174 { 162 175 PVBOXUSBDEV_EXT pDevExt = (PVBOXUSBDEV_EXT)pDeviceObject->DeviceExtension; 176 NTSTATUS Status = STATUS_SUCCESS; 177 #ifdef VBOX_STRICT 163 178 PIO_STACK_LOCATION pSl = IoGetCurrentIrpStackLocation(pIrp); 164 179 PFILE_OBJECT pFObj = pSl->FileObject; 165 NTSTATUS Status = STATUS_SUCCESS;166 180 Assert(pFObj); 167 181 Assert(!pFObj->FileName.Length); 182 #endif 168 183 Status = vboxUsbRtClose(pDevExt, pIrp); 169 184 if (NT_SUCCESS(Status)) … … 198 213 static NTSTATUS vboxUsbDispatchCleanup(IN PDEVICE_OBJECT pDeviceObject, IN PIRP pIrp) 199 214 { 200 PVBOXUSBDEV_EXT pDevExt = (PVBOXUSBDEV_EXT)pDeviceObject->DeviceExtension;215 RT_NOREF1(pDeviceObject); 201 216 NTSTATUS Status = STATUS_SUCCESS; 202 217 Status = VBoxDrvToolIoComplete(pIrp, Status, 0); -
trunk/src/VBox/HostDrivers/VBoxUSB/win/testcase/USBTest.cpp
r62688 r62697 253 253 } 254 254 255 if (version.u32Major != USBMON_MAJOR_VERSION || 256 version.u32Minor < USBMON_MINOR_VERSION) 255 if ( version.u32Major != USBMON_MAJOR_VERSION 256 #if USBMON_MINOR_VERSION != 0 257 || version.u32Minor < USBMON_MINOR_VERSION 258 #endif 259 ) 257 260 { 258 261 printf("usbproxy: Filter driver version mismatch!!\n");
Note:
See TracChangeset
for help on using the changeset viewer.