Index: /trunk/src/VBox/Main/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/Makefile.kmk	(revision 50558)
+++ /trunk/src/VBox/Main/Makefile.kmk	(revision 50559)
@@ -1031,8 +1031,6 @@
 	include/ConsoleImpl.h
 
-ifdef VBOX_WITH_GUEST_CONTROL
 VBoxC_VBOX_INTERMEDIATES   = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
 VBoxC_VBOX_HEADERS += $(VBOX_MAIN_APIWRAPPER_INCS)
-endif # VBOX_WITH_GUEST_CONTROL
 
 VBoxC_VBOX_TRANSLATIONS = \
Index: /trunk/src/VBox/Main/include/GuestDirectoryImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/GuestDirectoryImpl.h	(revision 50558)
+++ /trunk/src/VBox/Main/include/GuestDirectoryImpl.h	(revision 50559)
@@ -20,6 +20,6 @@
 #define ____H_GUESTDIRECTORYIMPL
 
-#include "VirtualBoxBase.h"
 #include "GuestProcessImpl.h"
+#include "GuestDirectoryWrap.h"
 
 class GuestSession;
@@ -29,33 +29,19 @@
  */
 class ATL_NO_VTABLE GuestDirectory :
-    public VirtualBoxBase,
-    public GuestObject,
-    VBOX_SCRIPTABLE_IMPL(IGuestDirectory)
+    public GuestDirectoryWrap,
+    public GuestObject
 {
 public:
     /** @name COM and internal init/term/mapping cruft.
      * @{ */
-    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(GuestDirectory, IGuestDirectory)
-    DECLARE_NOT_AGGREGATABLE(GuestDirectory)
-    DECLARE_PROTECT_FINAL_CONSTRUCT()
-    BEGIN_COM_MAP(GuestDirectory)
-        VBOX_DEFAULT_INTERFACE_ENTRIES(IGuestDirectory)
-        COM_INTERFACE_ENTRY(IDirectory)
-    END_COM_MAP()
     DECLARE_EMPTY_CTOR_DTOR(GuestDirectory)
 
     int     init(Console *pConsole, GuestSession *pSession, ULONG uDirID, const GuestDirectoryOpenInfo &openInfo);
     void    uninit(void);
+
     HRESULT FinalConstruct(void);
     void    FinalRelease(void);
     /** @}  */
 
-    /** @name IDirectory interface.
-     * @{ */
-    STDMETHOD(COMGETTER(DirectoryName))(BSTR *aName);
-    STDMETHOD(COMGETTER(Filter))(BSTR *aFilter);
-    STDMETHOD(Close)(void);
-    STDMETHOD(Read)(IFsObjInfo **aInfo);
-    /** @}  */
 
 public:
@@ -63,14 +49,23 @@
      * @{ */
     int            callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
-    static Utf8Str guestErrorToString(int guestRc);
     int            onRemove(void);
-    static HRESULT setErrorExternal(VirtualBoxBase *pInterface, int guestRc);
+
+    static Utf8Str i_guestErrorToString(int guestRc);
+    static HRESULT i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc);
     /** @}  */
 
 private:
 
-    /** @name Private internal methods.
+    /** @name Private Wrapped properties
      * @{ */
     /** @}  */
+    HRESULT getDirectoryName(com::Utf8Str &aDirectoryName);
+    HRESULT getFilter(com::Utf8Str &aFilter);
+
+    /** @name Wrapped Private internal methods.
+     * @{ */
+    /** @}  */
+     HRESULT close();
+     HRESULT read(ComPtr<IFsObjInfo> &aObjInfo);
 
     struct Data
Index: /trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp	(revision 50558)
+++ /trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp	(revision 50559)
@@ -143,35 +143,25 @@
 }
 
-// implementation of public getters/setters for attributes
+// implementation of private wrapped getters/setters for attributes
 /////////////////////////////////////////////////////////////////////////////
 
-STDMETHODIMP GuestDirectory::COMGETTER(DirectoryName)(BSTR *aName)
-{
-    LogFlowThisFuncEnter();
-
-    CheckComArgOutPointerValid(aName);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+HRESULT GuestDirectory::getDirectoryName(com::Utf8Str &aDirectoryName)
+{
+    LogFlowThisFuncEnter();
 
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    mData.mOpenInfo.mPath.cloneTo(aName);
+    aDirectoryName = mData.mOpenInfo.mPath;
 
     return S_OK;
 }
 
-STDMETHODIMP GuestDirectory::COMGETTER(Filter)(BSTR *aFilter)
-{
-    LogFlowThisFuncEnter();
-
-    CheckComArgOutPointerValid(aFilter);
-
-    AutoCaller autoCaller(this);
-    if (FAILED(autoCaller.rc())) return autoCaller.rc();
+HRESULT GuestDirectory::getFilter(com::Utf8Str &aFilter)
+{
+    LogFlowThisFuncEnter();
 
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    mData.mOpenInfo.mFilter.cloneTo(aFilter);
+    aFilter = mData.mOpenInfo.mFilter;
 
     return S_OK;
@@ -229,5 +219,5 @@
 
 /* static */
-Utf8Str GuestDirectory::guestErrorToString(int guestRc)
+Utf8Str GuestDirectory::i_guestErrorToString(int guestRc)
 {
     Utf8Str strError;
@@ -263,16 +253,15 @@
 
 /* static */
-HRESULT GuestDirectory::setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
+HRESULT GuestDirectory::i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
 {
     AssertPtr(pInterface);
     AssertMsg(RT_FAILURE(guestRc), ("Guest rc does not indicate a failure when setting error\n"));
 
-    return pInterface->setError(VBOX_E_IPRT_ERROR, GuestDirectory::guestErrorToString(guestRc).c_str());
+    return pInterface->setError(VBOX_E_IPRT_ERROR, GuestDirectory::i_guestErrorToString(guestRc).c_str());
 }
 
 // implementation of public methods
 /////////////////////////////////////////////////////////////////////////////
-
-STDMETHODIMP GuestDirectory::Close(void)
+HRESULT GuestDirectory::close()
 {
 #ifndef VBOX_WITH_GUEST_CONTROL
@@ -319,5 +308,5 @@
 }
 
-STDMETHODIMP GuestDirectory::Read(IFsObjInfo **aInfo)
+HRESULT GuestDirectory::read(ComPtr<IFsObjInfo> &aObjInfo)
 {
 #ifndef VBOX_WITH_GUEST_CONTROL
@@ -370,5 +359,5 @@
                 {
                     /* Return info object to the caller. */
-                    hr2 = pFsObjInfo.queryInterfaceTo(aInfo);
+                    hr2 = pFsObjInfo.queryInterfaceTo(aObjInfo.asOutParam());
                     if (FAILED(hr2))
                         rc = VERR_COM_UNEXPECTED;
Index: /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 50558)
+++ /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 50559)
@@ -2780,5 +2780,5 @@
 
             case VERR_GSTCTL_GUEST_ERROR:
-                hr = GuestDirectory::setErrorExternal(this, guestRc);
+                hr = GuestDirectory::i_setErrorExternal(this, guestRc);
                 break;
 
@@ -2885,5 +2885,5 @@
 
             case VERR_GSTCTL_GUEST_ERROR:
-                hr = GuestDirectory::setErrorExternal(this, guestRc);
+                hr = GuestDirectory::i_setErrorExternal(this, guestRc);
                 break;
 
Index: /trunk/src/VBox/Main/src-client/xpcom/module.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/xpcom/module.cpp	(revision 50558)
+++ /trunk/src/VBox/Main/src-client/xpcom/module.cpp	(revision 50559)
@@ -69,6 +69,4 @@
 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Guest, IGuest)
  #ifdef VBOX_WITH_GUEST_CONTROL
-NS_DECL_CLASSINFO(GuestDirectory)
-NS_IMPL_THREADSAFE_ISUPPORTS2_CI(GuestDirectory, IGuestDirectory, IDirectory)
 NS_DECL_CLASSINFO(GuestFile)
 NS_IMPL_THREADSAFE_ISUPPORTS2_CI(GuestFile, IGuestFile, IFile)
