Index: trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp
===================================================================
--- trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp	(revision 41640)
+++ trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-win.cpp	(revision 41642)
@@ -843,5 +843,5 @@
     switch (uCmd)
     {
-        case VBOXGUEST_IOCTL_INTERNAL_SET_MOUSE_NOTIFY_CALLBACK:
+        case VBOXGUEST_IOCTL_SET_MOUSE_NOTIFY_CALLBACK:
         {
             PVOID pvBuf = pStack->Parameters.Others.Argument1;
Index: trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
===================================================================
--- trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp	(revision 41640)
+++ trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp	(revision 41642)
@@ -727,6 +727,6 @@
         pDevExt->acMouseFeatureUsage[i] = 0;
     pDevExt->fMouseStatus = 0;
-    pDevExt->MouseSetNotifyCallback.pfnNotify = NULL;
-    pDevExt->MouseSetNotifyCallback.pvNotify = NULL;
+    pDevExt->MouseNotifyCallback.pfnNotify = NULL;
+    pDevExt->MouseNotifyCallback.pvUser = NULL;
     pDevExt->cISR = 0;
 
@@ -1248,13 +1248,14 @@
 {
     Log(("VBoxGuestCommonIOCtl: SET_MOUSE_NOTIFY_CALLBACK\n"));
-    RTSpinlockAcquire(pDevExt->SessionSpinlock);
-    ASMAtomicWriteNullPtr(&pDevExt->MouseSetNotifyCallback.pfnNotify);
-    pDevExt->MouseSetNotifyCallback.pvNotify = pNotify->pvNotify;
-    ASMAtomicWritePtr(&pDevExt->MouseSetNotifyCallback.pfnNotify,
-                      pNotify->pfnNotify);
-    RTSpinlockReleaseNoInts(pDevExt->SessionSpinlock);
-    /* Make sure no one is referencing the old data - hacky but should be
+
+    RTSpinlockAcquire(pDevExt->EventSpinlock);
+    pDevExt->MouseNotifyCallback = *pNotify;
+    RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
+
+    /* Make sure an active ISR is referencing the old data - hacky but should be
      * effective. */
-    while (pDevExt->cISR > 0);
+    while (pDevExt->cISR > 0)
+        ASMNopPause();
+
     return VINF_SUCCESS;
 }
@@ -2540,8 +2541,7 @@
 
 #ifndef RT_OS_WINDOWS  /* Windows has its own implementation of this. */
-            case VBOXGUEST_IOCTL_INTERNAL_SET_MOUSE_NOTIFY_CALLBACK:
+            case VBOXGUEST_IOCTL_SET_MOUSE_NOTIFY_CALLBACK:
                 CHECKRET_RING0("SET_MOUSE_NOTIFY_CALLBACK");
-                CHECKRET_SIZE("SET_MOUSE_NOTIFY_CALLBACK",
-                           sizeof(VBoxGuestMouseSetNotifyCallback));
+                CHECKRET_SIZE("SET_MOUSE_NOTIFY_CALLBACK", sizeof(VBoxGuestMouseSetNotifyCallback));
                 rc = VBoxGuestCommonIOCtl_SetMouseNotifyCallback(pDevExt, (VBoxGuestMouseSetNotifyCallback *)pvData);
                 break;
@@ -2639,8 +2639,11 @@
 bool VBoxGuestCommonISR(PVBOXGUESTDEVEXT pDevExt)
 {
-    bool                    fMousePositionChanged = false;
-    VMMDevEvents volatile  *pReq                  = pDevExt->pIrqAckEvents;
-    int                     rc                    = 0;
-    bool                    fOurIrq;
+#ifndef RT_OS_WINDOWS
+    VBoxGuestMouseSetNotifyCallback MouseNotifyCallback   = { NULL, NULL };
+#endif
+    bool                            fMousePositionChanged = false;
+    VMMDevEvents volatile          *pReq                  = pDevExt->pIrqAckEvents;
+    int                             rc                    = 0;
+    bool                            fOurIrq;
 
     /*
@@ -2681,4 +2684,5 @@
             if (fEvents & VMMDEV_EVENT_MOUSE_POSITION_CHANGED)
             {
+                MouseNotifyCallback = pDevExt->MouseNotifyCallback;
                 fMousePositionChanged = true;
                 fEvents &= ~VMMDEV_EVENT_MOUSE_POSITION_CHANGED;
@@ -2760,6 +2764,6 @@
         VBoxGuestNativeISRMousePollEvent(pDevExt);
 #ifndef RT_OS_WINDOWS
-        if (pDevExt->MouseSetNotifyCallback.pfnNotify)
-            pDevExt->MouseSetNotifyCallback.pfnNotify(pDevExt->MouseSetNotifyCallback.pvNotify);
+        if (MouseNotifyCallback.pfnNotify)
+            MouseNotifyCallback.pfnNotify(MouseNotifyCallback.pvUser);
 #endif
     }
Index: trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h
===================================================================
--- trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h	(revision 41640)
+++ trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h	(revision 41642)
@@ -167,9 +167,9 @@
      * together inside the session spinlock. */
     uint32_t volatile           fMouseStatus;
-    /** Callback and user data for a kernel mouse handler. */
-    VBoxGuestMouseSetNotifyCallback volatile MouseSetNotifyCallback;
     /** Counter of number of active ISRs.  Currently used for safely removing
      * the mouse handler callback. */
     uint32_t volatile           cISR;
+    /** Callback and user data for a kernel mouse handler. */
+    VBoxGuestMouseSetNotifyCallback MouseNotifyCallback;
 
     /** Windows part. */
