VirtualBox

Changeset 66274 in vbox


Ignore:
Timestamp:
Mar 28, 2017 12:19:45 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114198
Message:

VBox/Main: ​bugref:3300: VBoxSVC from terminal server session is not 'visible' - added VBoxSDS implementation

Location:
trunk
Files:
1 added
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r66178 r66274  
    913913# the next line.
    914914VBOX_WITH_STRICT_LOCKS = 1
     915## VBoxSDS is the bridge windows service that sits between
     916# VirtualBox object client and VBoxSVC that fixes problem
     917# when multiple VBoxSVC starts for the same user
     918# it is enabled for windows build only
     919ifdef VBOX_WITH_SDS
     920 ifneq  ($(KBUILD_TARGET),win)
     921  VBOX_WITH_SDS =
     922 endif
     923endif
     924# disabled by default
     925VBOX_WITH_SDS = 
    915926
    916927
  • trunk/include/VBox/log.h

    r66140 r66274  
    638638    /** Main group, IVirtualBoxClient. */
    639639    LOG_GROUP_MAIN_VIRTUALBOXCLIENT,
     640    /** Main group, IVirtualBoxSDS. */
     641    LOG_GROUP_MAIN_VIRTUALBOXSDS,
    640642    /** Main group, IVirtualSystemDescription. */
    641643    LOG_GROUP_MAIN_VIRTUALSYSTEMDESCRIPTION,
     
    11041106    "MAIN_VIRTUALBOX", \
    11051107    "MAIN_VIRTUALBOXCLIENT", \
     1108    "MAIN_VIRTUALBOXSDS", \
    11061109    "MAIN_VIRTUALSYSTEMDESCRIPTION", \
    11071110    "MAIN_VRDESERVER", \
  • trunk/include/iprt/log.h

    r62896 r66274  
    16641664#endif
    16651665
     1666/** @def LogRelFlowThisFunc
     1667 * The same as LogRelFlowFunc but for class functions (methods): the resulting
     1668 * log line is additionally prepended with a hex value of |this| pointer.
     1669 */
     1670#ifdef LOG_USE_C99
     1671# define LogRelFlowThisFunc(a) \
     1672    _LogRelIt(RTLOGGRPFLAGS_FLOW, LOG_GROUP, "{%p} " LOG_FN_FMT ": %M", this, __PRETTY_FUNCTION__, _LogRemoveParentheseis a )
     1673#else
     1674# define LogRelFlowThisFunc(a) do { LogRelFlow(("{%p} " LOG_FN_FMT ": ", this, __PRETTY_FUNCTION__)); LogRelFlow(a); } while (0)
     1675#endif
     1676
     1677
     1678/** Shortcut to |LogRelFlowFunc ("ENTER\n")|, marks the beginnig of the function. */
     1679#define LogRelFlowFuncEnter()      LogRelFlowFunc(("ENTER\n"))
     1680
     1681/** Shortcut to |LogRelFlowFunc ("LEAVE\n")|, marks the end of the function. */
     1682#define LogRelFlowFuncLeave()      LogRelFlowFunc(("LEAVE\n"))
     1683
     1684/** Shortcut to |LogRelFlowFunc ("LEAVE: %Rrc\n")|, marks the end of the function. */
     1685#define LogRelFlowFuncLeaveRC(rc)  LogRelFlowFunc(("LEAVE: %Rrc\n", (rc)))
     1686
     1687/** Shortcut to |LogRelFlowThisFunc ("ENTER\n")|, marks the beginnig of the function. */
     1688#define LogRelFlowThisFuncEnter()  LogRelFlowThisFunc(("ENTER\n"))
     1689
     1690/** Shortcut to |LogRelFlowThisFunc ("LEAVE\n")|, marks the end of the function. */
     1691#define LogRelFlowThisFuncLeave()  LogRelFlowThisFunc(("LEAVE\n"))
     1692
    16661693/** @} */
    16671694
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r66183 r66274  
    144144        $(if $(VBOX_GUI_WITH_KEYS_RESET_HANDLER),VBOX_GUI_WITH_KEYS_RESET_HANDLER) \
    145145        $(if $(VBOX_GUI_WITH_CUSTOMIZATIONS1),VBOX_GUI_WITH_CUSTOMIZATIONS1) \
    146         $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE)
     146        $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE) \
     147    $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,)
    147148ifdef VBOX_WITH_DEBUGGER_GUI
    148149 VirtualBox_DEFS        += VBOX_WITH_DEBUGGER_GUI
     
    982983        $(call MSG_GENERATE,VirtualBox,$<,$@)
    983984        $(QUIET)$(RM) -f -- "$@" "$(PATH_TARGET)/VirtualBoxComWrapperFiles.dep"
    984         $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_VIRTUALBOX4_SRC)/src/globals/COMWrappers.xsl $<
     985        $(QUIET)$(VBOX_XSLTPROC) -o $@ \
     986                $(VBOX_VIRTUALBOX4_SRC)/src/globals/COMWrappers.xsl $<
    985987        $(QUIET)$(VBOX_FILESPLIT) $@ $(VirtualBox_0_OUTDIR)/include \
    986988                $(PATH_TARGET)/VirtualBoxComWrapperFiles.dep VirtualBox_VBOX_COMWRAPPERS
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/COMWrappers.xsl

    r64338 r66274  
    5656<xsl:template match="*"/>
    5757<xsl:template match="*|/" mode="declare"/>
     58<xsl:template match="*|/" mode="include"/>
    5859<xsl:template match="*|/" mode="define"/>
    5960<xsl:template match="*|/" mode="end"/>
     
    6970</xsl:template>
    7071
     72
     73<!--
     74 *  Encloses |if| element's contents (unconditionally expanded by
     75 *  <apply-templates mode="include"/>) with #ifdef / #endif.
     76 *
     77 *  @note this can produce an empty #if/#endif block if |if|'s children
     78 *  expand to nothing (such as |cpp|). I see no need to handle this situation
     79 *  specially.
     80-->
     81<xsl:template match="if" mode="include">
     82  <xsl:if test="(@target='xpidl') or (@target='midl')">
     83    <xsl:apply-templates select="." mode="begin"/>
     84    <xsl:apply-templates mode="include"/>
     85    <xsl:apply-templates select="." mode="end"/>
     86  </xsl:if>
     87</xsl:template>
    7188
    7289<!--
     
    149166
    150167    <!-- Declare interfaces: -->
    151     <xsl:apply-templates select="if | interface[not(@internal='yes')]" mode="declare"/>
     168    <xsl:apply-templates select="application/if | application/interface[not(@internal='yes')]" mode="declare"/>
    152169
    153170    <!-- Define interfaces: -->
     
    181198
    182199    <!-- Enumerate all enums: -->
    183     <xsl:for-each select="enum">
     200    <xsl:for-each select="application/enum">
    184201        <xsl:text>/* </xsl:text>
    185202        <xsl:value-of select="concat('K',@name)"/>
     
    203220    <!-- Declare enums to QMetaObject: -->
    204221    <xsl:text>/* Let QMetaType know about generated enums: */&#x0A;</xsl:text>
    205     <xsl:for-each select="enum">
     222    <xsl:for-each select="application/enum">
    206223        <xsl:text>Q_DECLARE_METATYPE(</xsl:text>
    207224        <xsl:value-of select="concat('K',@name)"/>
     
    249266
    250267    <!-- Enumerate all interface definitions: -->
    251     <xsl:for-each select="interface[not(@internal='yes')]">
    252         <xsl:text>#include "C</xsl:text>
    253         <xsl:value-of select="substring(@name,2)"/>
    254         <xsl:text>.h"&#x0A;</xsl:text>
    255     </xsl:for-each>
     268    <xsl:apply-templates select="application/if | application/interface[not(@internal='yes')]" mode="include"/>
    256269    <xsl:text>&#x0A;</xsl:text>
    257     <xsl:apply-templates select="if | interface[not(@internal='yes')]" mode="define"/>
     270    <xsl:apply-templates select="application/if | application/interface[not(@internal='yes')]" mode="define"/>
    258271
    259272    <!-- Finishing COMWrappers.cpp file: -->
     
    382395  <xsl:if test="$iface/@extends and $iface/@extends!='$unknown'">
    383396    <xsl:choose>
    384       <!-- interfaces within library/if -->
     397      <!-- interfaces within application/if -->
    385398      <xsl:when test="name(..)='if'">
    386399        <xsl:call-template name="declareAttributes">
     
    397410        </xsl:call-template>
    398411      </xsl:when>
    399       <!-- interfaces within library -->
     412      <!-- interfaces within application -->
    400413      <xsl:otherwise>
    401414        <xsl:call-template name="declareAttributes">
     
    424437  <xsl:if test="$iface/@extends and $iface/@extends!='$unknown'">
    425438    <xsl:choose>
    426       <!-- interfaces within library/if -->
     439      <!-- interfaces within application/if -->
    427440      <xsl:when test="name(..)='if'">
    428441        <xsl:call-template name="declareMethods">
     
    439452        </xsl:call-template>
    440453      </xsl:when>
    441       <!-- interfaces within library -->
     454      <!-- interfaces within application -->
    442455      <xsl:otherwise>
    443456        <xsl:call-template name="declareMethods">
     
    599612    </xsl:for-each>
    600613  </xsl:if>
    601   <!-- for definitions outside <if> (i.e. inside <library>) -->
     614  <!-- for definitions outside <if> (i.e. inside <application>) -->
    602615  <xsl:if test="name(..)!='if'">
    603616    <xsl:for-each select="
     
    646659
    647660<!--
     661 *  interface includes
     662-->
     663<xsl:template match="interface" mode="include">
     664
     665  <xsl:text>#include "C</xsl:text>
     666  <xsl:value-of select="substring(@name,2)"/>
     667  <xsl:text>.h"&#x0A;</xsl:text>
     668</xsl:template>
     669
     670
     671<!--
    648672 *  interface definitions
    649673-->
     
    740764  <xsl:if test="$iface/@extends and $iface/@extends!='$unknown'">
    741765    <xsl:choose>
    742       <!-- interfaces within library/if -->
     766      <!-- interfaces within application/if -->
    743767      <xsl:when test="name(..)='if'">
    744768        <xsl:call-template name="defineAttributes">
     
    755779        </xsl:call-template>
    756780      </xsl:when>
    757       <!-- interfaces within library -->
     781      <!-- interfaces within application -->
    758782      <xsl:otherwise>
    759783        <xsl:call-template name="defineAttributes">
     
    782806  <xsl:if test="$iface/@extends and $iface/@extends!='$unknown'">
    783807    <xsl:choose>
    784       <!-- interfaces within library/if -->
     808      <!-- interfaces within application/if -->
    785809      <xsl:when test="name(..)='if'">
    786810        <xsl:call-template name="defineMethods">
     
    797821        </xsl:call-template>
    798822      </xsl:when>
    799       <!-- interfaces within library -->
     823      <!-- interfaces within application -->
    800824      <xsl:otherwise>
    801825        <xsl:call-template name="defineMethods">
     
    13141338    ancestor-or-self::interface[1]/@supportsErrorInfo
    13151339  "/>
    1316   <xsl:variable name="librarySupportsErrorInfo" select="ancestor::library/@supportsErrorInfo"/>
     1340  <xsl:variable name="applicationSupportsErrorInfo" select="ancestor::application/@supportsErrorInfo"/>
    13171341
    13181342  <xsl:choose>
     
    13231347      </xsl:call-template>
    13241348    </xsl:when>
    1325     <xsl:when test="$librarySupportsErrorInfo">
     1349    <xsl:when test="$applicationSupportsErrorInfo">
    13261350      <xsl:call-template name="composeFetchErrorInfo">
    1327         <xsl:with-param name="supports" select="string($librarySupportsErrorInfo)"/>
     1351        <xsl:with-param name="supports" select="string($applicationSupportsErrorInfo)"/>
    13281352        <xsl:with-param name="mode" select="$mode"/>
    13291353      </xsl:call-template>
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp

    r66152 r66274  
    40764076        return;
    40774077    }
     4078   
     4079#ifdef VBOX_WITH_SDS
     4080    // setup Client COM Security to enable impersonation that required by VBOX_SDS
     4081    HRESULT hrGUICoInitializeSecurity = CoInitializeSecurity(NULL,
     4082        -1,
     4083        NULL,
     4084        NULL,
     4085        RPC_C_AUTHN_LEVEL_DEFAULT,
     4086        RPC_C_IMP_LEVEL_IMPERSONATE, //RPC_C_IMP_LEVEL_DELEGATE,//RPC_C_IMP_LEVEL_IMPERSONATE,
     4087        NULL,
     4088        EOAC_NONE,//EOAC_NONE,//EOAC_DYNAMIC_CLOAKING,//EOAC_STATIC_CLOAKING, 
     4089        NULL);
     4090    Assert(RPC_E_TOO_LATE != hrGUICoInitializeSecurity);
     4091    Assert(hrGUICoInitializeSecurity == S_OK);
     4092#endif
    40784093
    40794094    /* Make sure VirtualBoxClient instance created: */
  • trunk/src/VBox/Installer/win/Makefile.kmk

    r66037 r66274  
    580580                -E 'VBOX_WITH_VRDP=$(if-expr defined(VBOX_WITH_VRDP) && !defined(VBOX_WITH_EXTPACK_PUEL),yes,no)' \
    581581                -E 'VBOX_WITH_WEBSERVICES=$(if $(VBOX_WITH_WEBSERVICES),yes,no)' \
     582        -E 'VBOX_WITH_SDS=$(if $(VBOX_WITH_SDS),yes,no)' \
    582583                -E 'VBOX_WITH_UNATTENDED=$(if $(VBOX_WITH_UNATTENDED),yes,no)' \
    583584                -E 'BUILD_TYPE=$(KBUILD_TYPE)' \
     
    671672                -E 'VBOX_WITH_VRDP=$(if-expr defined(VBOX_WITH_VRDP) && !defined(VBOX_WITH_EXTPACK_PUEL),yes,no)' \
    672673                -E 'VBOX_WITH_WEBSERVICES=$(if $(VBOX_WITH_WEBSERVICES),yes,no)' \
     674        -E 'VBOX_WITH_SDS=$(if $(VBOX_WITH_SDS),yes,no)' \
    673675                -E 'VBOX_WITH_UNATTENDED=$(if $(VBOX_WITH_UNATTENDED),yes,no)' \
    674676                -E 'BUILD_TYPE=$(KBUILD_TYPE)' \
     
    700702                | $$(dir $$@)
    701703        $(VBOX_XSLTPROC) \
    702                 $(if-expr defined(VBOX_WITH_MIDL_PROXY_STUB),--stringparam "a_sProxyStubClsid" '$(VBOX_MIDL_PROXY_CLSID)',) \
     704                $(if-expr defined(VBOX_WITH_MIDL_PROXY_STUB),--stringparam "a_sProxyStubClsid" "$(VBOX_MIDL_PROXY_CLSID)",) \
     705        $(if-expr defined(VBOX_WITH_SDS),--stringparam "a_sWithSDS" "yes",) \
    703706                -o $@ $< $(VBOX_XIDL_FILE)
    704707
     
    708711                | $$(dir $$@)
    709712        $(VBOX_XSLTPROC) --stringparam "a_sTarget" "VBoxClient-x86" \
    710                 $(if-expr defined(VBOX_WITH_MIDL_PROXY_STUB),--stringparam "a_sProxyStubClsid" '$(VBOX_MIDL_PROXY_CLSID)',) \
    711                 -o $@ $< $(VBOX_XIDL_FILE)
     713                $(if-expr defined(VBOX_WITH_MIDL_PROXY_STUB),--stringparam "a_sProxyStubClsid" "$(VBOX_MIDL_PROXY_CLSID)",) \
     714        $(if-expr defined(VBOX_WITH_SDS),--stringparam "a_sWithSDS" "yes",) \
     715                -o $@ $< $(VBOX_XIDL_FILE)
    712716
    713717#
  • trunk/src/VBox/Installer/win/VBoxMergeApp.wxi

    r65996 r66274  
    8282        <?include $(env.PATH_TARGET)\VirtualBox_TypeLib.wxi ?>
    8383<?endif?>
     84       
     85 <?if $(env.VBOX_WITH_SDS) = "yes" ?>
     86        <File Id="VBoxSDS" Name="VBoxSDS.exe"
     87              Source="$(env.PATH_OUT)\bin\VBoxSDS.exe">
     88        </File>
     89 <?endif?>
    8490    </Component>
    8591
  • trunk/src/VBox/Installer/win/VirtualBox_TypeLib.xsl

    r64339 r66274  
    2828
    2929<xsl:param name="a_sTarget">all</xsl:param>
     30<xsl:param name="a_sWithSDS">no</xsl:param>
    3031
    3132
     
    6667      <xsl:attribute name="MinorVersion"><xsl:value-of select="substring(@version,3)"/></xsl:attribute>
    6768      <xsl:attribute name="Language">0</xsl:attribute>
    68       <xsl:attribute name="Description"><xsl:value-of select="@desc"/></xsl:attribute>
     69      <xsl:attribute name="Description"><xsl:value-of select="@name"/></xsl:attribute>
    6970      <xsl:attribute name="HelpDirectory"><xsl:text>msm_VBoxApplicationFolder</xsl:text></xsl:attribute>
    70       <AppId>
    71         <xsl:attribute name="Id"><xsl:value-of select="@appUuid"/></xsl:attribute>
    72         <xsl:attribute name="Description"><xsl:value-of select="@name"/> Application</xsl:attribute>
    73         <xsl:choose>
    74           <xsl:when test="$a_sTarget = 'VBoxClient-x86'">
    75             <xsl:apply-templates select="module[@name='VBoxC']/class"/>
    76           </xsl:when>
    77           <xsl:otherwise>
    78             <xsl:apply-templates select="module/class"/>
    79           </xsl:otherwise>
    80         </xsl:choose>
    81       </AppId>
     71      <xsl:apply-templates select="application"/>
    8272    </TypeLib>
    8373  </Include>
    8474</xsl:template>
    8575
     76
     77    <!--
     78* filters to skip VBoxSDS class and interfaces if a VBOX_WITH_SDS is not defined in kmk
     79-->
     80    <xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']">
     81        <xsl:if test="a_sWithSDS='yes'" >
     82            <xsl:call-template name="application_template" />
     83        </xsl:if>
     84    </xsl:template>
     85   
     86    <!--
     87    * applications
     88    -->
     89    <xsl:template match="idl/library//application" name="application_template">
     90        <AppId>
     91            <xsl:attribute name="Id">
     92                <xsl:value-of select="@uuid"/>
     93            </xsl:attribute>
     94            <xsl:attribute name="Description">
     95                <xsl:value-of select="@name"/> Application
     96            </xsl:attribute>
     97            <xsl:choose>
     98                <xsl:when test="$a_sTarget = 'VBoxClient-x86'">
     99                    <xsl:apply-templates select="module[@name='VBoxC']/class"/>
     100                </xsl:when>
     101                <xsl:otherwise>
     102                    <xsl:apply-templates select="module/class"/>
     103                </xsl:otherwise>
     104            </xsl:choose>
     105        </AppId>
     106    </xsl:template>
     107   
    86108
    87109<!--
     
    143165</xsl:template>
    144166
    145 
    146167<!--
    147168 *  eat everything else not explicitly matched
  • trunk/src/VBox/Installer/win/VirtualBox_TypeLibWithInterfaces.xsl

    r64339 r66274  
    6363<xsl:key name="G_keyInterfacesByName" match="//interface[@name]" use="@name"/>
    6464
     65<!--
     66* filters to skip VBoxSDS class and interfaces if a VBOX_WITH_SDS is not defined in kmk
     67-->
     68    <xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']">
     69        <xsl:if test="a_sWithSDS='yes'" >
     70            <xsl:call-template name="application_template" />
     71        </xsl:if>
     72    </xsl:template>
    6573
    6674<!--
     
    7583      <xsl:attribute name="MinorVersion"><xsl:value-of select="substring(@version,3)"/></xsl:attribute>
    7684      <xsl:attribute name="Language">0</xsl:attribute>
    77       <xsl:attribute name="Description"><xsl:value-of select="@desc"/></xsl:attribute>
     85      <xsl:attribute name="Description"><xsl:value-of select="@name"/></xsl:attribute>
    7886      <xsl:attribute name="HelpDirectory"><xsl:text>msm_VBoxApplicationFolder</xsl:text></xsl:attribute>
    79       <AppId>
    80         <xsl:attribute name="Id"><xsl:value-of select="@appUuid"/></xsl:attribute>
    81         <xsl:attribute name="Description"><xsl:value-of select="@name"/> Application</xsl:attribute>
    82         <xsl:choose>
    83           <xsl:when test="$a_sTarget = 'VBoxClient-x86'">
    84             <xsl:apply-templates select="module[@name='VBoxC']/class"/>
    85           </xsl:when>
    86           <xsl:otherwise>
    87             <xsl:apply-templates select="module/class"/>
    88           </xsl:otherwise>
    89         </xsl:choose>
    90       </AppId>
    91       <xsl:apply-templates select="interface | if/interface">
    92         <xsl:sort select="translate(@uuid,'abcdef','ABCDEF')"/>
    93       </xsl:apply-templates>
     87        <xsl:apply-templates select="application" />
    9488    </TypeLib>
    9589  </Include>
    9690</xsl:template>
    9791
     92<!--
     93Applications.
     94-->
     95<xsl:template match="application">
     96    <AppId>
     97        <xsl:attribute name="Id">
     98            <xsl:value-of select="@uuid"/>
     99        </xsl:attribute>
     100        <xsl:attribute name="Description">
     101            <xsl:value-of select="@name"/> Application
     102        </xsl:attribute>
     103        <xsl:choose>
     104            <xsl:when test="$a_sTarget = 'VBoxClient-x86'">
     105                <xsl:apply-templates select="module[@name='VBoxC']/class"/>
     106            </xsl:when>
     107            <xsl:otherwise>
     108                <xsl:apply-templates select="module/class"/>
     109            </xsl:otherwise>
     110        </xsl:choose>
     111    </AppId>
     112    <xsl:apply-templates select="interface | if/interface">
     113        <xsl:sort select="translate(@uuid,'abcdef','ABCDEF')"/>
     114    </xsl:apply-templates>
     115</xsl:template>
    98116
    99117<!--
     
    114132        <xsl:when test="../@context='InprocServer'">InprocServer32</xsl:when>
    115133        <xsl:when test="../@context='LocalServer'">LocalServer32</xsl:when>
     134          <xsl:when test="../@context='LocalService'">LocalServer32</xsl:when>
    116135        <xsl:otherwise>
    117136          <xsl:message terminate="yes">
     
    160179</xsl:template>
    161180
    162 
     181 
    163182<!--
    164183  Interfaces.
    165184-->
    166 <xsl:template match="library/interface | library/if[@target='midl']/interface">
     185<xsl:template match="library/application/interface | library/application/if[@target='midl']/interface">
    167186  <Interface>
    168187<!-- Interface Id="{00C8F974-92C5-44A1-8F3F-702469FDD04B}" Name="IDHCPServer" ProxyStubClassId32="{0BB3B78C-1807-4249-5BA5-EA42D66AF0BF}" NumMethods="33" -->
     
    178197</xsl:template>
    179198
     199   
    180200
    181201<!--
  • trunk/src/VBox/Main/Makefile.kmk

    r65381 r66274  
    7575        $(if $(VBOX_WITH_HOSTNETIF_API),VBOX_WITH_HOSTNETIF_API,) \
    7676        $(if $(VBOX_WITH_MIDL_PROXY_STUB),VBOX_WITH_MIDL_PROXY_STUB,) \
     77    $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,) \
    7778
    7879# Unconditionally enable the new semaphore key generation code
     
    126127        $(VBOX_PATH_SDK)/bindings/xpcom/idl \
    127128        $(VBOX_PATH_SDK)/bindings/xpcom/include
     129 # switch off VBoxSDS in XPCOM 
     130 override VBOX_WITH_SDS =
    128131endif # xpcom
    129132
     
    265268testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
    266269
     270
     271#
     272# VBoxSDS executable
     273#
     274if defined(VBOX_WITH_SDS) && "$(KBUILD_TARGET)" == "win"
     275PROGRAMS += VBoxSDS
     276VBoxSDS_TEMPLATE = VBOXMAINEXE
     277VBoxSDS_DEFS = \
     278VBoxSDS_DEFS.win += VBOX_COM_OUTOFPROC_MODULE
     279VBoxSDS_DEFS.win += _WIN32_WINNT=0x0510
     280VBoxSDS_INCS = \
     281        include \
     282        $(VBoxSDS_0_OUTDIR) \
     283        $(VBOX_MAIN_APIWRAPPER_INCS)
     284VBoxSDS_INCS.win = \
     285        $(VBoxCOM_0_OUTDIR)
     286VBoxSDS_LIBS += \
     287        $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB)
     288VBoxSDS_INTERMEDIATES = \
     289        $(VBOX_MAIN_PREREQS) \
     290        $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
     291VBoxSDS_SOURCES = \
     292        src-all/Global.cpp \
     293        src-all/AutoCaller.cpp \
     294        src-all/VirtualBoxBase.cpp \
     295        src-all/VirtualBoxErrorInfoImpl.cpp \
     296        src-global/VirtualBoxSDSImpl.cpp
     297VBoxSDS_SOURCES.win = \
     298        src-global/win/VBoxSDS.cpp \
     299        src-global/win/VBoxSDS.rc
     300
     301src-global/win/VBoxSDS.rc_INCS  = $(VBoxSDS_0_OUTDIR)
     302src-global/win/VBoxSDS.rc_DEPS  = $(VBoxSDS_0_OUTDIR)/VBoxSDS.rgs $(VBoxSDS_0_OUTDIR)/VBoxSDS-icon.rc
     303src-global/win/VBoxSDS.rc_CLEAN = $(VBoxSDS_0_OUTDIR)/VBoxSDS.rgs $(VBoxSDS_0_OUTDIR)/VBoxSDS-icon.rc
     304
     305$$(VBoxSDS_0_OUTDIR)/VBoxSDS-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$(@D))
     306        $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
     307
     308$$(VBoxSDS_0_OUTDIR)/VBoxSDS.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$(@D))
     309        $(VBOX_XSLTPROC) --stringparam Application "VirtualBox System" --stringparam Module VBoxSDS -o $@ $< $(VBOX_XIDL_FILE)
     310
     311endif #if defined(VBOX_WITH_SDS) && "$(KBUILD_TARGET)" == "win"
    267312
    268313#
     
    563608src-server/win/VBoxSVC.rc_CLEAN += $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs
    564609$$(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$(@D))
    565         $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $< $(VBOX_XIDL_FILE)
     610        $(VBOX_XSLTPROC) --stringparam Application VirtualBox --stringparam Module VBoxSVC -o $@ $< $(VBOX_XIDL_FILE)
    566611endif
    567612
     
    689734        $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK,) \
    690735        $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH,) \
    691         $(if $(VBOX_WITH_VRDEAUTH_IN_VBOXSVC),VBOX_WITH_VRDEAUTH_IN_VBOXSVC,)
     736        $(if $(VBOX_WITH_VRDEAUTH_IN_VBOXSVC),VBOX_WITH_VRDEAUTH_IN_VBOXSVC,) \
     737    $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,)
    692738ifdef VBOX_WITH_CRHGSMI
    693739 VBoxC_DEFS += VBOX_WITH_CRHGSMI
     
    895941
    896942$$(VBoxC_0_OUTDIR)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
    897         $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
     943        $(VBOX_XSLTPROC) --stringparam Application VirtualBox --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
    898944
    899945ifdef VBOX_WITH_32_ON_64_MAIN_API
     
    953999                $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
    9541000                $(VBOX_XIDL_FILE) | $$(dir $$@)
    955         $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
     1001        $(VBOX_XSLTPROC) --stringparam Application VirtualBox --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
    9561002
    9571003endif
     
    11001146 DLLS += VBoxProxyStub
    11011147 VBoxProxyStub_TEMPLATE = VBOXMAINCOMP
    1102  VBoxProxyStub_DEFS     = REGISTER_PROXY_DLL PROXY_CLSID_IS="$(VBOX_MIDL_PROXY_CLSID_IS)"
     1148 VBoxProxyStub_DEFS     = REGISTER_PROXY_DLL PROXY_CLSID_IS="$(VBOX_MIDL_PROXY_CLSID_IS)" \
     1149     $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,)
    11031150 VBoxProxyStub_DEFS.win.x86 = WIN32
    11041151 VBoxProxyStub_SDKS     = VBOX_NTDLL
     
    11731220$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
    11741221        $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
    1175         $(QUIET)$(VBOX_XSLTPROC) -o $@ $(if $(VBOX_WITH_MIDL_PROXY_STUB),-stringparam g_fGenProxy yes,) $< $(VBOX_XIDL_FILE)
     1222        $(QUIET)$(VBOX_XSLTPROC) -o $@ \
     1223     $(if $(VBOX_WITH_MIDL_PROXY_STUB),-stringparam g_fGenProxy yes,) \
     1224     $(if $(VBOX_WITH_SDS),-stringparam g_fVBoxWithSDS yes,) \
     1225     $< $(VBOX_XIDL_FILE)
    11761226
    11771227# Aliases for testing purposes.
     
    13711421        $(QUIET)$(MKDIR) -p $(@D)
    13721422        $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
     1423        $(if $(VBOX_WITH_SDS),-stringparam g_fVBoxWithSDS yes,) \
    13731424                -o $@ $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server-filelist.xsl $<
    13741425        $(QUIET)$(CP) --changed -fv $@ $(VBoxAPIWrap_VBOX_KMK_FILE)
  • trunk/src/VBox/Main/cbinding/capiidl.xsl

    r62770 r66274  
    16071607 *  libraries
    16081608-->
    1609 <xsl:template match="library">
     1609<xsl:template match="idl/library">
    16101610  <!-- result codes -->
    16111611  <xsl:call-template name="xsltprocNewlineOutputHack"/>
    1612   <xsl:for-each select="result">
     1612  <xsl:for-each select="application/result">
    16131613    <xsl:apply-templates select="."/>
    16141614  </xsl:for-each>
     
    16161616  <xsl:call-template name="xsltprocNewlineOutputHack"/>
    16171617  <!-- forward declarations -->
    1618   <xsl:apply-templates select="interface | if/interface" mode="forward"/>
     1618  <xsl:apply-templates select="application/interface | application/if/interface" mode="forward"/>
    16191619  <xsl:call-template name="xsltprocNewlineOutputHack"/>
    16201620  <!-- typedef'ing the struct declarations -->
    1621   <xsl:apply-templates select="interface | if/interface" mode="typedef"/>
     1621  <xsl:apply-templates select="application/interface | application/if/interface" mode="typedef"/>
    16221622  <xsl:call-template name="xsltprocNewlineOutputHack"/>
    16231623  <!-- all enums go first -->
    1624   <xsl:apply-templates select="enum | if/enum"/>
    1625   <!-- everything else but result codes and enums -->
     1624  <xsl:apply-templates select="application/enum | application/if/enum"/>
     1625  <!-- everything else but result codes and enums
    16261626  <xsl:apply-templates select="*[not(self::result or self::enum) and
    1627                                  not(self::if[result] or self::if[enum])]"/>
     1627                                 not(self::if[result] or self::if[enum])]"/> -->
     1628    <!-- the modules (i.e. everything else) -->
     1629  <xsl:apply-templates select="application/interface | application/if[interface]
     1630                                   | application/module | application/if[module]"/>
    16281631  <!-- -->
    16291632</xsl:template>
     
    24552458
    24562459  <xsl:choose>
    2457     <!-- modifiers (ignored for 'enumeration' attributes)-->
     2460    <!-- modifiers -->
    24582461    <xsl:when test="name(current())='type' and ../@mod">
    24592462      <xsl:choose>
     
    25572560            <!-- enum types -->
    25582561            <xsl:when test="
    2559               (ancestor::library/enum[@name=current()]) or
    2560               (ancestor::library/if[@target=$self_target]/enum[@name=current()])
     2562              (ancestor::library/application/enum[@name=current()]) or
     2563              (ancestor::library/application/if[@target=$self_target]/enum[@name=current()])
    25612564            ">
    25622565              <xsl:text>PRUint32</xsl:text>
     
    25642567            <!-- custom interface types -->
    25652568            <xsl:when test="
    2566               (name(current())='enumerator' and
    2567                ((ancestor::library/enumerator[@name=current()]) or
    2568                 (ancestor::library/if[@target=$self_target]/enumerator[@name=current()]))
    2569               ) or
    2570               ((ancestor::library/interface[@name=current()]) or
    2571                (ancestor::library/if[@target=$self_target]/interface[@name=current()])
    2572               )
     2569              (ancestor::library/application/interface[@name=current()]) or
     2570              (ancestor::library/application/if[@target=$self_target]/interface[@name=current()])
    25732571            ">
    25742572              <xsl:value-of select="."/>
     
    25932591
    25942592  <xsl:choose>
    2595     <!-- modifiers (ignored for 'enumeration' attributes)-->
     2593    <!-- modifiers -->
    25962594    <xsl:when test="name(current())='type' and ../@mod">
    25972595      <xsl:choose>
     
    26832681            <!-- enum types -->
    26842682            <xsl:when test="
    2685               (ancestor::library/enum[@name=current()]) or
    2686               (ancestor::library/if[@target=$self_target]/enum[@name=current()])
     2683              (ancestor::library/application/enum[@name=current()]) or
     2684              (ancestor::library/application/if[@target=$self_target]/enum[@name=current()])
    26872685            ">
    26882686              <xsl:text>PRUint32</xsl:text>
     
    26902688            <!-- custom interface types -->
    26912689            <xsl:when test="
    2692               (name(current())='enumerator' and
    2693                ((ancestor::library/enumerator[@name=current()]) or
    2694                 (ancestor::library/if[@target=$self_target]/enumerator[@name=current()]))
    2695               ) or
    2696               ((ancestor::library/interface[@name=current()]) or
    2697                (ancestor::library/if[@target=$self_target]/interface[@name=current()])
    2698               )
     2690              (ancestor::library/application/interface[@name=current()]) or
     2691              (ancestor::library/application/if[@target=$self_target]/interface[@name=current()])
    26992692            ">
    27002693              <xsl:value-of select="."/>
     
    27092702</xsl:template>
    27102703
     2704
     2705<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//module/class" />
     2706
     2707<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']/if//interface
     2708| application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//interface" />
     2709
     2710<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//interface" mode="forward" />
     2711
     2712
    27112713</xsl:stylesheet>
    2712 
  • trunk/src/VBox/Main/idl/VirtualBox.dtd

    r56523 r66274  
    1717-->
    1818  <!ELEMENT idl (desc|if|library)*>                           <!-- done -->
    19   <!ELEMENT if ANY>
    20     <!ATTLIST if target (midl|xpidl|wsdl) #REQUIRED>          <!-- done -->
    21   <!ELEMENT cpp ANY>
    22     <!ATTLIST cpp line CDATA #IMPLIED>                        <!-- done -->
    23   <!ELEMENT library (descGroup|if|result|enum|interface|module)*>
     19  <!ELEMENT if ANY>                                           <!-- done -->
     20    <!ATTLIST if target (midl|xpidl|wsdl) #REQUIRED>
     21  <!ELEMENT cpp ANY>                                          <!-- done -->
     22    <!ATTLIST cpp line CDATA #IMPLIED>
     23  <!ELEMENT library (application)*>                           <!-- done -->
    2424    <!ATTLIST library name CDATA #REQUIRED>
    2525    <!ATTLIST library uuid CDATA #REQUIRED>
    2626    <!ATTLIST library version CDATA #REQUIRED>
    27     <!ATTLIST library desc CDATA #REQUIRED>
    28     <!ATTLIST library appUuid CDATA #REQUIRED>
    29     <!ATTLIST library supportsErrorInfo CDATA #REQUIRED>
     27  <!ELEMENT application (descGroup|if|result|enum|interface|module)*>   <!-- done -->
     28    <!ATTLIST application name CDATA #REQUIRED>
     29    <!ATTLIST application uuid CDATA #REQUIRED>
     30    <!ATTLIST application supportsErrorInfo CDATA #REQUIRED>
    3031  <!ELEMENT result (#PCDATA|desc|link)*>                      <!-- done -->
    3132    <!ATTLIST result name CDATA #REQUIRED>
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r66067 r66274  
    280280         UUID or version!!
    281281-->
    282 <library
    283   name="VirtualBox"
    284   uuid="d7569351-1750-46f0-936e-bd127d5bc264"
    285   version="1.3"
    286   desc="VirtualBox Type Library"
    287   appUuid="819B4D85-9CEE-493C-B6FC-64FFE759B3C9"
    288   supportsErrorInfo="yes"
     282    <library
     283      name="VirtualBox"
     284      uuid="d7569351-1750-46f0-936e-bd127d5bc264"
     285      version="1.3"
    289286>
    290287
    291 
    292   <!--
     288<application
     289        name="VirtualBox"
     290        uuid="819B4D85-9CEE-493C-B6FC-64FFE759B3C9"
     291        supportsErrorInfo="yes"
     292>
     293
     294
     295
     296            <!--
    293297  // COM result codes for VirtualBox
    294298  /////////////////////////////////////////////////////////////////////////
     
    2388023884  </module>
    2388123885
     23886</application>
     23887
     23888<!-- Pay attention! Application uuid of this application is used in midl.xsl
     23889     So if you change it then change filter in "interface" and "class" template in midl.xsl too
     23890-->
     23891<application
     23892  name="VirtualBox System Service"
     23893  uuid="ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa"
     23894  supportsErrorInfo="yes"
     23895>
     23896
     23897<if target="midl">
     23898  <!--
     23899  // IVirtualBoxSDS
     23900  //////////////////////////////////////////////////////////////////////////
     23901  -->
     23902
     23903  <interface
     23904    name="IVirtualBoxSDS" extends="$unknown"
     23905    uuid="28932695-fb72-4708-8904-e1077dac7f9a"
     23906    wsmap="suppress"
     23907    reservedMethods="4" reservedAttributes="8"
     23908    >
     23909    <desc>
     23910      The IVirtualBoxSDS interface represents the system-wide directory service
     23911      helper.
     23912
     23913      It exists only on Windows host, and its purpose is to work around design
     23914      flaws in Microsoft's (D)COM, in particular the local server instantiation
     23915      behavior.
     23916    </desc>
     23917
     23918    <attribute name="virtualBox" type="IVirtualBox" readonly="yes">
     23919      <desc>
     23920        Reference to the server-side API root object.
     23921      </desc>
     23922    </attribute>
     23923
     23924      <method name="releaseVirtualBox">
     23925          <desc>
     23926              Client informs that it releases it's VirtualBox reference
     23927          </desc>
     23928      </method>
     23929     
     23930  </interface>
     23931</if>
     23932
     23933  <module name="VBoxSDS" context="LocalService">
     23934    <class name="VirtualBoxSDS" uuid="74ab5ffe-8726-4435-aa7e-876d705bcba5"
     23935           namespace="virtualbox.org">
     23936      <interface name="IVirtualBoxSDS" default="yes"/>
     23937    </class>
     23938  </module>
     23939
     23940</application>
     23941
    2388223942</library>
    2388323943
  • trunk/src/VBox/Main/idl/apiwrap-server-filelist.xsl

    r62486 r66274  
    2828
    2929<xsl:strip-space elements="*"/>
     30
     31<!-- - - - - - - - - - - - - - - - - - - - - - -
     32   XSLT parameters
     33 - - - - - - - - - - - - - - - - - - - - - - -->
     34   
     35<!-- Whether to generate wrappers for VBoxSDS-->
     36<xsl:param name="g_fVBoxWithSDS" select="'no'"/>
    3037
    3138<!-- - - - - - - - - - - - - - - - - - - - - - -
     
    98105
    99106<!-- - - - - - - - - - - - - - - - - - - - - - -
     107  application match
     108 - - - - - - - - - - - - - - - - - - - - - - -->
     109
     110<xsl:template match="application" mode="filelist-even-sources" name="template_app_filelist_even_sources">
     111    <xsl:apply-templates mode="filelist-even-sources"/>
     112</xsl:template>
     113
     114<xsl:template match="application" mode="filelist-odd-sources" name="template_app_filelist_odd_sources">
     115    <xsl:apply-templates mode="filelist-odd-sources"/>
     116</xsl:template>
     117
     118<xsl:template match="application" mode="filelist-headers" name="template_app_filelist_headers">
     119    <xsl:apply-templates mode="filelist-headers"/>
     120</xsl:template>
     121
     122<!-- - - - - - - - - - - - - - - - - - - - - - -
    100123  library match
    101124 - - - - - - - - - - - - - - - - - - - - - - -->
     
    134157</xsl:template>
    135158
     159   
     160    <xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']" mode="filelist-even-sources" >
     161        <xsl:if test="$g_fVBoxWithSDS='yes'" >
     162            <xsl:call-template name="template_app_filelist_even_sources" />
     163        </xsl:if>
     164    </xsl:template>
     165
     166    <xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']" mode="filelist-headers" >
     167        <xsl:if test="$g_fVBoxWithSDS='yes'" >
     168            <xsl:call-template name="template_app_filelist_headers" />
     169        </xsl:if>
     170    </xsl:template>
     171
     172    <xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']" mode="filelist-odd-sources" >
     173        <xsl:if test="$g_fVBoxWithSDS='yes'" >
     174            <xsl:call-template name="template_app_filelist_odd_sources" />
     175        </xsl:if>
     176    </xsl:template>
     177   
     178
    136179</xsl:stylesheet>
    137180<!-- vi: set tabstop=4 shiftwidth=4 expandtab: -->
  • trunk/src/VBox/Main/idl/apiwrap-server.xsl

    r63147 r66274  
    24902490
    24912491<!-- - - - - - - - - - - - - - - - - - - - - - -
     2492  application match
     2493 - - - - - - - - - - - - - - - - - - - - - - -->
     2494
     2495<xsl:template match="application">
     2496    <xsl:apply-templates/>
     2497</xsl:template>
     2498
     2499<!-- - - - - - - - - - - - - - - - - - - - - - -
    24922500  library match
    24932501 - - - - - - - - - - - - - - - - - - - - - - -->
  • trunk/src/VBox/Main/idl/midl.xsl

    r63387 r66274  
    2525<xsl:param name="g_fGenProxy" select="'no'"/>
    2626
     27<!-- Whether to generate coclass and interfaces for VBoxSDS-->
     28<xsl:param name="g_fVBoxWithSDS" select="'no'"/>
     29
    2730<xsl:include href="typemap-shared.inc.xsl"/>
    2831
     
    4245 *  header
    4346-->
    44 <xsl:template match="/idl">
    45   <xsl:text>
     47    <xsl:template match="/idl">
     48        <xsl:text>
    4649/*
    4750 *  DO NOT EDIT! This is a generated file.
     
    6669  <xsl:apply-templates/>
    6770</xsl:template>
    68 
     71   
    6972
    7073<!--
     
    124127    <xsl:text>&#x0A;</xsl:text>
    125128    <!-- forward declarations -->
    126     <xsl:apply-templates select="if | interface" mode="forward"/>
     129    <xsl:apply-templates select="application/if | application/interface" mode="forward"/>
    127130    <xsl:text>&#x0A;</xsl:text>
    128131    <!-- all enums go first -->
    129     <xsl:apply-templates select="enum | if/enum"/>
     132    <xsl:apply-templates select="application/enum | application/if[enum]"/>
    130133    <!-- declare the interfaces -->
    131     <xsl:apply-templates select="if | interface"/>
     134    <xsl:apply-templates select="application/if | application/interface"/>
    132135  </xsl:if>
    133136
     
    135138    uuid(<xsl:value-of select="@uuid"/>),
    136139    version(<xsl:value-of select="@version"/>),
    137     helpstring("<xsl:value-of select="@desc"/>")
     140    helpstring("<xsl:value-of select="@name"/> Type Library")
    138141]
    139142<xsl:text>library </xsl:text>
     
    142145  <xsl:text>&#x0A;importlib("stdole2.tlb");&#x0A;&#x0A;</xsl:text>
    143146  <!-- result codes -->
    144   <xsl:for-each select="result">
     147  <xsl:for-each select="application/result">
    145148    <xsl:apply-templates select="."/>
    146149  </xsl:for-each>
     
    150153    <xsl:when test="$g_fGenProxy = 'yes'">
    151154      <!-- reference enums and interfaces -->
    152       <xsl:apply-templates select="if | interface" mode="forward"/>
    153       <xsl:apply-templates select="enum | if/enum" mode="forward"/>
     155      <xsl:apply-templates select="application/if | application/interface" mode="forward"/>
     156      <xsl:apply-templates select="application/enum | application/if[enum]" mode="forward"/>
    154157      <!-- the modules (i.e. everything else) -->
    155       <xsl:apply-templates select="module | if/module"/>
     158      <xsl:apply-templates select="application/module | application/if[module]"/>
    156159    </xsl:when>
    157160    <xsl:otherwise>
    158161      <!-- forward declarations -->
    159       <xsl:apply-templates select="if | interface" mode="forward"/>
     162      <xsl:apply-templates select="application/if | application/interface" mode="forward"/>
    160163      <!-- all enums go first -->
    161       <xsl:apply-templates select="enum | if/enum"/>
     164      <xsl:apply-templates select="application/enum | application/if[enum]"/>
    162165      <!-- everything else but result codes and enums -->
    163       <xsl:apply-templates select="*[not(self::result or self::enum) and
    164                                      not(self::if[result] or self::if[enum])]"/>
     166      <xsl:apply-templates select="  application/interface | application/if[interface]
     167                                   | application/module | application/if[module]"/>
    165168    </xsl:otherwise>
    166169  </xsl:choose>
     
    173176
    174177<!--
     178 *  applications
     179-->
     180<xsl:template match="application">
     181  <xsl:apply-templates/>
     182</xsl:template>
     183<xsl:template match="application" mode="forward">
     184  <xsl:apply-templates mode="forward"/>
     185</xsl:template>
     186
     187
     188<!--
    175189 *  result codes
    176190-->
     
    185199 *  forward declarations
    186200-->
    187 <xsl:template match="interface" mode="forward">
     201<xsl:template match="interface" mode="forward" name="template_interface_forward">
    188202  <xsl:text>interface </xsl:text>
    189203  <xsl:value-of select="@name"/>
     
    202216 *  interfaces
    203217-->
    204 <xsl:template match="interface">[
     218<xsl:template match="interface" name="template_interface">[
    205219    uuid(<xsl:value-of select="@uuid"/>),
    206220    object,
     
    646660 *  co-classes
    647661-->
    648 <xsl:template match="module/class">[
     662<xsl:template match="module/class" name="template_class">[
    649663    uuid(<xsl:value-of select="@uuid"/>)
    650664]
     
    842856            <!-- enum types -->
    843857            <xsl:when test="
    844               (ancestor::library/enum[@name=current()]) or
    845               (ancestor::library/if[@target=$self_target]/enum[@name=current()])
     858              (ancestor::library/application/enum[@name=current()]) or
     859              (ancestor::library/application/if[@target=$self_target]/enum[@name=current()])
    846860            ">
    847861              <xsl:value-of select="."/>
     
    849863            <!-- custom interface types -->
    850864            <xsl:when test="
    851               ((ancestor::library/interface[@name=current()]) or
    852                (ancestor::library/if[@target=$self_target]/interface[@name=current()])
     865              ((ancestor::library/application/interface[@name=current()]) or
     866               (ancestor::library/application/if[@target=$self_target]/interface[@name=current()])
    853867              )
    854868            ">
     
    868882  </xsl:choose>
    869883</xsl:template>
     884   
     885   
     886<!-- Filters for switch on/off VBoxSDS definitions -->
     887 
     888<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//module/class" >
     889    <xsl:if test="$g_fVBoxWithSDS='yes'" >
     890        <xsl:call-template name="template_class" />
     891    </xsl:if>
     892</xsl:template>
     893   
     894<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']/if//interface
     895                                | application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//interface" >
     896    <xsl:if test="$g_fVBoxWithSDS='yes'" >
     897        <xsl:call-template name="template_interface" />
     898    </xsl:if>
     899</xsl:template>
     900   
     901<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//interface" mode="forward" >
     902    <xsl:if test="$g_fVBoxWithSDS='yes'" >
     903        <xsl:call-template name="template_interface_forward" />
     904    </xsl:if>
     905</xsl:template>
     906     
    870907
    871908</xsl:stylesheet>
  • trunk/src/VBox/Main/idl/xpidl.xsl

    r62486 r66274  
    148148  <!-- result codes -->
    149149  <xsl:text>// result codes declared in API spec&#x0A;</xsl:text>
    150   <xsl:for-each select="result">
     150  <xsl:for-each select="application/result">
    151151    <xsl:apply-templates select="."/>
    152152  </xsl:for-each>
    153153  <xsl:text>%}&#x0A;&#x0A;</xsl:text>
    154154  <!-- forward declarations -->
    155   <xsl:apply-templates select="if | interface" mode="forward"/>
     155  <xsl:apply-templates select="application/if | application/interface" mode="forward"/>
    156156  <xsl:text>&#x0A;</xsl:text>
    157157  <!-- all enums go first -->
    158   <xsl:apply-templates select="enum | if/enum"/>
    159   <!-- everything else but result codes and enums -->
    160   <xsl:apply-templates select="*[not(self::result or self::enum) and
    161                                  not(self::if[result] or self::if[enum])]"/>
     158  <xsl:apply-templates select="application/enum | application/if/enum"/>
     159  <!-- everything else but result codes and enums
     160  <xsl:apply-templates select="*[not(self::application/result or self::application/enum) and
     161                                 not(self::application[result] or self::application/if[enum])]"/> -->
     162  <!-- the modules (i.e. everything else) -->
     163  <xsl:apply-templates select="application/interface | application/if[interface]
     164                                   | application/module | application/if[module]"/>
    162165  <!-- -->
    163166</xsl:template>
    164167
     168
     169 <!--
     170 *  applications
     171-->
     172<xsl:template match="application">
     173  <xsl:apply-templates/>
     174</xsl:template>
     175<xsl:template match="application" mode="forward">
     176  <xsl:apply-templates mode="forward"/>
     177</xsl:template>
    165178
    166179<!--
     
    886899            <!-- enum types -->
    887900            <xsl:when test="
    888               (ancestor::library/enum[@name=current()]) or
    889               (ancestor::library/if[@target=$self_target]/enum[@name=current()])
     901              (ancestor::library/application/enum[@name=current()]) or
     902              (ancestor::library/application/if[@target=$self_target]/enum[@name=current()])
    890903            ">
    891904              <xsl:text>PRUint32</xsl:text>
     
    893906            <!-- custom interface types -->
    894907            <xsl:when test="
    895               (ancestor::library/interface[@name=current()]) or
    896                (ancestor::library/if[@target=$self_target]/interface[@name=current()])
     908              (ancestor::library/application/interface[@name=current()]) or
     909               (ancestor::library/application/if[@target=$self_target]/interface[@name=current()])
    897910            ">
    898911              <xsl:value-of select="."/>
     
    10081021            <!-- enum types -->
    10091022            <xsl:when test="
    1010               (ancestor::library/enum[@name=current()]) or
    1011               (ancestor::library/if[@target=$self_target]/enum[@name=current()])
     1023              (ancestor::library/application/enum[@name=current()]) or
     1024              (ancestor::library/application/if[@target=$self_target]/enum[@name=current()])
    10121025            ">
    10131026              <xsl:text>PRUint32</xsl:text>
     
    10151028            <!-- custom interface types -->
    10161029            <xsl:when test="
    1017               (ancestor::library/interface[@name=current()]) or
    1018               (ancestor::library/if[@target=$self_target]/interface[@name=current()])
     1030              (ancestor::library/application/interface[@name=current()]) or
     1031              (ancestor::library/application/if[@target=$self_target]/interface[@name=current()])
    10191032            ">
    10201033              <xsl:value-of select="."/>
     
    10291042</xsl:template>
    10301043
     1044<!-- Filters for switch off VBoxSDS definitions -->
     1045 
     1046<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//module/class" />
     1047
     1048<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']/if//interface
     1049| application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//interface" />
     1050
     1051<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//interface" mode="forward" />
     1052
     1053
    10311054</xsl:stylesheet>
    10321055
  • trunk/src/VBox/Main/idl/xpidl_iid.xsl

    r62486 r66274  
    9393-->
    9494<xsl:template match="library">
    95   <xsl:apply-templates select="if | interface"/>
    96   <xsl:apply-templates select="module"/>
     95  <xsl:apply-templates select="application/if | application/interface"/>
     96  <xsl:apply-templates select="application/module"/>
    9797</xsl:template>
    9898
     
    151151</xsl:template>
    152152
     153
     154<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//module/class" />
     155
     156<xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']/if//interface
     157| application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']//interface" />
     158
    153159</xsl:stylesheet>
    154160
  • trunk/src/VBox/Main/include/Logging.h

    r62485 r66274  
    4545# define VBOXSVC_LOG_DEFAULT "all"
    4646#endif
     47#ifndef VBOXSDS_LOG_DEFAULT
     48# define VBOXSDS_LOG_DEFAULT "all"
     49#endif
    4750
    4851#include <VBox/log.h>
  • trunk/src/VBox/Main/include/win/resource.h

    r62485 r66274  
    2424#define IDR_VIRTUALBOX 101
    2525
     26// service name string resource ID
     27#define IDS_SERVICENAME 102
     28
    2629
    2730#endif // __H_RESOURCEVBOXCOM
  • trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c

    r65088 r66274  
    10181018 * @param   pszAppId            The application UUID string.
    10191019 * @param   pszDescription      The description string.
    1020  */
    1021 LSTATUS VbpsRegisterAppId(VBPSREGSTATE *pState, const char *pszAppId, const char *pszDescription)
     1020 * @param   bIsService          The application is windows service
     1021 */
     1022LSTATUS VbpsRegisterAppId(
     1023    VBPSREGSTATE *pState,
     1024    const char *pszModuleName,
     1025    const char *pszAppId,
     1026    const char *pszDescription,
     1027    bool bIsService)
    10221028{
    10231029    LSTATUS rc;
     
    10561062
    10571063    if (pState->fDelete)
     1064    {
    10581065        vbpsDeleteKeyRecursiveA(pState, hkeyAppIds, pszAppId, __LINE__);
    1059 
    1060     /*
    1061      * Update.
    1062      */
    1063     if (pState->fUpdate)
    1064         vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszAppId, pszDescription, __LINE__);
     1066        vbpsDeleteKeyRecursiveA(pState, hkeyAppIds, pszModuleName, __LINE__);
     1067    }
     1068
     1069        if (pState->fUpdate)
     1070        {
     1071            //HKEY hkeyApp;
     1072            HKEY hkeyServiceExe;
     1073   
     1074            vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszAppId, pszDescription, __LINE__);
     1075   
     1076            if (bIsService)
     1077            {
     1078                HKEY hkeyApp;
     1079
     1080                char szModule[MAX_PATH + 2];
     1081                size_t len = RTStrNLen(pszModuleName, MAX_PATH);
     1082                Assert(len);
     1083                Assert(len < MAX_PATH);
     1084                rc = RTStrCopy(szModule, sizeof(szModule), pszModuleName);
     1085                AssertRC(rc);
     1086                szModule[len - 4] = '\0';
     1087
     1088                rc = RegOpenKeyExA(hkeyAppIds, pszAppId, 0 /*fOptions*/, pState->fSamBoth, &hkeyApp);
     1089                if (rc == ERROR_FILE_NOT_FOUND)
     1090                    return ERROR_SUCCESS;
     1091                // create the value "Service" with the service name
     1092                vbpsSetRegValueAA(pState, hkeyApp, "LocalService", szModule, __LINE__);
     1093                vbpsCloseKey(pState, hkeyApp, __LINE__);
     1094            }
     1095   
     1096            vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszModuleName, "", __LINE__);
     1097            rc = RegOpenKeyExA(hkeyAppIds, pszModuleName, 0 /*fOptions*/, pState->fSamBoth, &hkeyServiceExe);
     1098            if (rc == ERROR_FILE_NOT_FOUND)
     1099                return ERROR_SUCCESS;
     1100            vbpsSetRegValueAA(pState, hkeyServiceExe, "AppID", pszAppId, __LINE__);
     1101            vbpsCloseKey(pState, hkeyServiceExe, __LINE__);
     1102        }
    10651103
    10661104    vbpsCloseKey(pState, hkeyAppIds, __LINE__);
     
    11631201    LSTATUS rc;
    11641202    char szClsId[CURLY_UUID_STR_BUF_SIZE];
     1203    bool fQuoteIt = false;
    11651204    RT_NOREF(pszAppId);
    11661205
     
    12041243                RTUTF16 wszModule[MAX_PATH * 2];
    12051244                PRTUTF16 pwszCur = wszModule;
    1206                 bool fQuoteIt = strcmp(pszServerType, "LocalServer32") == 0;
     1245                fQuoteIt = strcmp(pszServerType, "LocalServer32") == 0;
    12071246                if (fQuoteIt)
    12081247                    *pwszCur++ = '"';
     
    12481287            }
    12491288
     1289            /* AppID = pszAppId */
     1290            if(pszAppId && fQuoteIt)
     1291                vbpsSetRegValueAA(pState, hkeyClass, "AppID", pszAppId, __LINE__);
     1292
    12501293            vbpsCloseKey(pState, hkeyClass, __LINE__);
    12511294        }
     
    12551298}
    12561299
     1300
     1301#ifdef VBOX_WITH_SDS
     1302/**
     1303* Register VBoxSDS classes from the VirtualBox.xidl file.
     1304*
     1305* @returns COM status code.
     1306* @param   pState
     1307* @param   pwszVBoxDir         The VirtualBox application directory.
     1308*
     1309* @todo convert to XSLT.
     1310*/
     1311void RegisterVBoxSDSXidl(VBPSREGSTATE *pState, PCRTUTF16 pwszVBoxDir)
     1312{
     1313    const char *pszServiceAppId = "{EC0E78E8-FA43-43E8-AC0A-02C784C4A4FA}";
     1314    const char *pszWindowsService = "VBoxSDS.exe";
     1315
     1316    VbpsRegisterAppId(pState, pszWindowsService, pszServiceAppId, "VirtualBox System Service", true);
     1317
     1318    /* VBoxSDS */
     1319    VbpsRegisterClassName(pState, "VirtualBox.VirtualBoxSDS.1", "VirtualBoxSDS Class", &CLSID_VirtualBoxSDS, NULL);
     1320    VbpsRegisterClassName(pState, "VirtualBox.VirtualBoxSDS", "VirtualBoxSDS Class", &CLSID_VirtualBoxSDS, ".1");
     1321    VbpsRegisterClassId(pState, &CLSID_VirtualBoxSDS, "VirtualBoxSDS Class", pszServiceAppId, "VirtualBox.VirtualBoxSDS", ".1",
     1322        &LIBID_VirtualBox, "LocalServer32", pwszVBoxDir, pszWindowsService, NULL /*N/A*/);
     1323}
     1324#endif
    12571325
    12581326/**
     
    12681336void RegisterXidlModulesAndClassesGenerated(VBPSREGSTATE *pState, PCRTUTF16 pwszVBoxDir, bool fIs32On64)
    12691337{
    1270     const char *pszAppId = "{819B4D85-9CEE-493C-B6FC-64FFE759B3C9}";
     1338    const char *pszAppId        = "{819B4D85-9CEE-493C-B6FC-64FFE759B3C9}";
    12711339    const char *pszInprocDll = !fIs32On64 ? "VBoxC.dll" : "x86\\VBoxClient-x86.dll";
    1272 
    1273     VbpsRegisterAppId(pState, pszAppId, "VirtualBox Application");
     1340    const char *pszLocalServer      = "VBoxSVC.exe";
     1341       
     1342    VbpsRegisterAppId(pState, pszLocalServer, pszAppId, "VirtualBox Application", false);
    12741343
    12751344    /* VBoxSVC */
     
    12771346    VbpsRegisterClassName(pState, "VirtualBox.VirtualBox",   "VirtualBox Class", &CLSID_VirtualBox, ".1");
    12781347    VbpsRegisterClassId(pState, &CLSID_VirtualBox, "VirtualBox Class", pszAppId, "VirtualBox.VirtualBox", ".1",
    1279                         &LIBID_VirtualBox, "LocalServer32", pwszVBoxDir, "VBoxSVC.exe", NULL /*N/A*/);
     1348                        &LIBID_VirtualBox, "LocalServer32", pwszVBoxDir, pszLocalServer, NULL /*N/A*/);
    12801349    /* VBoxC */
    12811350    VbpsRegisterClassName(pState, "VirtualBox.Session.1", "Session Class", &CLSID_Session, NULL);
     
    12891358                        "VirtualBox.VirtualBoxClient", ".1",
    12901359                        &LIBID_VirtualBox, "InprocServer32", pwszVBoxDir, pszInprocDll, "Free");
     1360
     1361#ifdef VBOX_WITH_SDS
     1362    RegisterVBoxSDSXidl(pState, pwszVBoxDir);
     1363#endif
    12911364}
    12921365
  • trunk/src/VBox/Main/src-all/win/VirtualBox_rgs.xsl

    r62486 r66274  
    2929-->
    3030
     31<!-- Name of the application to generate the RGS script for -->
     32<xsl:param name="Application"/>
    3133<!-- Name of the module to generate the RGS script for -->
    3234<xsl:param name="Module"/>
     
    4244-->
    4345<xsl:template match="/idl">
    44 HKCR
    45 {
    46 <xsl:apply-templates/>
    47 }
     46  <xsl:apply-templates/>
    4847</xsl:template>
    4948
     
    5251 *  libraries
    5352-->
    54 <xsl:template match="idl/library">
     53<xsl:template match="library">
     54  <xsl:apply-templates/>
     55</xsl:template>
     56
     57
     58<!--
     59 *  applications
     60-->
     61<xsl:template match="application">
     62  <xsl:if test="@name=$Application">
     63    <xsl:variable name="context" select="//module[@name=$Module]/@context"/>
     64<xsl:text>HKCR
     65{
    5566  NoRemove AppID
    5667  {
    57     ForceRemove {<xsl:value-of select="@appUuid"/>} = s '<xsl:value-of select="@name"/> Application'
     68    ForceRemove {</xsl:text><xsl:value-of select="@uuid"/>} = s '<xsl:value-of select="@name"/><xsl:text> </xsl:text>
     69    <xsl:choose>
     70      <xsl:when test="$context='LocalService'">
     71        <xsl:text>Service</xsl:text>
     72      </xsl:when>
     73      <xsl:otherwise>
     74        <xsl:text>Application</xsl:text>
     75      </xsl:otherwise>
     76    </xsl:choose>
     77    <xsl:text>'
     78</xsl:text>
     79    <xsl:if test="$context='LocalService'">
     80      <xsl:text>    {
     81      val LocalService = s '</xsl:text><xsl:value-of select="$Module"/><xsl:text>'
     82    }
     83</xsl:text>
     84    </xsl:if>
     85    <xsl:text>    '</xsl:text><xsl:value-of select="$Module"/>
     86    <xsl:choose>
     87      <xsl:when test="$context='InprocServer'">
     88        <xsl:text>.dll</xsl:text>
     89      </xsl:when>
     90      <xsl:otherwise>
     91        <xsl:text>.exe</xsl:text>
     92      </xsl:otherwise>
     93    </xsl:choose>
     94    <xsl:text>'
     95    {
     96      val AppID = s '{</xsl:text><xsl:value-of select="//library/application[@name=$Application]/@uuid"/><xsl:text>}'
     97    }
    5898  }
    5999
    60 <xsl:apply-templates select="module[@name=$Module]/class"/>
     100</xsl:text>
     101    <xsl:apply-templates select="module[@name=$Module]/class"/>
     102<xsl:text>}
     103</xsl:text>
     104  </xsl:if>
    61105</xsl:template>
    62106
     
    66110-->
    67111<xsl:template match="library//module/class">
    68   <xsl:variable name="cname" select="concat(//library/@name,'.',@name)"/>
     112  <xsl:variable name="cname" select="concat(//library/application/@name,'.',@name)"/>
    69113  <xsl:variable name="desc" select="concat(@name,' Class')"/>
    70114  <xsl:text>  </xsl:text>
     
    82126    ForceRemove {<xsl:value-of select="@uuid"/>} = s '<xsl:value-of select="$desc"/>'
    83127    {
    84       ProgId = s '<xsl:value-of select="concat($cname,'.1')"/>'
    85       VersionIndependentProgID = s '<xsl:value-of select="$cname"/>'
    86       <xsl:choose>
    87         <xsl:when test="../@context='InprocServer'">InprocServer32</xsl:when>
    88         <xsl:when test="../@context='LocalServer'">LocalServer32</xsl:when>
    89         <xsl:otherwise>
    90           <xsl:message terminate="yes">
    91             <xsl:value-of select="concat(../../@name,'::',../@name,': ')"/>
    92             <xsl:text>module context </xsl:text>
    93             <xsl:value-of select="concat('&quot;',../@context,'&quot;')"/>
    94             <xsl:text> is invalid!</xsl:text>
    95           </xsl:message>
    96         </xsl:otherwise>
    97       </xsl:choose> = s '%MODULE%'
    98       <xsl:if test="../@context='InprocServer'">
    99         <xsl:variable name="tmodel" select="(./@threadingModel | ../@threadingModel)[last()]"/>{
    100         val ThreadingModel = s '<xsl:choose>
    101           <xsl:when test="$tmodel='Apartment'">Apartment</xsl:when>
    102           <xsl:when test="$tmodel='Free'">Free</xsl:when>
    103           <xsl:when test="$tmodel='Both'">Both</xsl:when>
    104           <xsl:when test="$tmodel='Neutral'">Neutral</xsl:when>
    105           <xsl:when test="$tmodel='Single'">Single</xsl:when>
    106           <xsl:when test="$tmodel='Rental'">Rental</xsl:when>
     128      val AppID = s '{<xsl:value-of select="//library/application[@name=$Application]/@uuid"/><xsl:text>}'
     129</xsl:text>
     130      <xsl:if test="../@context!='LocalService'">
     131        <xsl:text>      ProgID = s '</xsl:text><xsl:value-of select="concat($cname,'.1')"/><xsl:text>'
     132      VersionIndependentProgID = s '</xsl:text><xsl:value-of select="$cname"/><xsl:text>'
     133      </xsl:text>
     134        <xsl:choose>
     135          <xsl:when test="../@context='InprocServer'">InprocServer32</xsl:when>
     136          <xsl:when test="../@context='LocalServer'">LocalServer32</xsl:when>
    107137          <xsl:otherwise>
    108138            <xsl:message terminate="yes">
    109               <xsl:value-of select="concat(../../@name,'::',@name,': ')"/>
    110               <xsl:text>class (or module) threading model </xsl:text>
    111               <xsl:value-of select="concat('&quot;',$tmodel,'&quot;')"/>
     139              <xsl:value-of select="concat(../../@name,'::',../@name,': ')"/>
     140              <xsl:text>module context </xsl:text>
     141              <xsl:value-of select="concat('&quot;',../@context,'&quot;')"/>
    112142              <xsl:text> is invalid!</xsl:text>
    113143            </xsl:message>
    114144          </xsl:otherwise>
    115         </xsl:choose>'
     145        </xsl:choose><xsl:text> = s '%MODULE%'
     146</xsl:text>
     147        <xsl:if test="../@context='InprocServer'">
     148          <xsl:variable name="tmodel" select="(./@threadingModel | ../@threadingModel)[last()]"/><xsl:text>      {
     149        val ThreadingModel = s '</xsl:text>
     150          <xsl:choose>
     151            <xsl:when test="$tmodel='Apartment'">Apartment</xsl:when>
     152            <xsl:when test="$tmodel='Free'">Free</xsl:when>
     153            <xsl:when test="$tmodel='Both'">Both</xsl:when>
     154            <xsl:when test="$tmodel='Neutral'">Neutral</xsl:when>
     155            <xsl:when test="$tmodel='Single'">Single</xsl:when>
     156            <xsl:when test="$tmodel='Rental'">Rental</xsl:when>
     157            <xsl:otherwise>
     158              <xsl:message terminate="yes">
     159                <xsl:value-of select="concat(../../@name,'::',@name,': ')"/>
     160                <xsl:text>class (or module) threading model </xsl:text>
     161                <xsl:value-of select="concat('&quot;',$tmodel,'&quot;')"/>
     162                <xsl:text> is invalid!</xsl:text>
     163              </xsl:message>
     164            </xsl:otherwise>
     165          </xsl:choose><xsl:text>'
    116166      }
     167</xsl:text>
     168        </xsl:if>
     169        <xsl:text>      TypeLib = s '{</xsl:text><xsl:value-of select="//library/@uuid"/><xsl:text>}'
     170</xsl:text>
    117171      </xsl:if>
    118       val AppId = s '{<xsl:value-of select="//library/@appUuid"/>}'
    119       'TypeLib' = s '{<xsl:value-of select="//library/@uuid"/>}'
    120     }
     172      <xsl:text>    }
    121173  }
    122 
     174</xsl:text>
    123175</xsl:template>
    124176
  • trunk/src/VBox/Main/src-all/win/comregister.cmd

    r59385 r66274  
    163163@if %fUninstallOnly% == 1 goto end
    164164"%_VBOX_DIR%VBoxSVC.exe" /RegServer
     165"%_VBOX_DIR%VBoxSDS.exe" /RegService
    165166regsvr32 /s    "%_VBOX_DIR%VBoxC.dll"
    166167@if %fNoProxy% == 1 goto end
     
    183184@echo on
    184185"%_VBOX_DIR%VBoxSVC.exe" /UnregServer
     186"%_VBOX_DIR%VBoxSDS.exe" /UnregService
    185187%windir%\system32\regsvr32 /s /u "%_VBOX_DIR%VBoxC.dll"
    186188%windir%\syswow64\regsvr32 /s /u "%_VBOX_DIR%x86\VBoxClient-x86.dll"
     
    189191if %fUninstallOnly% == 1 goto end
    190192"%_VBOX_DIR%VBoxSVC.exe" /RegServer
     193"%_VBOX_DIR%VBoxSDS.exe" /RegService
    191194%windir%\system32\regsvr32 /s    "%_VBOX_DIR%VBoxC.dll"
    192195%windir%\syswow64\regsvr32 /s    "%_VBOX_DIR%x86\VBoxClient-x86.dll"
  • trunk/src/VBox/Main/src-client/VirtualBoxClientImpl.cpp

    r63814 r66274  
    5959}
    6060
     61
    6162// public initializer/uninitializer for internal purposes only
    6263/////////////////////////////////////////////////////////////////////////////
     64
     65#ifdef VBOX_WITH_SDS
     66
     67HRESULT CreateVirtualBoxThroughSDS(ComPtr<IVirtualBox> &aVirtualBox)
     68{
     69    ComPtr<IVirtualBoxSDS> aVirtualBoxSDS;
     70
     71    HRESULT rc = CoCreateInstance(CLSID_VirtualBoxSDS, /* the VirtualBoxSDS object */
     72        NULL,                   /* no aggregation */
     73        CLSCTX_LOCAL_SERVER,   /* the object lives in the current process */
     74        IID_IVirtualBoxSDS,  /* IID of the interface */
     75        (void **)aVirtualBoxSDS.asOutParam());
     76    if (FAILED(rc))
     77    {
     78        //AssertComRCThrow(rc, setError(rc,
     79        //    tr("Could not create VirtualBoxSDS bridge object for VirtualBoxClient")));
     80        Assert(SUCCEEDED(rc));
     81        return rc;
     82    }
     83
     84    rc = aVirtualBoxSDS->get_VirtualBox(aVirtualBox.asOutParam());
     85    if (FAILED(rc))
     86    {
     87        Assert(SUCCEEDED(rc));
     88        //AssertComRCThrow(rc, setError(rc,
     89        //    tr("Could not create VirtualBox object for VirtualBoxClient")));
     90    }
     91    return rc;
     92}
     93
     94HRESULT ReleaseVirtualBoxThroughSDS()
     95{
     96    ComPtr<IVirtualBoxSDS> aVirtualBoxSDS;
     97
     98    HRESULT rc = CoCreateInstance(CLSID_VirtualBoxSDS, /* the VirtualBoxSDS object */
     99        NULL,                   /* no aggregation */
     100        CLSCTX_LOCAL_SERVER,   /* the object lives in the current process */
     101        IID_IVirtualBoxSDS,  /* IID of the interface */
     102        (void **)aVirtualBoxSDS.asOutParam());
     103    if (FAILED(rc))
     104    {
     105        //AssertComRCThrow(rc, setError(rc,
     106        //    tr("Could not create VirtualBoxSDS bridge object for VirtualBoxClient")));
     107        LogRel(("ReleaseVirtualBox - instantiation of IVirtualBoxSDS failed, %x\n", rc));
     108        Assert(SUCCEEDED(rc));
     109        return rc;
     110    }
     111
     112    rc = aVirtualBoxSDS->ReleaseVirtualBox();
     113    if (FAILED(rc))
     114    {
     115        LogRel(("DeregisterVirtualBox() failed, %x\n", rc));
     116        Assert(SUCCEEDED(rc));
     117    }
     118    return rc;
     119}
     120
     121#endif
    63122
    64123/**
     
    69128HRESULT VirtualBoxClient::init()
    70129{
     130
     131#ifdef VBOX_WITH_SDS
     132    // TODO: AM rework for final version
     133    // setup COM Security to enable impersonation
     134    // This works for console Virtual Box clients, GUI has own security settings
     135    //  For GUI Virtual Box it will be second call so can return TOO_LATE error
     136    HRESULT hrGUICoInitializeSecurity = CoInitializeSecurity(NULL,
     137        -1,
     138        NULL,
     139        NULL,
     140        RPC_C_AUTHN_LEVEL_DEFAULT,
     141        RPC_C_IMP_LEVEL_IMPERSONATE, //RPC_C_IMP_LEVEL_DELEGATE,//RPC_C_IMP_LEVEL_IMPERSONATE,
     142        NULL,
     143        EOAC_NONE,//EOAC_NONE,//EOAC_DYNAMIC_CLOAKING,//EOAC_STATIC_CLOAKING, 
     144        NULL);
     145    //Assert(RPC_E_TOO_LATE != hrGUICoInitializeSecurity);
     146    Assert(SUCCEEDED(hrGUICoInitializeSecurity) || hrGUICoInitializeSecurity == RPC_E_TOO_LATE);
     147#endif
     148
    71149    LogFlowThisFuncEnter();
    72150
     
    92170        mData.m_ThreadWatcher = NIL_RTTHREAD;
    93171        mData.m_SemEvWatcher = NIL_RTSEMEVENT;
    94 
     172       
     173#ifdef VBOX_WITH_SDS
     174        // TODO: AM create virtual box through SDS
     175        rc = CreateVirtualBoxThroughSDS(mData.m_pVirtualBox);
     176#else
    95177        rc = mData.m_pVirtualBox.createLocalObject(CLSID_VirtualBox);
     178#endif
    96179        if (FAILED(rc))
    97180#ifdef RT_OS_WINDOWS
     
    174257HRESULT VirtualBoxClient::i_investigateVirtualBoxObjectCreationFailure(HRESULT hrcCaller)
    175258{
    176     /*
     259    // TODO: AM place creation of VBox through SDS
     260     /*
    177261     * First step is to try get an IUnknown interface of the VirtualBox object.
    178262     *
     
    340424{
    341425    LogFlowThisFunc(("\n"));
     426
     427#ifdef VBOX_WITH_SDS
     428    ReleaseVirtualBoxThroughSDS();
     429#endif
    342430
    343431    /* Enclose the state transition Ready->InUninit->NotReady */
  • trunk/src/VBox/Main/src-client/win/VBoxC.rc

    r62535 r66274  
    5858//
    5959
    60 IDR_VIRTUALBOX REGISTRY "VBoxC.rgs"
     60//IDR_VIRTUALBOX REGISTRY "VBoxC.rgs"
    6161
    62621 TYPELIB "VirtualBox.tlb"
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r66217 r66274  
    303303};
    304304
    305 
    306305// constructor / destructor
    307306/////////////////////////////////////////////////////////////////////////////
     
    311310HRESULT VirtualBox::FinalConstruct()
    312311{
    313     LogFlowThisFunc(("\n"));
     312    LogRelFlowThisFuncEnter();
    314313    LogRel(("VirtualBox: object creation starts\n"));
    315314
     315    BaseFinalConstruct();
     316
    316317    HRESULT rc = init();
    317318
    318     BaseFinalConstruct();
    319 
     319    LogRelFlowThisFuncLeave();
    320320    LogRel(("VirtualBox: object created\n"));
    321321
     
    325325void VirtualBox::FinalRelease()
    326326{
    327     LogFlowThisFunc(("\n"));
     327    LogRelFlowThisFuncEnter();
    328328    LogRel(("VirtualBox: object deletion starts\n"));
    329329
     
    333333
    334334    LogRel(("VirtualBox: object deleted\n"));
     335    LogRelFlowThisFuncLeave();
    335336}
    336337
     
    345346HRESULT VirtualBox::init()
    346347{
     348    LogRelFlowThisFuncEnter();
    347349    /* Enclose the state transition NotReady->InInit->Ready */
    348350    AutoInitSpan autoInitSpan(this);
  • trunk/src/VBox/Runtime/VBox/errmsgvboxcom.xsl

    r62898 r66274  
    5151
    5252<xsl:template match="idl">
    53   <xsl:for-each select="library/result">
     53  <xsl:for-each select="library/application/result">
    5454    <xsl:text>{ "</xsl:text>
    5555    <xsl:choose>
  • trunk/src/VBox/Runtime/VBox/log-vbox.cpp

    r65698 r66274  
    484484    ASSERT_LOG_GROUP(MAIN_VIRTUALBOX);
    485485    ASSERT_LOG_GROUP(MAIN_VIRTUALBOXCLIENT);
     486    ASSERT_LOG_GROUP(MAIN_VIRTUALBOXSDS);
    486487    ASSERT_LOG_GROUP(MAIN_VIRTUALSYSTEMDESCRIPTION);
    487488    ASSERT_LOG_GROUP(MAIN_VRDESERVER);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette