Index: /trunk/src/VBox/Main/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/Makefile.kmk	(revision 50547)
+++ /trunk/src/VBox/Main/Makefile.kmk	(revision 50548)
@@ -1031,6 +1031,8 @@
 	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 50547)
+++ /trunk/src/VBox/Main/include/GuestDirectoryImpl.h	(revision 50548)
@@ -20,6 +20,6 @@
 #define ____H_GUESTDIRECTORYIMPL
 
+#include "VirtualBoxBase.h"
 #include "GuestProcessImpl.h"
-#include "GuestDirectoryWrap.h"
 
 class GuestSession;
@@ -29,19 +29,33 @@
  */
 class ATL_NO_VTABLE GuestDirectory :
-    public GuestDirectoryWrap,
-    public GuestObject
+    public VirtualBoxBase,
+    public GuestObject,
+    VBOX_SCRIPTABLE_IMPL(IGuestDirectory)
 {
 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:
@@ -49,23 +63,14 @@
      * @{ */
     int            callbackDispatcher(PVBOXGUESTCTRLHOSTCBCTX pCbCtx, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
+    static Utf8Str guestErrorToString(int guestRc);
     int            onRemove(void);
-
-    static Utf8Str i_guestErrorToString(int guestRc);
-    static HRESULT i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc);
+    static HRESULT setErrorExternal(VirtualBoxBase *pInterface, int guestRc);
     /** @}  */
 
 private:
 
-    /** @name Private Wrapped properties
+    /** @name Private internal methods.
      * @{ */
     /** @}  */
-    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 50547)
+++ /trunk/src/VBox/Main/src-client/GuestDirectoryImpl.cpp	(revision 50548)
@@ -143,25 +143,35 @@
 }
 
-// implementation of private wrapped getters/setters for attributes
+// implementation of public getters/setters for attributes
 /////////////////////////////////////////////////////////////////////////////
 
-HRESULT GuestDirectory::getDirectoryName(com::Utf8Str &aDirectoryName)
-{
-    LogFlowThisFuncEnter();
+STDMETHODIMP GuestDirectory::COMGETTER(DirectoryName)(BSTR *aName)
+{
+    LogFlowThisFuncEnter();
+
+    CheckComArgOutPointerValid(aName);
+
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    aDirectoryName = mData.mOpenInfo.mPath;
+    mData.mOpenInfo.mPath.cloneTo(aName);
 
     return S_OK;
 }
 
-HRESULT GuestDirectory::getFilter(com::Utf8Str &aFilter)
-{
-    LogFlowThisFuncEnter();
+STDMETHODIMP GuestDirectory::COMGETTER(Filter)(BSTR *aFilter)
+{
+    LogFlowThisFuncEnter();
+
+    CheckComArgOutPointerValid(aFilter);
+
+    AutoCaller autoCaller(this);
+    if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    aFilter = mData.mOpenInfo.mFilter;
+    mData.mOpenInfo.mFilter.cloneTo(aFilter);
 
     return S_OK;
@@ -219,5 +229,5 @@
 
 /* static */
-Utf8Str GuestDirectory::i_guestErrorToString(int guestRc)
+Utf8Str GuestDirectory::guestErrorToString(int guestRc)
 {
     Utf8Str strError;
@@ -253,15 +263,16 @@
 
 /* static */
-HRESULT GuestDirectory::i_setErrorExternal(VirtualBoxBase *pInterface, int guestRc)
+HRESULT GuestDirectory::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::i_guestErrorToString(guestRc).c_str());
+    return pInterface->setError(VBOX_E_IPRT_ERROR, GuestDirectory::guestErrorToString(guestRc).c_str());
 }
 
 // implementation of public methods
 /////////////////////////////////////////////////////////////////////////////
-HRESULT GuestDirectory::close()
+
+STDMETHODIMP GuestDirectory::Close(void)
 {
 #ifndef VBOX_WITH_GUEST_CONTROL
@@ -308,5 +319,5 @@
 }
 
-HRESULT GuestDirectory::read(ComPtr<IFsObjInfo> &aObjInfo)
+STDMETHODIMP GuestDirectory::Read(IFsObjInfo **aInfo)
 {
 #ifndef VBOX_WITH_GUEST_CONTROL
@@ -359,5 +370,5 @@
                 {
                     /* Return info object to the caller. */
-                    hr2 = pFsObjInfo.queryInterfaceTo(aObjInfo.asOutParam());
+                    hr2 = pFsObjInfo.queryInterfaceTo(aInfo);
                     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 50547)
+++ /trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp	(revision 50548)
@@ -2780,5 +2780,5 @@
 
             case VERR_GSTCTL_GUEST_ERROR:
-                hr = GuestDirectory::i_setErrorExternal(this, guestRc);
+                hr = GuestDirectory::setErrorExternal(this, guestRc);
                 break;
 
@@ -2885,5 +2885,5 @@
 
             case VERR_GSTCTL_GUEST_ERROR:
-                hr = GuestDirectory::i_setErrorExternal(this, guestRc);
+                hr = GuestDirectory::setErrorExternal(this, guestRc);
                 break;
 
Index: /trunk/src/VBox/Main/src-client/xpcom/module.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/xpcom/module.cpp	(revision 50547)
+++ /trunk/src/VBox/Main/src-client/xpcom/module.cpp	(revision 50548)
@@ -69,4 +69,6 @@
 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)
