Index: /trunk/src/VBox/VMM/VMMR3/GIMHv.cpp
===================================================================
--- /trunk/src/VBox/VMM/VMMR3/GIMHv.cpp	(revision 51978)
+++ /trunk/src/VBox/VMM/VMMR3/GIMHv.cpp	(revision 51979)
@@ -588,5 +588,5 @@
             rc = HMPatchHypercall(pVM, pRegion->pvPageR3, PAGE_SIZE, &cbWritten);
             if (   RT_SUCCESS(rc)
-                && cbWritten < PAGE_SIZE - 1)
+                && cbWritten < PAGE_SIZE)
             {
                 uint8_t *pbLast = (uint8_t *)pRegion->pvPageR3 + cbWritten;
@@ -597,5 +597,9 @@
             }
             else
+            {
+                if (rc == VINF_SUCCESS)
+                    rc = VERR_GIM_OPERATION_FAILED;
                 LogRelFunc(("HMPatchHypercall failed. rc=%Rrc cbWritten=%u\n", rc, cbWritten));
+            }
         }
         else
