Index: /trunk/src/VBox/Main/idl/apiwrap-server.xsl
===================================================================
--- /trunk/src/VBox/Main/idl/apiwrap-server.xsl	(revision 50750)
+++ /trunk/src/VBox/Main/idl/apiwrap-server.xsl	(revision 50751)
@@ -216,4 +216,5 @@
     <xsl:param name="type"/>
     <xsl:param name="dir"/>
+    <xsl:param name="mod"/>
 
     <!-- get C++ glue type from IDL type from table in typemap-shared.inc.xsl -->
@@ -250,4 +251,7 @@
         </xsl:otherwise>
     </xsl:choose>
+    <xsl:if test="$mod='ptr'">
+        <xsl:text> *</xsl:text>
+    </xsl:if>
 </xsl:template>
 
@@ -255,4 +259,5 @@
     <xsl:param name="type"/>
     <xsl:param name="dir"/>
+    <xsl:param name="mod"/>
     <xsl:param name="safearray"/>
 
@@ -298,4 +303,7 @@
         </xsl:otherwise>
     </xsl:choose>
+    <xsl:if test="$mod='ptr'">
+        <xsl:text> *</xsl:text>
+    </xsl:if>
 </xsl:template>
 
@@ -303,11 +311,12 @@
     <xsl:param name="type"/>
     <xsl:param name="dir"/>
+    <xsl:param name="mod"/>
     <xsl:param name="safearray"/>
-    <xsl:param name="mod"/>
+    <xsl:param name="isref"/>
 
     <!-- get C format string for IDL type from table in typemap-shared.inc.xsl -->
     <xsl:variable name="wrapfmt" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@gluefmt"/>
     <xsl:choose>
-        <xsl:when test="$mod='ref' and $dir!='in'">
+        <xsl:when test="$mod='ptr' or ($isref='yes' and $dir!='in')">
             <xsl:text>%p</xsl:text>
         </xsl:when>
@@ -335,4 +344,20 @@
 </xsl:template>
 
+<!-- - - - - - - - - - - - - - - - - - - - - - -
+  templates for handling entire interfaces and their contents
+ - - - - - - - - - - - - - - - - - - - - - - -->
+
+<xsl:template name="emitInterface">
+    <xsl:param name="iface"/>
+
+    <xsl:call-template name="emitHeader">
+        <xsl:with-param name="iface" select="$iface"/>
+    </xsl:call-template>
+
+    <xsl:call-template name="emitCode">
+        <xsl:with-param name="iface" select="$iface"/>
+    </xsl:call-template>
+</xsl:template>
+
 <xsl:template match="attribute/@type | param/@type" mode="public">
     <xsl:param name="dir"/>
@@ -342,4 +367,5 @@
             <xsl:with-param name="type" select="."/>
             <xsl:with-param name="dir" select="$dir"/>
+            <xsl:with-param name="mod" select="../@mod"/>
         </xsl:call-template>
     </xsl:variable>
@@ -389,4 +415,5 @@
             <xsl:with-param name="type" select="."/>
             <xsl:with-param name="dir" select="$dir"/>
+            <xsl:with-param name="mod" select="../@mod"/>
             <xsl:with-param name="safearray" select="../@safearray"/>
         </xsl:call-template>
@@ -447,7 +474,7 @@
 <xsl:template match="attribute/@type | param/@type" mode="logparamtext">
     <xsl:param name="dir"/>
-    <xsl:param name="mod"/>
-
-    <xsl:if test="$mod!='ref' and ($dir='out' or $dir='ret')">
+    <xsl:param name="isref"/>
+
+    <xsl:if test="$isref!='yes' and ($dir='out' or $dir='ret')">
         <xsl:text>*</xsl:text>
     </xsl:if>
@@ -460,6 +487,7 @@
         <xsl:with-param name="type" select="."/>
         <xsl:with-param name="dir" select="$dir"/>
+        <xsl:with-param name="mod" select="../@mod"/>
         <xsl:with-param name="safearray" select="../@safearray"/>
-        <xsl:with-param name="mod" select="$mod"/>
+        <xsl:with-param name="isref" select="$isref"/>
     </xsl:call-template>
 </xsl:template>
@@ -467,14 +495,14 @@
 <xsl:template match="attribute/@type | param/@type" mode="logparamval">
     <xsl:param name="dir"/>
-    <xsl:param name="mod"/>
-
-    <xsl:choose>
-        <xsl:when test="../@safearray='yes' and $mod!='ref'">
+    <xsl:param name="isref"/>
+
+    <xsl:choose>
+        <xsl:when test="../@safearray='yes' and $isref!='yes'">
             <xsl:text>ComSafeArraySize(</xsl:text>
-            <xsl:if test="$mod!='ref' and $dir!='in'">
+            <xsl:if test="$isref!='yes' and $dir!='in'">
                 <xsl:text>*</xsl:text>
             </xsl:if>
         </xsl:when>
-        <xsl:when test="$mod!='ref' and $dir!='in'">
+        <xsl:when test="$isref!='yes' and $dir!='in'">
             <xsl:text>*</xsl:text>
         </xsl:when>
@@ -485,5 +513,5 @@
     </xsl:call-template>
     <xsl:choose>
-        <xsl:when test="../@safearray='yes' and $mod!='ref'">
+        <xsl:when test="../@safearray='yes' and $isref!='yes'">
             <xsl:text>)</xsl:text>
         </xsl:when>
@@ -498,4 +526,5 @@
             <xsl:with-param name="type" select="."/>
             <xsl:with-param name="dir" select="$dir"/>
+            <xsl:with-param name="mod" select="../@mod"/>
         </xsl:call-template>
     </xsl:variable>
@@ -745,5 +774,5 @@
     <xsl:apply-templates select="@type" mode="logparamtext">
         <xsl:with-param name="dir" select="'out'"/>
-        <xsl:with-param name="mod" select="'ref'"/>
+        <xsl:with-param name="isref" select="'yes'"/>
     </xsl:apply-templates>
     <xsl:text>\n", this, </xsl:text>
@@ -751,5 +780,5 @@
     <xsl:apply-templates select="@type" mode="logparamval">
         <xsl:with-param name="dir" select="'out'"/>
-        <xsl:with-param name="mod" select="'ref'"/>
+        <xsl:with-param name="isref" select="'yes'"/>
     </xsl:apply-templates>
     <xsl:text>));
@@ -797,4 +826,5 @@
     <xsl:apply-templates select="@type" mode="logparamtext">
         <xsl:with-param name="dir" select="'out'"/>
+        <xsl:with-param name="isref" select="''"/>
     </xsl:apply-templates>
     <xsl:text> hrc=%Rhrc\n", this, </xsl:text>
@@ -802,4 +832,5 @@
     <xsl:apply-templates select="@type" mode="logparamval">
         <xsl:with-param name="dir" select="'out'"/>
+        <xsl:with-param name="isref" select="''"/>
     </xsl:apply-templates>
     <xsl:text>, hrc));
@@ -819,4 +850,5 @@
         <xsl:apply-templates select="@type" mode="logparamtext">
             <xsl:with-param name="dir" select="'in'"/>
+            <xsl:with-param name="isref" select="''"/>
         </xsl:apply-templates>
         <xsl:text>\n", this, </xsl:text>
@@ -824,4 +856,5 @@
         <xsl:apply-templates select="@type" mode="logparamval">
             <xsl:with-param name="dir" select="'in'"/>
+            <xsl:with-param name="isref" select="''"/>
         </xsl:apply-templates>
         <xsl:text>));
@@ -1021,5 +1054,5 @@
         <xsl:apply-templates select="@type" mode="logparamtext">
             <xsl:with-param name="dir" select="@dir"/>
-            <xsl:with-param name="mod" select="'ref'"/>
+            <xsl:with-param name="isref" select="'yes'"/>
         </xsl:apply-templates>
     </xsl:for-each>
@@ -1030,5 +1063,5 @@
         <xsl:apply-templates select="@type" mode="logparamval">
             <xsl:with-param name="dir" select="@dir"/>
-            <xsl:with-param name="mod" select="'ref'"/>
+            <xsl:with-param name="isref" select="'yes'"/>
         </xsl:apply-templates>
     </xsl:for-each>
@@ -1101,4 +1134,5 @@
             <xsl:apply-templates select="@type" mode="logparamtext">
                 <xsl:with-param name="dir" select="@dir"/>
+                <xsl:with-param name="isref" select="''"/>
             </xsl:apply-templates>
         </xsl:if>
@@ -1111,4 +1145,5 @@
             <xsl:apply-templates select="@type" mode="logparamval">
                 <xsl:with-param name="dir" select="@dir"/>
+                <xsl:with-param name="isref" select="''"/>
             </xsl:apply-templates>
         </xsl:if>
@@ -1346,14 +1381,10 @@
 
 <!-- - - - - - - - - - - - - - - - - - - - - - -
-  library match
+  interface match
  - - - - - - - - - - - - - - - - - - - - - - -->
 
 <xsl:template match="interface">
-    <xsl:if test="not(@supportsErrorInfo='no')">
-        <xsl:call-template name="emitHeader">
-            <xsl:with-param name="iface" select="."/>
-        </xsl:call-template>
-
-        <xsl:call-template name="emitCode">
+    <xsl:if test="not(@internal='yes') and not(@supportsErrorInfo='no')">
+        <xsl:call-template name="emitInterface">
             <xsl:with-param name="iface" select="."/>
         </xsl:call-template>
