Changeset 38425 in vbox
- Timestamp:
- Aug 11, 2011 8:22:34 PM (13 years ago)
- Location:
- trunk/src/VBox/HostDrivers/VBoxUSB/win/mon
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbFlt.cpp
r38424 r38425 252 252 static void vboxUsbFltDevOwnerSetLocked(PVBOXUSBFLT_DEVICE pDevice, PVBOXUSBFLTCTX pContext, uintptr_t uFltId, bool fIsOneShot) 253 253 { 254 A ssert(!pDevice->pOwner);254 ASSERT_WARN(!pDevice->pOwner, ("device 0x%p has an owner(0x%p)", pDevice, pDevice->pOwner)); 255 255 ++pContext->cActiveFilters; 256 256 pDevice->pOwner = pContext; … … 261 261 static void vboxUsbFltDevOwnerClearLocked(PVBOXUSBFLT_DEVICE pDevice) 262 262 { 263 A ssert(pDevice->pOwner);263 ASSERT_WARN(pDevice->pOwner, ("no owner for device 0x%p", pDevice)); 264 264 --pDevice->pOwner->cActiveFilters; 265 A ssert(pDevice->pOwner->cActiveFilters < UINT32_MAX/2);265 ASSERT_WARN(pDevice->pOwner->cActiveFilters < UINT32_MAX/2, ("cActiveFilters (%d)", pDevice->pOwner->cActiveFilters)); 266 266 pDevice->pOwner = NULL; 267 267 pDevice->uFltId = 0; … … 905 905 } 906 906 } 907 else 908 { 909 LOG(("driver name not match, was:")); 910 LOG_USTR(&pHubDevObj->DriverObject->DriverName); 911 LOG(("but expected:")); 912 LOG_USTR(&szStandardControllerName[j]); 913 } 907 914 } 908 915 } 916 else 917 { 918 LOG(("null driver object (0x%p) or name buffer (0x%p), length(%d)", pHubDevObj->DriverObject, 919 pHubDevObj->DriverObject ? pHubDevObj->DriverObject->DriverName.Buffer : NULL, 920 pHubDevObj->DriverObject ? pHubDevObj->DriverObject->DriverName.Length : 0)); 921 } 909 922 ObDereferenceObject(pHubFileObj); 910 923 } … … 918 931 NTSTATUS VBoxUsbFltClose(PVBOXUSBFLTCTX pContext) 919 932 { 933 LOG(("Closing context(0x%p)", pContext)); 920 934 LIST_ENTRY ReplugDevList; 921 935 InitializeListHead(&ReplugDevList); 922 936 923 A ssert(pContext);937 ASSERT_WARN(pContext, ("null context")); 924 938 925 939 KIRQL Irql = KeGetCurrentIrql(); 926 A ssert(Irql == PASSIVE_LEVEL);940 ASSERT_WARN(Irql == PASSIVE_LEVEL, ("irql==(%d)", Irql)); 927 941 928 942 VBOXUSBFLT_LOCK_ACQUIRE(); … … 931 945 if (pContext->pChangeEvent) 932 946 { 947 LOG(("seting & closing change event (0x%p)", pContext->pChangeEvent)); 933 948 KeSetEvent(pContext->pChangeEvent, 934 949 0, /* increment*/ … … 937 952 pContext->pChangeEvent = NULL; 938 953 } 954 else 955 { 956 LOG(("no change event")); 957 } 939 958 RemoveEntryList(&pContext->ListEntry); 940 959 960 LOG(("removing owner filters")); 941 961 /* now re-arrange the filters */ 942 962 /* 1. remove filters */ 943 963 VBoxUSBFilterRemoveOwner(pContext); 944 964 965 LOG(("enumerating devices..")); 945 966 /* 2. check if there are devices owned */ 946 967 for (PLIST_ENTRY pEntry = g_VBoxUsbFltGlobals.DeviceList.Flink; … … 952 973 continue; 953 974 954 Assert(pDevice->enmState != VBOXUSBFLT_DEVSTATE_ADDED); 955 Assert(pDevice->enmState != VBOXUSBFLT_DEVSTATE_REMOVED); 975 LOG(("found device(0x%p), pdo(0x%p), state(%d), filter id(0x%p), oneshot(%d)", 976 pDevice, pDevice->Pdo, pDevice->enmState, pDevice->uFltId, (int)pDevice->fIsFilterOneShot)); 977 ASSERT_WARN(pDevice->enmState != VBOXUSBFLT_DEVSTATE_ADDED, ("VBOXUSBFLT_DEVSTATE_ADDED state for device(0x%p)", pDevice)); 978 ASSERT_WARN(pDevice->enmState != VBOXUSBFLT_DEVSTATE_REMOVED, ("VBOXUSBFLT_DEVSTATE_REMOVED state for device(0x%p)", pDevice)); 956 979 957 980 vboxUsbFltDevOwnerClearLocked(pDevice); … … 959 982 if (vboxUsbFltDevCheckReplugLocked(pDevice, pContext)) 960 983 { 984 LOG(("device needs replug")); 961 985 InsertHeadList(&ReplugDevList, &pDevice->RepluggingLe); 962 986 /* retain to ensure the device is not removed before we issue a replug */ … … 965 989 ObReferenceObject(pDevice->Pdo); 966 990 } 991 else 992 { 993 LOG(("device does NOT need replug")); 994 } 967 995 } 968 996 VBOXUSBFLT_LOCK_RELEASE(); … … 971 999 vboxUsbFltReplugList(&ReplugDevList); 972 1000 1001 LOG(("SUCCESS done context(0x%p)", pContext)); 973 1002 return STATUS_SUCCESS; 974 1003 } … … 976 1005 NTSTATUS VBoxUsbFltCreate(PVBOXUSBFLTCTX pContext) 977 1006 { 1007 LOG(("Creating context(0x%p)", pContext)); 978 1008 memset(pContext, 0, sizeof (*pContext)); 979 1009 pContext->Process = RTProcSelf(); … … 981 1011 InsertHeadList(&g_VBoxUsbFltGlobals.ContextList, &pContext->ListEntry); 982 1012 VBOXUSBFLT_LOCK_RELEASE(); 1013 LOG(("SUCCESS context(0x%p)", pContext)); 983 1014 return STATUS_SUCCESS; 984 1015 } … … 986 1017 int VBoxUsbFltAdd(PVBOXUSBFLTCTX pContext, PUSBFILTER pFilter, uintptr_t *pId) 987 1018 { 1019 LOG(("adding filter, Context (0x%p)..", pContext)); 988 1020 *pId = 0; 989 1021 /* LOG the filter details. */ … … 1034 1066 int VBoxUsbFltRemove(PVBOXUSBFLTCTX pContext, uintptr_t uId) 1035 1067 { 1068 LOG(("removing filter id(0x%p), Context (0x%p)..", pContext, uId)); 1036 1069 Assert(uId); 1037 1070 … … 1045 1078 } 1046 1079 1080 LOG(("enumerating devices..")); 1047 1081 for (PLIST_ENTRY pEntry = g_VBoxUsbFltGlobals.DeviceList.Flink; 1048 1082 pEntry != &g_VBoxUsbFltGlobals.DeviceList; … … 1062 1096 continue; 1063 1097 1098 LOG(("found device(0x%p), pdo(0x%p), state(%d), filter id(0x%p), oneshot(%d)", 1099 pDevice, pDevice->Pdo, pDevice->enmState, pDevice->uFltId, (int)pDevice->fIsFilterOneShot)); 1064 1100 ASSERT_WARN(!pDevice->fIsFilterOneShot, ("device(0x%p) is filtered with a oneshot filter", pDevice)); 1065 1101 pDevice->uFltId = 0; … … 1068 1104 } 1069 1105 VBOXUSBFLT_LOCK_RELEASE(); 1106 1107 LOG(("done enumerating devices")); 1070 1108 1071 1109 if (RT_SUCCESS(rc)) -
trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbMon.cpp
r38356 r38425 1339 1339 #endif 1340 1340 1341 LOG (("VBoxUSBMon::DriverEntry\n"));1341 LOGREL(("Built %s %s", __DATE__, __TIME__)); 1342 1342 1343 1343 memset (&g_VBoxUsbMonGlobals, 0, sizeof (g_VBoxUsbMonGlobals));
Note:
See TracChangeset
for help on using the changeset viewer.