Index: trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUSBMon.inf
===================================================================
--- trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUSBMon.inf	(revision 55081)
+++ trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUSBMon.inf	(revision 55473)
@@ -35,5 +35,5 @@
 
 [DefaultInstall.NT.Services]
-AddService = VBoxUSBMon, 0x00000002, VBoxUSBMon_Service_Inst
+AddService = VBoxUSBMon, 0x00000002, VBoxUSBMon_Service_Inst, VBoxUSBMon_EventLog_Inst
 
 [VBoxUSBMon_Service_Inst]
@@ -44,4 +44,11 @@
 ErrorControl   = 1                  ; SERVICE_ERROR_NORMAL
 ServiceBinary  = %12%\VBoxUSBMon.sys
+
+[VBoxUSBMon_EventLog_Inst]
+AddReg         = VBoxUSBMon_EventLog_AddReg
+
+[VBoxUSBMon_EventLog_AddReg]
+HKR,,EventMessageFile,0x00020000,"%%SystemRoot%%\System32\IoLogMsg.dll"
+HKR,,TypesSupported,0x00010001,7
 
 [SourceDisksNames]
Index: trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbMon.cpp
===================================================================
--- trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbMon.cpp	(revision 55081)
+++ trunk/src/VBox/HostDrivers/VBoxUSB/win/mon/VBoxUsbMon.cpp	(revision 55473)
@@ -68,5 +68,5 @@
 
 #ifdef VBOX_USB3PORT
-#define VBOXUSBMON_MAXDRIVERS 3
+#define VBOXUSBMON_MAXDRIVERS 5
 typedef struct VBOXUSB_PNPDRIVER
 {
@@ -1137,5 +1137,7 @@
 VBOX_PNPHOOKSTUB(1)
 VBOX_PNPHOOKSTUB(2)
-AssertCompile(VBOXUSBMON_MAXDRIVERS == 3);
+VBOX_PNPHOOKSTUB(3)
+VBOX_PNPHOOKSTUB(4)
+AssertCompile(VBOXUSBMON_MAXDRIVERS == 5);
 
 typedef struct VBOXUSBMONHOOKDRIVERWALKER
@@ -1143,4 +1145,46 @@
     PDRIVER_OBJECT pDrvObj;
 } VBOXUSBMONHOOKDRIVERWALKER, *PVBOXUSBMONHOOKDRIVERWALKER;
+
+/**
+ * Logs an error to the system event log.
+ *
+ * @param   ErrCode        Error to report to event log.
+ * @param   ReturnedStatus Error that was reported by the driver to the caller.
+ * @param   uErrId         Unique error id representing the location in the driver.
+ * @param   cbDumpData     Number of bytes at pDumpData.
+ * @param   pDumpData      Pointer to data that will be added to the message (see 'details' tab).
+ */
+static void vboxUsbMonLogError(NTSTATUS ErrCode, NTSTATUS ReturnedStatus, ULONG uErrId, USHORT cbDumpData, PVOID pDumpData)
+{
+    PIO_ERROR_LOG_PACKET pErrEntry;
+    
+
+    /* Truncate dumps that do not fit into IO_ERROR_LOG_PACKET. */
+    if (FIELD_OFFSET(IO_ERROR_LOG_PACKET, DumpData) + cbDumpData > ERROR_LOG_MAXIMUM_SIZE)
+        cbDumpData = ERROR_LOG_MAXIMUM_SIZE - FIELD_OFFSET(IO_ERROR_LOG_PACKET, DumpData);
+
+    pErrEntry = (PIO_ERROR_LOG_PACKET)IoAllocateErrorLogEntry(g_VBoxUsbMonGlobals.pDevObj,
+                                                              FIELD_OFFSET(IO_ERROR_LOG_PACKET, DumpData) + cbDumpData);
+    if (pErrEntry)
+    {
+        uint8_t *pDump = (uint8_t *)pErrEntry->DumpData;
+        if (cbDumpData)
+            memcpy(pDump, pDumpData, cbDumpData);
+        pErrEntry->MajorFunctionCode = 0;
+        pErrEntry->RetryCount = 0;
+        pErrEntry->DumpDataSize = cbDumpData;
+        pErrEntry->NumberOfStrings = 0;
+        pErrEntry->StringOffset = 0;
+        pErrEntry->ErrorCode = ErrCode;
+        pErrEntry->UniqueErrorValue = uErrId;
+        pErrEntry->FinalStatus = ReturnedStatus;
+        pErrEntry->IoControlCode = 0;
+        IoWriteErrorLogEntry(pErrEntry);
+    }
+    else
+    {
+        LOG(("Failed to allocate error log entry (cb=%d)\n", FIELD_OFFSET(IO_ERROR_LOG_PACKET, DumpData) + cbDumpData));
+    }
+}
 
 static DECLCALLBACK(BOOLEAN) vboxUsbMonHookDrvObjWalker(PFILE_OBJECT pFile, PDEVICE_OBJECT pTopDo, PDEVICE_OBJECT pHubDo, PVOID pvContext)
@@ -1181,4 +1225,14 @@
     /* No empty slots! No reason to continue. */
     LOG(("No empty slots!\n"));
+    ANSI_STRING ansiDrvName;
+    NTSTATUS Status = RtlUnicodeStringToAnsiString(&ansiDrvName, &pDrvObj->DriverName, true);
+    if (Status != STATUS_SUCCESS)
+    {
+        ansiDrvName.Length = 0;
+        LOG(("RtlUnicodeStringToAnsiString failed with 0x%x", Status));
+    }
+    vboxUsbMonLogError(IO_ERR_INSUFFICIENT_RESOURCES, STATUS_SUCCESS, 1, ansiDrvName.Length, ansiDrvName.Buffer);
+    if (Status == STATUS_SUCCESS)
+        RtlFreeAnsiString(&ansiDrvName);
     return FALSE;
 }
@@ -1860,5 +1914,7 @@
     VBOX_PNPHOOKSTUB_INIT(1);
     VBOX_PNPHOOKSTUB_INIT(2);
-    AssertCompile(VBOXUSBMON_MAXDRIVERS == 3);
+    VBOX_PNPHOOKSTUB_INIT(3);
+    VBOX_PNPHOOKSTUB_INIT(4);
+    AssertCompile(VBOXUSBMON_MAXDRIVERS == 5);
 #endif /* VBOX_USB3PORT */
     KeInitializeEvent(&g_VBoxUsbMonGlobals.OpenSynchEvent, SynchronizationEvent, TRUE /* signaled */);
