Index: trunk/include/VBox/com/Guid.h
===================================================================
--- trunk/include/VBox/com/Guid.h	(revision 15048)
+++ trunk/include/VBox/com/Guid.h	(revision 15051)
@@ -119,5 +119,5 @@
     bool operator< (const GUID &guid) const { return ::RTUuidCompare (&uuid, (PRTUUID) &guid) < 0; }
 
-    /* to pass instances as GUIDPARAM parameters to interface methods */
+    /* to pass instances as IN_GUID parameters to interface methods */
     operator const GUID &() const { return *(GUID *) &uuid; }
 
@@ -133,5 +133,5 @@
 #if !defined (VBOX_WITH_XPCOM)
 
-    /* to assign instances to GUIDPARAMOUT parameters from within the
+    /* to assign instances to OUT_GUID parameters from within the
      *  interface method */
     const Guid &cloneTo (GUID *pguid) const
@@ -141,10 +141,10 @@
     }
 
-    /* to pass instances as GUIDPARAMOUT parameters to interface methods */
+    /* to pass instances as OUT_GUID parameters to interface methods */
     GUID *asOutParam() { return (GUID *) &uuid; }
 
 #else
 
-    /* to assign instances to GUIDPARAMOUT parameters from within the
+    /* to assign instances to OUT_GUID parameters from within the
      * interface method */
     const Guid &cloneTo (nsID **ppguid) const
@@ -171,10 +171,10 @@
     };
 
-    /* to pass instances as GUIDPARAMOUT parameters to interface methods */
+    /* to pass instances as OUT_GUID parameters to interface methods */
     GuidOutParam asOutParam() { return GuidOutParam (*this); }
 
 #endif
 
-    /* to directly test GUIDPARAM interface method's parameters */
+    /* to directly test IN_GUID interface method's parameters */
     static bool isEmpty (const GUID &guid)
     {
Index: trunk/include/VBox/com/VirtualBoxErrorInfo.h
===================================================================
--- trunk/include/VBox/com/VirtualBoxErrorInfo.h	(revision 15048)
+++ trunk/include/VBox/com/VirtualBoxErrorInfo.h	(revision 15051)
@@ -86,5 +86,5 @@
     // IVirtualBoxErrorInfo properties
     STDMETHOD(COMGETTER(ResultCode)) (HRESULT *aResultCode);
-    STDMETHOD(COMGETTER(InterfaceID)) (GUIDPARAMOUT aIID);
+    STDMETHOD(COMGETTER(InterfaceID)) (OUT_GUID aIID);
     STDMETHOD(COMGETTER(Component)) (BSTR *aComponent);
     STDMETHOD(COMGETTER(Text)) (BSTR *aText);
Index: trunk/include/VBox/com/array.h
===================================================================
--- trunk/include/VBox/com/array.h	(revision 15048)
+++ trunk/include/VBox/com/array.h	(revision 15051)
@@ -155,6 +155,6 @@
  *
  * Also note that in order to pass input BSTR array parameters declared
- * using the ComSafeArrayIn (INPTR BSTR, aParam) macro to the SafeArray<>
- * constructor using the ComSafeArrayInArg() macro, you should use INPTR BSTR
+ * using the ComSafeArrayIn (IN_BSTR, aParam) macro to the SafeArray<>
+ * constructor using the ComSafeArrayInArg() macro, you should use IN_BSTR
  * as the SafeArray<> template argument, not just BSTR.
  *
Index: trunk/include/VBox/com/defs.h
===================================================================
--- trunk/include/VBox/com/defs.h	(revision 15048)
+++ trunk/include/VBox/com/defs.h	(revision 15051)
@@ -91,6 +91,14 @@
 #define SUCCEEDED_WARNING(rc)   (SUCCEEDED (rc) && (rc) != S_OK)
 
-/** Input pointer argument prefix in the interface method declaration. */
-#define INPTR
+/** Immutable BSTR string */
+typedef const OLECHAR *CBSTR;
+
+/** Input BSTR argument the interface method declaration. */
+#define IN_BSTR BSTR
+
+/** Input GUID argument the interface method declaration. */
+#define IN_GUID GUID
+/** Output GUID argument the interface method declaration. */
+#define OUT_GUID GUID*
 
 /** Makes the name of the getter interface function (n must be capitalized). */
@@ -98,9 +106,4 @@
 /** Makes the name of the setter interface function (n must be capitalized). */
 #define COMSETTER(n)    put_##n
-
-/** Type for an input GUID parameter in the interface method declaration. */
-#define GUIDPARAM           GUID
-/** Type for an output GUID parameter in the interface method declaration. */
-#define GUIDPARAMOUT        GUID*
 
 /**
@@ -265,13 +268,26 @@
 #define ULONG64 PRUint64
 
-#define BSTR    PRUnichar *
-#define LPBSTR  BSTR *
+#define FALSE   PR_FALSE
+#define TRUE    PR_TRUE
+
 #define OLECHAR wchar_t
 
-#define FALSE PR_FALSE
-#define TRUE PR_TRUE
-
-/** Input pointer argument prefix in the interface method declaration. */
-#define INPTR const
+/* note: typedef to semantically match BSTR on Win32 */
+typedef PRUnichar *BSTR;
+typedef const PRUnichar *CBSTR;
+typedef BSTR *LPBSTR;
+
+/** Input BSTR argument the interface method declaration. */
+#define IN_BSTR CBSTR
+
+/**
+ * Type to define a raw GUID variable (for members use the com::Guid class
+ * instead).
+ */
+#define GUID        nsID
+/** Input GUID argument the interface method declaration. */
+#define IN_GUID     const nsID &
+/** Output GUID argument the interface method declaration. */
+#define OUT_GUID    nsID **
 
 /** Makes the name of the getter interface function (n must be capitalized). */
@@ -279,14 +295,4 @@
 /** Makes the name of the setter interface function (n must be capitalized). */
 #define COMSETTER(n)    Set##n
-
-/**
- * Type to define a raw GUID variable (for members use the com::Guid class
- * instead).
- */
-#define GUID                nsID
-/** Type for an input GUID parameter in the interface method declaration. */
-#define GUIDPARAM           nsID &
-/** Type for an output GUID parameter in the interface method declaration.  */
-#define GUIDPARAMOUT        nsID **
 
 /* safearray input parameter macros */
Index: trunk/include/VBox/com/string.h
===================================================================
--- trunk/include/VBox/com/string.h	(revision 15048)
+++ trunk/include/VBox/com/string.h	(revision 15051)
@@ -76,15 +76,18 @@
 
     typedef BSTR String;
-    typedef const BSTR ConstString;
+    typedef CBSTR ConstString;
 
     Bstr () : bstr (NULL) {}
 
     Bstr (const Bstr &that) : bstr (NULL) { raw_copy (bstr, that.bstr); }
-    Bstr (const BSTR that) : bstr (NULL) { raw_copy (bstr, that); }
+    Bstr (CBSTR that) : bstr (NULL) { raw_copy (bstr, that); }
+
+#if defined (VBOX_WITH_XPCOM)
     Bstr (const wchar_t *that) : bstr (NULL)
     {
         AssertCompile (sizeof (wchar_t) == sizeof (OLECHAR));
-        raw_copy (bstr, (const BSTR) that);
-    }
+        raw_copy (bstr, (CBSTR) that);
+    }
+#endif
 
     Bstr (const Utf8Str &that);
@@ -97,5 +100,5 @@
 
     Bstr &operator = (const Bstr &that) { safe_assign (that.bstr); return *this; }
-    Bstr &operator = (const BSTR that) { safe_assign (that); return *this; }
+    Bstr &operator = (CBSTR that) { safe_assign (that); return *this; }
 
     Bstr &operator = (const Utf8Str &that);
@@ -140,5 +143,10 @@
     }
 
-    int compare (const BSTR str) const
+    int compare (CBSTR str) const
+    {
+        return ::RTUtf16Cmp ((PRTUTF16) bstr, (PRTUTF16) str);
+    }
+
+    int compare (BSTR str) const
     {
         return ::RTUtf16Cmp ((PRTUTF16) bstr, (PRTUTF16) str);
@@ -147,25 +155,34 @@
     bool operator == (const Bstr &that) const { return !compare (that.bstr); }
     bool operator != (const Bstr &that) const { return !!compare (that.bstr); }
-    bool operator == (const BSTR that) const { return !compare (that); }
+    bool operator == (CBSTR that) const { return !compare (that); }
+    bool operator == (BSTR that) const { return !compare (that); }
+
+#if defined (VBOX_WITH_XPCOM)
     bool operator != (const wchar_t *that) const
     {
         AssertCompile (sizeof (wchar_t) == sizeof (OLECHAR));
-        return !!compare ((const BSTR) that);
+        return !!compare ((CBSTR) that);
     }
     bool operator == (const wchar_t *that) const
     {
         AssertCompile (sizeof (wchar_t) == sizeof (OLECHAR));
-        return !compare ((const BSTR) that);
-    }
-    bool operator != (const BSTR that) const { return !!compare (that); }
+        return !compare ((CBSTR) that);
+    }
+#endif
+
+    bool operator != (CBSTR that) const { return !!compare (that); }
+    bool operator != (BSTR that) const { return !!compare (that); }
     bool operator < (const Bstr &that) const { return compare (that.bstr) < 0; }
-    bool operator < (const BSTR that) const { return compare (that) < 0; }
+    bool operator < (CBSTR that) const { return compare (that) < 0; }
+    bool operator < (BSTR that) const { return compare (that) < 0; }
+#if defined (VBOX_WITH_XPCOM)
     bool operator < (const wchar_t *that) const
     {
         AssertCompile (sizeof (wchar_t) == sizeof (OLECHAR));
-        return compare ((const BSTR) that) < 0;
-    }
-
-    int compareIgnoreCase (const BSTR str) const
+        return compare ((CBSTR) that) < 0;
+    }
+#endif
+
+    int compareIgnoreCase (CBSTR str) const
     {
         return ::RTUtf16LocaleICmp (bstr, str);
@@ -179,10 +196,19 @@
     size_t length() const { return isNull() ? 0 : ::RTUtf16Len ((PRTUTF16) bstr); }
 
-    /** Intended to to pass instances as |BSTR| input parameters to methods. */
-    operator const BSTR () const { return bstr; }
-
-    /** The same as operator const BSTR(), but for situations where the compiler
-        cannot typecast implicitly (for example, in printf() argument list). */
-    const BSTR raw() const { return bstr; }
+    /** Intended to to pass instances as |CBSTR| input parameters to methods. */
+    operator CBSTR () const { return bstr; }
+
+    /**
+     * Intended to to pass instances as |BSTR| input parameters to methods.
+     * Note that we have to provide this mutable BSTR operator since in MS COM
+     * input BSTR parameters of interface methods are not const.
+     */
+    operator BSTR () { return bstr; }
+
+    /**
+     *  The same as operator CBSTR(), but for situations where the compiler
+     *  cannot typecast implicitly (for example, in printf() argument list).
+     */
+    CBSTR raw() const { return bstr; }
 
     /**
@@ -245,5 +271,5 @@
 protected:
 
-    void safe_assign (const BSTR str)
+    void safe_assign (CBSTR str)
     {
         if (bstr != str)
@@ -254,5 +280,5 @@
     }
 
-    inline static void raw_copy (BSTR &ls, const BSTR rs)
+    inline static void raw_copy (BSTR &ls, CBSTR rs)
     {
         if (rs)
@@ -277,6 +303,8 @@
 
 /* symmetric compare operators */
-inline bool operator== (const BSTR l, const Bstr &r) { return r.operator== (l); }
-inline bool operator!= (const BSTR l, const Bstr &r) { return r.operator!= (l); }
+inline bool operator== (CBSTR l, const Bstr &r) { return r.operator== (l); }
+inline bool operator!= (CBSTR l, const Bstr &r) { return r.operator!= (l); }
+inline bool operator== (BSTR l, const Bstr &r) { return r.operator== (l); }
+inline bool operator!= (BSTR l, const Bstr &r) { return r.operator!= (l); }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -309,5 +337,5 @@
 
     Utf8Str (const Bstr &that) : str (NULL) { raw_copy (str, that); }
-    Utf8Str (const BSTR that) : str (NULL) { raw_copy (str, that); }
+    Utf8Str (CBSTR that) : str (NULL) { raw_copy (str, that); }
 
     /** Shortcut that calls #alloc(aSize) right after object creation. */
@@ -325,5 +353,5 @@
         return *this;
     }
-    Utf8Str &operator = (const BSTR that)
+    Utf8Str &operator = (CBSTR that)
     {
         setNull();
@@ -500,5 +528,5 @@
     }
 
-    inline static void raw_copy (char *&ls, const BSTR rs)
+    inline static void raw_copy (char *&ls, CBSTR rs)
     {
         if (rs)
