Index: /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp
===================================================================
--- /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp	(revision 59064)
+++ /trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp	(revision 59065)
@@ -68,4 +68,6 @@
 RT_C_DECLS_END
 
+#define LogError(x) DbgPrint x
+
 #if 0
 #undef Log
@@ -547,5 +549,5 @@
     else
     {
-        Log(("ERROR! vboxNetLwfWinOidRequest: NdisAllocateCloneOidRequest failed with 0x%x\n", Status));
+        LogError(("vboxNetLwfWinOidRequest: NdisAllocateCloneOidRequest failed with 0x%x\n", Status));
     }
     LogFlow(("<==vboxNetLwfWinOidRequest: Status=0x%x\n", Status));
@@ -610,10 +612,10 @@
     if (Status != NDIS_STATUS_SUCCESS)
     {
-        Log(("ERROR! vboxNetLwfWinGetPacketFilter: vboxNetLwfWinSyncOidRequest(query, OID_GEN_CURRENT_PACKET_FILTER) failed with 0x%x\n", Status));
+        LogError(("vboxNetLwfWinGetPacketFilter: vboxNetLwfWinSyncOidRequest(query, OID_GEN_CURRENT_PACKET_FILTER) failed with 0x%x\n", Status));
         return FALSE;
     }
     if (Rq.Request.DATA.QUERY_INFORMATION.BytesWritten != sizeof(pModuleCtx->uPacketFilter))
     {
-        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));
+        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));
     }
 
@@ -639,10 +641,10 @@
     if (Status != NDIS_STATUS_SUCCESS)
     {
-        Log(("ERROR! vboxNetLwfWinSetPacketFilter: vboxNetLwfWinSyncOidRequest(query, OID_GEN_CURRENT_PACKET_FILTER) failed with 0x%x\n", Status));
+        LogError(("vboxNetLwfWinSetPacketFilter: vboxNetLwfWinSyncOidRequest(query, OID_GEN_CURRENT_PACKET_FILTER) failed with 0x%x\n", Status));
         return Status;
     }
     if (Rq.Request.DATA.QUERY_INFORMATION.BytesWritten != sizeof(uFilter))
     {
-        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));
+        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));
         return NDIS_STATUS_FAILURE;
     }
@@ -675,5 +677,5 @@
     if (Status != NDIS_STATUS_SUCCESS)
     {
-        Log(("ERROR! vboxNetLwfWinSetPacketFilter: vboxNetLwfWinSyncOidRequest(set, OID_GEN_CURRENT_PACKET_FILTER, vvv below vvv) failed with 0x%x\n", Status));
+        LogError(("vboxNetLwfWinSetPacketFilter: vboxNetLwfWinSyncOidRequest(set, OID_GEN_CURRENT_PACKET_FILTER, vvv below vvv) failed with 0x%x\n", Status));
         vboxNetLwfWinDumpFilterTypes(uFilter);
     }
@@ -782,10 +784,10 @@
     if (rc != STATUS_SUCCESS)
     {
-        Log(("ERROR! vboxNetLwfWinAttach: RtlUnicodeStringToAnsiString(%ls) failed with 0x%x\n",
+        LogError(("vboxNetLwfWinAttach: RtlUnicodeStringToAnsiString(%ls) failed with 0x%x\n",
              pParameters->BaseMiniportName, rc));
         return NDIS_STATUS_FAILURE;
     }
     DbgPrint("vboxNetLwfWinAttach: friendly name=%wZ\n", pParameters->BaseMiniportInstanceName);
-    DbgPrint("vboxNetLwfWinAttach: name=%Z\n", strMiniportName);
+    DbgPrint("vboxNetLwfWinAttach: name=%Z\n", &strMiniportName);
 
     UINT cbModuleWithNameExtra = sizeof(VBOXNETLWF_MODULE) + strMiniportName.Length;
@@ -796,4 +798,5 @@
     if (!pModuleCtx)
     {
+        LogError(("vboxNetLwfWinAttach: Failed to allocate module context for %ls\n", pParameters->BaseMiniportName));
         RtlFreeAnsiString(&strMiniportName);
         return NDIS_STATUS_RESOURCES;
@@ -808,6 +811,6 @@
     if (!pModuleCtx->hWorkItem)
     {
-        Log(("ERROR! vboxNetLwfWinAttach: Failed to allocate work item for %ls\n",
-             pParameters->BaseMiniportName));
+        LogError(("vboxNetLwfWinAttach: Failed to allocate work item for %ls\n",
+                pParameters->BaseMiniportName));
         NdisFreeMemory(pModuleCtx, 0, 0);
         return NDIS_STATUS_RESOURCES;
@@ -848,5 +851,5 @@
     if (!pModuleCtx->hPool)
     {
-        Log(("ERROR! vboxNetLwfWinAttach: NdisAllocateNetBufferListPool failed\n"));
+        LogError(("vboxNetLwfWinAttach: NdisAllocateNetBufferListPool failed\n"));
         NdisFreeIoWorkItem(pModuleCtx->hWorkItem);
         NdisFreeMemory(pModuleCtx, 0, 0);
@@ -864,5 +867,5 @@
     if (Status != NDIS_STATUS_SUCCESS)
     {
-        Log(("ERROR! vboxNetLwfWinAttach: NdisFSetAttributes failed with 0x%x\n", Status));
+        LogError(("vboxNetLwfWinAttach: NdisFSetAttributes failed with 0x%x\n", Status));
         NdisFreeNetBufferListPool(pModuleCtx->hPool);
         Log4(("vboxNetLwfWinAttach: freed NBL+NB pool 0x%p\n", pModuleCtx->hPool));
@@ -1173,5 +1176,5 @@
     if (!pMdl)
     {
-        Log(("ERROR! vboxNetLwfWinSGtoNB: failed to allocate an MDL\n"));
+        LogError(("vboxNetLwfWinSGtoNB: failed to allocate an MDL\n"));
         LogFlow(("<==vboxNetLwfWinSGtoNB: return NULL\n"));
         return NULL;
@@ -1185,5 +1188,5 @@
         if (!pMdlCurr->Next)
         {
-            Log(("ERROR! vboxNetLwfWinSGtoNB: failed to allocate an MDL\n"));
+            LogError(("vboxNetLwfWinSGtoNB: failed to allocate an MDL\n"));
             /* Tear down all MDL we chained so far */
             vboxNetLwfWinFreeMdlChain(pMdl);
@@ -1207,5 +1210,5 @@
     else
     {
-        Log(("ERROR! vboxNetLwfWinSGtoNB: failed to allocate an NBL+NB\n"));
+        LogError(("vboxNetLwfWinSGtoNB: failed to allocate an NBL+NB\n"));
         vboxNetLwfWinFreeMdlChain(pMdl);
     }
@@ -1234,5 +1237,5 @@
         else
         {
-            Log(("ERROR! vboxNetLwfWinSGtoNB: failed to obtain the buffer pointer (size=%u)\n", pSG->cbTotal));
+            LogError(("vboxNetLwfWinSGtoNB: failed to obtain the buffer pointer (size=%u)\n", pSG->cbTotal));
             NdisAdvanceNetBufferDataStart(pBuffer, pSG->cbTotal, false, NULL); /** @todo why bother? */
             NdisFreeNetBufferList(pBufList);
@@ -1242,5 +1245,5 @@
     else
     {
-        Log(("ERROR! vboxNetLwfWinSGtoNB: NdisRetreatNetBufferDataStart failed with 0x%x (size=%u)\n", Status, pSG->cbTotal));
+        LogError(("vboxNetLwfWinSGtoNB: NdisRetreatNetBufferDataStart failed with 0x%x (size=%u)\n", Status, pSG->cbTotal));
         NdisFreeNetBufferList(pBufList);
         pBufList = NULL;
@@ -1779,5 +1782,5 @@
     else
     {
-        Log(("ERROR! vboxNetLwfWinRegister: failed to register filter driver, status=0x%x", Status));
+        LogError(("vboxNetLwfWinRegister: failed to register filter driver, status=0x%x", Status));
     }
     return Status;
@@ -1802,5 +1805,5 @@
         if (Status != STATUS_SUCCESS)
         {
-            LogRel(("NETLWF: IDC initialization failed (system thread creation, status=0x%x)\n", Status));
+            LogError(("vboxNetLwfWinStartInitIdcThread: IDC initialization failed (system thread creation, status=0x%x)\n", Status));
             /*
              * We failed to init IDC and there will be no second chance.
@@ -1937,5 +1940,5 @@
         case LwfIdcState_Stopping:
             /* Impossible, but another thread is alreading doing FiniIdc, bail out */
-            Log(("ERROR! vboxNetLwfWinTryFiniIdc: called in 'Stopping' state\n"));
+            LogError(("vboxNetLwfWinTryFiniIdc: called in 'Stopping' state\n"));
             rc = VERR_INVALID_STATE;
             break;
@@ -1952,5 +1955,5 @@
             else
             {
-                Log(("ERROR! vboxNetLwfWinTryFiniIdc: ObReferenceObjectByHandle(%p) failed with 0x%x\n",
+                LogError(("vboxNetLwfWinTryFiniIdc: ObReferenceObjectByHandle(%p) failed with 0x%x\n",
                      g_VBoxNetLwfGlobals.hInitIdcThread, Status));
             }
@@ -2095,5 +2098,5 @@
         if (Status != STATUS_SUCCESS)
         {
-            Log(("ERROR! vboxNetFltPortOsXmit: KeWaitForMultipleObjects() failed with 0x%x\n", Status));
+            LogError(("vboxNetFltPortOsXmit: KeWaitForMultipleObjects() failed with 0x%x\n", Status));
             if (Status == STATUS_TIMEOUT)
                 rc = VERR_TIMEOUT;
@@ -2277,5 +2280,5 @@
         }
         else
-            Log(("ERROR! vboxNetLwfWinRegisterIpAddrNotifier: GetUnicastIpAddressTable failed with %x\n", Status));
+            LogError(("vboxNetLwfWinRegisterIpAddrNotifier: GetUnicastIpAddressTable failed with %x\n", Status));
         /* Now we can register a callback function to keep track of address changes. */
         Status = NotifyUnicastIpAddressChange(AF_UNSPEC, vboxNetLwfWinIpAddrChangeCallback,
@@ -2284,5 +2287,5 @@
             Log(("vboxNetLwfWinRegisterIpAddrNotifier: notifier=%p\n", pThis->u.s.WinIf.hNotifier));
         else
-            Log(("ERROR! vboxNetLwfWinRegisterIpAddrNotifier: NotifyUnicastIpAddressChange failed with %x\n", Status));
+            LogError(("vboxNetLwfWinRegisterIpAddrNotifier: NotifyUnicastIpAddressChange failed with %x\n", Status));
     }
     else
