Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 29544)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 29545)
@@ -55,15 +55,8 @@
 public:
 
-    UIMousePointerShapeChangeEvent(bool bIsVisible, bool bIsAlpha, uint uXHot, uint uYHot, uint uWidth, uint uHeight, ComSafeArrayIn(BYTE,pShape))
+    UIMousePointerShapeChangeEvent(bool bIsVisible, bool bIsAlpha, uint uXHot, uint uYHot, uint uWidth, uint uHeight, const QVector<uint8_t>& shape)
         : QEvent((QEvent::Type)UIConsoleEventType_MousePointerShapeChange)
-        , m_bIsVisible(bIsVisible), m_bIsAlpha(bIsAlpha), m_uXHot(uXHot), m_uYHot(uYHot), m_uWidth(uWidth), m_uHeight(uHeight)
-    {
-        com::SafeArray <BYTE> aShape(ComSafeArrayInArg (pShape));
-        size_t cbShapeSize = aShape.size();        
-        if (cbShapeSize > 0)
-        {
-            m_shape.resize(cbShapeSize);
-            ::memcpy(m_shape.raw(), aShape.raw(), cbShapeSize);
-        }
+        , m_bIsVisible(bIsVisible), m_bIsAlpha(bIsAlpha), m_uXHot(uXHot), m_uYHot(uYHot), m_uWidth(uWidth), m_uHeight(uHeight), m_shape(shape)
+    {
     }
 
@@ -78,5 +71,5 @@
     uint width() const { return m_uWidth; }
     uint height() const { return m_uHeight; }
-    const uchar *shapeData() const { return m_shape.size() > 0 ? m_shape.raw() : NULL; }
+    const uchar *shapeData() const { return m_shape.size() > 0 ? m_shape.data() : NULL; }
 
 private:
@@ -84,5 +77,5 @@
     bool m_bIsVisible, m_bIsAlpha;
     uint m_uXHot, m_uYHot, m_uWidth, m_uHeight;
-    com::SafeArray <uint8_t> m_shape;
+    QVector<uint8_t> m_shape;
 };
 
@@ -386,7 +379,11 @@
     VBOX_SCRIPTABLE_DISPATCH_IMPL(IConsoleCallback)
 
-    STDMETHOD(OnMousePointerShapeChange)(BOOL bIsVisible, BOOL bAlpha, ULONG uXHot, ULONG uYHot, ULONG uWidth, ULONG uHeight, ComSafeArrayIn(BYTE,pShape))
-    {
-        QApplication::postEvent(m_pEventHandler, new UIMousePointerShapeChangeEvent(bIsVisible, bAlpha, uXHot, uYHot, uWidth, uHeight, ComSafeArrayInArg(pShape)));
+    STDMETHOD(OnMousePointerShapeChange)(BOOL bIsVisible, BOOL bAlpha, ULONG uXHot, ULONG uYHot, ULONG uWidth, ULONG uHeight, ComSafeArrayIn(BYTE, pShape))
+    {
+        com::SafeArray<BYTE> aShape(ComSafeArrayInArg(pShape));
+        QVector<uint8_t> shapeVec(static_cast<int>(aShape.size()));
+        for (int i = 0; i < shapeVec.size(); ++i)
+            shapeVec[i] = aShape[i];
+        QApplication::postEvent(m_pEventHandler, new UIMousePointerShapeChangeEvent(bIsVisible, bAlpha, uXHot, uYHot, uWidth, uHeight, shapeVec));
         return S_OK;
     }
