Index: trunk/src/VBox/Devices/Storage/DrvHostDVD.cpp
===================================================================
--- trunk/src/VBox/Devices/Storage/DrvHostDVD.cpp	(revision 64412)
+++ trunk/src/VBox/Devices/Storage/DrvHostDVD.cpp	(revision 64413)
@@ -116,12 +116,13 @@
 }
 
-static void drvHostDvdCmdOK(PDRVHOSTDVD pThis)
+static uint8_t drvHostDvdCmdOK(PDRVHOSTDVD pThis)
 {
     memset(pThis->abATAPISense, '\0', sizeof(pThis->abATAPISense));
     pThis->abATAPISense[0] = 0x70;
     pThis->abATAPISense[7] = 10;
-}
-
-static void drvHostDvdCmdError(PDRVHOSTDVD pThis, const uint8_t *pabATAPISense, size_t cbATAPISense)
+    return SCSI_STATUS_OK;
+}
+
+static uint8_t drvHostDvdCmdError(PDRVHOSTDVD pThis, const uint8_t *pabATAPISense, size_t cbATAPISense)
 {
     Log(("%s: sense=%#x (%s) asc=%#x ascq=%#x (%s)\n", __FUNCTION__, pabATAPISense[2] & 0x0f, SCSISenseText(pabATAPISense[2] & 0x0f),
@@ -129,9 +130,10 @@
     memset(pThis->abATAPISense, '\0', sizeof(pThis->abATAPISense));
     memcpy(pThis->abATAPISense, pabATAPISense, RT_MIN(cbATAPISense, sizeof(pThis->abATAPISense)));
+    return SCSI_STATUS_CHECK_CONDITION;
 }
 
 /** @todo deprecated function - doesn't provide enough info. Replace by direct
  * calls to drvHostDvdCmdError()  with full data. */
-static void drvHostDvdCmdErrorSimple(PDRVHOSTDVD pThis, uint8_t uATAPISenseKey, uint8_t uATAPIASC)
+static uint8_t drvHostDvdCmdErrorSimple(PDRVHOSTDVD pThis, uint8_t uATAPISenseKey, uint8_t uATAPIASC)
 {
     uint8_t abATAPISense[ATAPI_SENSE_SIZE];
@@ -141,5 +143,5 @@
     abATAPISense[7] = 10;
     abATAPISense[12] = uATAPIASC;
-    drvHostDvdCmdError(pThis, abATAPISense, sizeof(abATAPISense));
+    return drvHostDvdCmdError(pThis, abATAPISense, sizeof(abATAPISense));
 }
 
@@ -443,6 +445,5 @@
                 case 0x0f: /* activate deferred microcode */
                     LogRel(("HostDVD#%u: CD-ROM passthrough command attempted to update firmware, blocked\n", pThis->Core.pDrvIns->iInstance));
-                    drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_INV_FIELD_IN_CMD_PACKET);
-                    *pu8ScsiSts = SCSI_STATUS_CHECK_CONDITION;
+                    *pu8ScsiSts = drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_INV_FIELD_IN_CMD_PACKET);
                     break;
                 default:
@@ -464,11 +465,9 @@
              * opcode 0x01" in syslog) and replies with a sense code of 0,
              * which sends cdrecord to an endless loop. */
-            drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_ILLEGAL_OPCODE);
-            *pu8ScsiSts = SCSI_STATUS_CHECK_CONDITION;
+            *pu8ScsiSts = drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_ILLEGAL_OPCODE);
             break;
         default:
             LogRel(("HostDVD#%u: Passthrough unimplemented for command %#x\n", pThis->Core.pDrvIns->iInstance, pbCdb[0]));
-            drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_ILLEGAL_OPCODE);
-            *pu8ScsiSts = SCSI_STATUS_CHECK_CONDITION;
+            *pu8ScsiSts = drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_ILLEGAL_OPCODE);
             break;
     }
@@ -605,6 +604,5 @@
                     AssertMsgFailed(("Don't know how to split command %#04x\n", pbCdb[0]));
                     LogRelMax(10, ("HostDVD#%u: CD-ROM passthrough split error\n", pThis->Core.pDrvIns->iInstance));
-                    drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_ILLEGAL_OPCODE);
-                    *pu8ScsiSts = SCSI_STATUS_CHECK_CONDITION;
+                    *pu8ScsiSts = drvHostDvdCmdErrorSimple(pThis, SCSI_SENSE_ILLEGAL_REQUEST, SCSI_ASC_ILLEGAL_OPCODE);
                     rc = drvHostBaseBufferRelease(&pThis->Core, pReq, cbBuf, enmXferDir == PDMMEDIATXDIR_TO_DEVICE, pvBuf);
                     RTCritSectLeave(&pThis->Core.CritSect);
@@ -712,6 +710,5 @@
             }
 
-            drvHostDvdCmdOK(pThis);
-            *pu8ScsiSts = SCSI_STATUS_OK;
+            *pu8ScsiSts = drvHostDvdCmdOK(pThis);
         }
         else
@@ -730,5 +727,4 @@
                           pThis->abATAPISense[12], pThis->abATAPISense[13], rc));
             } while (0);
-            drvHostDvdCmdError(pThis, &pThis->abATAPISense[0], sizeof(pThis->abATAPISense));
             *pu8ScsiSts = SCSI_STATUS_CHECK_CONDITION;
             rc = VINF_SUCCESS;
