Index: /trunk/src/VBox/Devices/Audio/DevHDA.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevHDA.cpp	(revision 81181)
+++ /trunk/src/VBox/Devices/Audio/DevHDA.cpp	(revision 81182)
@@ -1313,11 +1313,16 @@
         LogFunc(("[SD%RU8] Warning: Invalid stream tag %RU8 specified!\n", uSD, uTag));
 
-        int rc = hdaRegWriteU24(pDevIns, pThis, iReg, u32Value);
         DEVHDA_UNLOCK_BOTH(pDevIns, pThis, uSD);
-        return rc;
+        return VINF_SUCCESS; /* Always return success to the MMIO handler. */
     }
 
     PHDASTREAM pStream = hdaGetStreamFromSD(pThis, uSD);
-    AssertPtr(pStream);
+    if (!pStream)
+    {
+        ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried writing SDCTL (0x%x) to unhandled stream #%RU8\n", u32Value, uSD));
+
+        DEVHDA_UNLOCK_BOTH(pDevIns, pThis, uSD);
+        return VINF_SUCCESS; /* Always return success to the MMIO handler. */
+    }
 
     if (fInReset)
@@ -1487,10 +1492,7 @@
     if (!pStream)
     {
-        AssertMsgFailed(("[SD%RU8] Warning: Writing SDSTS on non-attached stream (0x%x)\n",
-                         HDA_SD_NUM_FROM_REG(pThis, STS, iReg), u32Value));
-
-        int rc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);
+        ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried writing SDSTS (0x%x) to unhandled stream #%RU8\n", u32Value, uSD));
         DEVHDA_UNLOCK_BOTH(pDevIns, pThis, uSD);
-        return rc;
+        return VINF_SUCCESS; /* Always return success to the MMIO handler. */
     }
 
@@ -1649,9 +1651,6 @@
     if (!pStream)
     {
-        AssertMsgFailed(("[SD%RU8] Warning: Changing FIFOW on non-attached stream (0x%x)\n", uSD, u32Value));
-
-        int rc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);
         DEVHDA_UNLOCK(pDevIns, pThis);
-        return rc;
+        return VINF_SUCCESS; /* Always return success to the MMIO handler. */
     }
 
@@ -1666,5 +1665,5 @@
             break;
         default:
-            ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried write unsupported FIFOW (0x%x) to stream #%RU8, defaulting to 32 bytes\n",
+            ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried writing unsupported FIFOW (0x%x) to stream #%RU8, defaulting to 32 bytes\n",
                                             u32Value, uSD));
             u32FIFOW = HDA_SDFIFOW_32B;
@@ -1696,6 +1695,5 @@
     if (hdaGetDirFromSD(uSD) != PDMAUDIODIR_OUT) /* FIFOS for output streams only. */
     {
-        LogRel(("HDA: Warning: Guest tried to write read-only FIFOS to input stream #%RU8, ignoring\n", uSD));
-
+        ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried writing read-only FIFOS to input stream #%RU8, ignoring\n", uSD));
         DEVHDA_UNLOCK(pDevIns, pThis);
         return VINF_SUCCESS;
@@ -1716,5 +1714,5 @@
 
         default:
-            ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried write unsupported FIFOS (0x%x) to stream #%RU8, defaulting to 192 bytes\n",
+            ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried writing unsupported FIFOS (0x%x) to stream #%RU8, defaulting to 192 bytes\n",
                                             u32Value, uSD));
             u32FIFOS = HDA_SDOFIFO_192B;
Index: /trunk/src/VBox/Devices/Audio/DevHDACommon.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevHDACommon.cpp	(revision 81181)
+++ /trunk/src/VBox/Devices/Audio/DevHDACommon.cpp	(revision 81182)
@@ -22,4 +22,6 @@
 #include <iprt/assert.h>
 #include <iprt/errcore.h>
+
+#include <VBox/AssertGuest.h>
 
 #define LOG_GROUP LOG_GROUP_DEV_HDA
@@ -259,5 +261,5 @@
     if (uSD >= HDA_MAX_STREAMS)
     {
-        AssertMsgFailed(("Invalid / non-handled SD%RU8\n", uSD));
+        ASSERT_GUEST_LOGREL_MSG_FAILED(("Stream #%RU8 is invalid\n", uSD));
         return NULL;
     }
Index: /trunk/src/VBox/Devices/Audio/HDACodec.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/HDACodec.cpp	(revision 81181)
+++ /trunk/src/VBox/Devices/Audio/HDACodec.cpp	(revision 81182)
@@ -24,4 +24,5 @@
 *********************************************************************************************************************************/
 #define LOG_GROUP LOG_GROUP_DEV_HDA_CODEC
+#include <VBox/AssertGuest.h>
 #include <VBox/vmm/pdmdev.h>
 #include <VBox/vmm/pdmaudioifs.h>
@@ -2368,4 +2369,7 @@
     LogFlowFunc(("[NID0x%02x] Setting to stream ID=%RU8, channel=%RU8\n",
                  CODEC_NID(cmd), uSD, uChannel));
+
+    ASSERT_GUEST_LOGREL_MSG_RETURN(uSD < HDA_MAX_STREAMS,
+                                   ("Setting stream ID #%RU8 is invalid\n", uSD), VERR_INVALID_PARAMETER);
 
     PDMAUDIODIR enmDir;
