Index: trunk/src/VBox/Main/src-server/HostDnsService.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/HostDnsService.cpp	(revision 77910)
+++ trunk/src/VBox/Main/src-server/HostDnsService.cpp	(revision 77984)
@@ -78,32 +78,35 @@
 }
 
-struct HostDnsMonitor::Data
+struct HostDnsServiceBase::Data
 {
     Data(bool aThreaded)
-      : proxy(NULL),
-        fThreaded(aThreaded)
+        : pProxy(NULL)
+        , fThreaded(aThreaded)
     {}
 
-    HostDnsMonitorProxy *proxy;
-
-    const bool fThreaded;
-    RTSEMEVENT hDnsInitEvent;
-    RTTHREAD hMonitoringThread;
-
-    HostDnsInformation info;
+    /** Weak pointer to parent proxy object. */
+    HostDnsMonitorProxy *pProxy;
+    /** Whether the DNS monitor implementation has a dedicated monitoring thread. Optional. */
+    const bool           fThreaded;
+    /** Event for the monitor thread, if any. */
+    RTSEMEVENT           hMonitorThreadEvent;
+    /** Handle of the monitor thread, if any. */
+    RTTHREAD             hMonitorThread;
+    /** Generic host DNS information. */
+    HostDnsInformation   info;
 };
 
 struct HostDnsMonitorProxy::Data
 {
-    Data(HostDnsMonitor *aMonitor, VirtualBox *aParent)
-      : virtualbox(aParent),
-        monitor(aMonitor),
-        uLastExtraDataPoll(0),
-        fLaxComparison(0),
-        info()
+    Data(HostDnsServiceBase *aMonitor, VirtualBox *aParent)
+        : pVirtualBox(aParent)
+        , pMonitorImpl(aMonitor)
+        , uLastExtraDataPoll(0)
+        , fLaxComparison(0)
+        , info()
     {}
 
-    VirtualBox *virtualbox;
-    HostDnsMonitor *monitor;
+    VirtualBox *pVirtualBox;
+    HostDnsServiceBase *pMonitorImpl;
 
     uint64_t uLastExtraDataPoll;
@@ -113,11 +116,11 @@
 
 
-HostDnsMonitor::HostDnsMonitor(bool fThreaded)
-  : m(NULL)
-{
-   m = new HostDnsMonitor::Data(fThreaded);
-}
-
-HostDnsMonitor::~HostDnsMonitor()
+HostDnsServiceBase::HostDnsServiceBase(bool fThreaded)
+    : m(NULL)
+{
+    m = new HostDnsServiceBase::Data(fThreaded);
+}
+
+HostDnsServiceBase::~HostDnsServiceBase()
 {
     if (m)
@@ -128,67 +131,65 @@
 }
 
-HostDnsMonitor *HostDnsMonitor::createHostDnsMonitor()
-{
-    HostDnsMonitor *monitor = NULL;
+HostDnsServiceBase *HostDnsServiceBase::createHostDnsMonitor(void)
+{
+    HostDnsServiceBase *pMonitor = NULL;
 
 #if defined (RT_OS_DARWIN)
-    monitor = new HostDnsServiceDarwin();
+    pMonitor = new HostDnsServiceDarwin();
 #elif defined(RT_OS_WINDOWS)
-    monitor = new HostDnsServiceWin();
+    pMonitor = new HostDnsServiceWin();
 #elif defined(RT_OS_LINUX)
-    monitor = new HostDnsServiceLinux();
+    pMonitor = new HostDnsServiceLinux();
 #elif defined(RT_OS_SOLARIS)
-    monitor =  new HostDnsServiceSolaris();
+    pMonitor =  new HostDnsServiceSolaris();
 #elif defined(RT_OS_FREEBSD)
-    monitor = new HostDnsServiceFreebsd();
+    pMonitor = new HostDnsServiceFreebsd();
 #elif defined(RT_OS_OS2)
-    monitor = new HostDnsServiceOs2();
+    pMonitor = new HostDnsServiceOs2();
 #else
-    monitor = new HostDnsService();
+    pMonitor = new HostDnsServiceBase();
 #endif
 
-    return monitor;
-}
-
-
-void HostDnsMonitor::shutdown()
+    return pMonitor;
+}
+
+void HostDnsServiceBase::shutdown(void)
 {
     monitorThreadShutdown();
-    int rc = RTThreadWait(m->hMonitoringThread, 5000, NULL);
+    int rc = RTThreadWait(m->hMonitorThread, 5000, NULL);
     AssertRCSuccess(rc);
 }
 
 
-void HostDnsMonitor::setInfo(const HostDnsInformation &info)
-{
-    if (m->proxy != NULL)
-        m->proxy->notify(info);
-}
-
-HRESULT HostDnsMonitor::init(HostDnsMonitorProxy *proxy)
-{
-    m->proxy = proxy;
+void HostDnsServiceBase::setInfo(const HostDnsInformation &info)
+{
+    if (m->pProxy != NULL)
+        m->pProxy->notify(info);
+}
+
+HRESULT HostDnsServiceBase::init(HostDnsMonitorProxy *pProxy)
+{
+    m->pProxy = pProxy;
 
     if (m->fThreaded)
     {
-        int rc = RTSemEventCreate(&m->hDnsInitEvent);
+        int rc = RTSemEventCreate(&m->hMonitorThreadEvent);
         AssertRCReturn(rc, E_FAIL);
 
-        rc = RTThreadCreate(&m->hMonitoringThread,
-                            HostDnsMonitor::threadMonitoringRoutine,
+        rc = RTThreadCreate(&m->hMonitorThread,
+                            HostDnsServiceBase::threadMonitoringRoutine,
                             this, 128 * _1K, RTTHREADTYPE_IO,
                             RTTHREADFLAGS_WAITABLE, "dns-monitor");
         AssertRCReturn(rc, E_FAIL);
 
-        RTSemEventWait(m->hDnsInitEvent, RT_INDEFINITE_WAIT);
+        RTSemEventWait(m->hMonitorThreadEvent, RT_INDEFINITE_WAIT);
     }
     return S_OK;
 }
 
-
-void HostDnsMonitorProxy::pollGlobalExtraData()
-{
-    VirtualBox *virtualbox = m->virtualbox;
-    if (RT_UNLIKELY(virtualbox == NULL))
+void HostDnsMonitorProxy::pollGlobalExtraData(void)
+{
+    VirtualBox *pVirtualBox = m->pVirtualBox;
+    if (RT_UNLIKELY(pVirtualBox == NULL))
         return;
 
@@ -203,5 +204,5 @@
         const com::Bstr bstrHostDNSOrderIgnoreKey("VBoxInternal2/HostDNSOrderIgnore");
         com::Bstr bstrHostDNSOrderIgnore;
-        virtualbox->GetExtraData(bstrHostDNSOrderIgnoreKey.raw(),
+        pVirtualBox->GetExtraData(bstrHostDNSOrderIgnoreKey.raw(),
                                  bstrHostDNSOrderIgnore.asOutParam());
         uint32_t fDNSOrderIgnore = 0;
@@ -226,5 +227,5 @@
         const com::Bstr bstrHostDNSSuffixesIgnoreKey("VBoxInternal2/HostDNSSuffixesIgnore");
         com::Bstr bstrHostDNSSuffixesIgnore;
-        virtualbox->GetExtraData(bstrHostDNSSuffixesIgnoreKey.raw(),
+        pVirtualBox->GetExtraData(bstrHostDNSSuffixesIgnoreKey.raw(),
                                  bstrHostDNSSuffixesIgnore.asOutParam());
         uint32_t fDNSSuffixesIgnore = 0;
@@ -246,13 +247,12 @@
 }
 
-void HostDnsMonitor::monitorThreadInitializationDone()
-{
-    RTSemEventSignal(m->hDnsInitEvent);
-}
-
-
-DECLCALLBACK(int) HostDnsMonitor::threadMonitoringRoutine(RTTHREAD, void *pvUser)
-{
-    HostDnsMonitor *pThis = static_cast<HostDnsMonitor *>(pvUser);
+void HostDnsServiceBase::monitorThreadInitializationDone(void)
+{
+    RTSemEventSignal(m->hMonitorThreadEvent);
+}
+
+DECLCALLBACK(int) HostDnsServiceBase::threadMonitoringRoutine(RTTHREAD, void *pvUser)
+{
+    HostDnsServiceBase *pThis = static_cast<HostDnsServiceBase *>(pvUser);
     return pThis->monitorWorker();
 }
@@ -271,15 +271,14 @@
 void HostDnsMonitorProxy::init(VirtualBox* aParent)
 {
-    HostDnsMonitor *monitor = HostDnsMonitor::createHostDnsMonitor();
-    m = new HostDnsMonitorProxy::Data(monitor, aParent);
-    m->monitor->init(this);
-}
-
-
-void HostDnsMonitorProxy::uninit()
+    HostDnsServiceBase *pMonitor = HostDnsServiceBase::createHostDnsMonitor();
+    m = new HostDnsMonitorProxy::Data(pMonitor, aParent);
+    m->pMonitorImpl->init(this);
+}
+
+void HostDnsMonitorProxy::uninit(void)
 {
     if (m)
     {
-        m->monitor->shutdown();
+        m->pMonitorImpl->shutdown();
         delete m;
         m = NULL;
@@ -291,5 +290,5 @@
     bool fNotify = updateInfo(info);
     if (fNotify)
-        m->virtualbox->i_onHostNameResolutionConfigurationChange();
+        m->pVirtualBox->i_onHostNameResolutionConfigurationChange();
 }
 
@@ -362,5 +361,4 @@
     return true;
 }
-
 
 static void dumpHostDnsInformation(const HostDnsInformation& info)
Index: trunk/src/VBox/Main/src-server/HostDnsService.h
===================================================================
--- trunk/src/VBox/Main/src-server/HostDnsService.h	(revision 77910)
+++ trunk/src/VBox/Main/src-server/HostDnsService.h	(revision 77984)
@@ -52,19 +52,21 @@
  * it lifecycle starts and ends together with VBoxSVC.
  */
-class HostDnsMonitor
-{
-    DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(HostDnsMonitor);
-
-  public:
-    static HostDnsMonitor *createHostDnsMonitor();
+class HostDnsServiceBase
+{
+    DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(HostDnsServiceBase);
+
+public:
+  
+    static HostDnsServiceBase *createHostDnsMonitor(void);
     void shutdown();
 
     /* @note: method will wait till client call
        HostDnsService::monitorThreadInitializationDone() */
-    virtual HRESULT init(HostDnsMonitorProxy *proxy);
-
-  protected:
-    explicit HostDnsMonitor(bool fThreaded = false);
-    virtual ~HostDnsMonitor();
+    virtual HRESULT init(HostDnsMonitorProxy *pProxy);
+
+protected:
+
+    explicit HostDnsServiceBase(bool fThreaded = false);
+    virtual ~HostDnsServiceBase();
 
     void setInfo(const HostDnsInformation &);
@@ -75,11 +77,14 @@
     virtual int monitorWorker() = 0;
 
-  private:
+private:
+
     static DECLCALLBACK(int) threadMonitoringRoutine(RTTHREAD, void *);
 
-  protected:
+protected:
+
     mutable RTCLockMtx m_LockMtx;
 
-  public:
+public: /** @todo r=andy Why is this public? */
+
     struct Data;
     Data *m;
@@ -91,7 +96,11 @@
 class HostDnsMonitorProxy
 {
-    public:
+public:
+
     HostDnsMonitorProxy();
-    ~HostDnsMonitorProxy();
+    virtual ~HostDnsMonitorProxy();
+
+public:
+
     void init(VirtualBox *virtualbox);
     void uninit();
@@ -102,12 +111,13 @@
     HRESULT GetSearchStrings(std::vector<com::Utf8Str> &aSearchStrings);
 
-  private:
+private:
+
     void pollGlobalExtraData();
     bool updateInfo(const HostDnsInformation &info);
 
-  private:
+private:
+
     mutable RTCLockMtx m_LockMtx;
 
-    private:
     struct Data;
     Data *m;
@@ -115,35 +125,45 @@
 
 # if defined(RT_OS_DARWIN) || defined(DOXYGEN_RUNNING)
-class HostDnsServiceDarwin : public HostDnsMonitor
-{
-  public:
+class HostDnsServiceDarwin : public HostDnsServiceBase
+{
+public:
     HostDnsServiceDarwin();
-    ~HostDnsServiceDarwin();
-    virtual HRESULT init(HostDnsMonitorProxy *proxy);
-
-    protected:
+    virtual ~HostDnsServiceDarwin();
+
+public:
+
+    virtual HRESULT init(HostDnsMonitorProxy *pProxy);
+
+protected:
+
+  virtual void monitorThreadShutdown();
+    virtual int monitorWorker();
+
+private:
+
+    HRESULT updateInfo();
+    static void hostDnsServiceStoreCallback(void *store, void *arrayRef, void *info);
+    struct Data;
+    Data *m;
+};
+# endif
+# if defined(RT_OS_WINDOWS) || defined(DOXYGEN_RUNNING)
+class HostDnsServiceWin : public HostDnsServiceBase
+{
+public:
+    HostDnsServiceWin();
+    virtual ~HostDnsServiceWin();
+
+public:
+
+    virtual HRESULT init(HostDnsMonitorProxy *pProxy);
+
+protected:
+
     virtual void monitorThreadShutdown();
     virtual int monitorWorker();
 
-    private:
-    HRESULT updateInfo();
-    static void hostDnsServiceStoreCallback(void *store, void *arrayRef, void *info);
-    struct Data;
-    Data *m;
-};
-# endif
-# if defined(RT_OS_WINDOWS) || defined(DOXYGEN_RUNNING)
-class HostDnsServiceWin : public HostDnsMonitor
-{
-    public:
-    HostDnsServiceWin();
-    ~HostDnsServiceWin();
-    virtual HRESULT init(HostDnsMonitorProxy *proxy);
-
-    protected:
-    virtual void monitorThreadShutdown();
-    virtual int monitorWorker();
-
-    private:
+private:
+
     HRESULT updateInfo();
 
@@ -155,13 +175,18 @@
 # if defined(RT_OS_SOLARIS) || defined(RT_OS_LINUX) || defined(RT_OS_OS2) || defined(RT_OS_FREEBSD) \
     || defined(DOXYGEN_RUNNING)
-class HostDnsServiceResolvConf: public HostDnsMonitor
-{
-  public:
-    explicit HostDnsServiceResolvConf(bool fThreaded = false) : HostDnsMonitor(fThreaded), m(NULL) {}
+class HostDnsServiceResolvConf: public HostDnsServiceBase
+{
+public:
+
+    explicit HostDnsServiceResolvConf(bool fThreaded = false) : HostDnsServiceBase(fThreaded), m(NULL) {}
     virtual ~HostDnsServiceResolvConf();
-    virtual HRESULT init(HostDnsMonitorProxy *proxy, const char *aResolvConfFileName);
+
+public:
+
+    virtual HRESULT init(HostDnsMonitorProxy *pProxy, const char *aResolvConfFileName);
     const std::string& resolvConf() const;
 
-  protected:
+protected:
+
     HRESULT readResolvConf();
     /* While not all hosts supports Hosts DNS change notifiaction
@@ -171,5 +196,6 @@
     virtual int monitorWorker() {return VERR_IGNORED;}
 
-  protected:
+protected:
+
     struct Data;
     Data *m;
@@ -181,9 +207,13 @@
 class HostDnsServiceSolaris : public HostDnsServiceResolvConf
 {
-  public:
+public:
+
     HostDnsServiceSolaris(){}
-    ~HostDnsServiceSolaris(){}
-    virtual HRESULT init(HostDnsMonitorProxy *proxy) {
-        return HostDnsServiceResolvConf::init(proxy, "/etc/resolv.conf");
+    virtual ~HostDnsServiceSolaris(){}
+
+public:
+
+    virtual HRESULT init(HostDnsMonitorProxy *pProxy) {
+        return HostDnsServiceResolvConf::init(pProxy, "/etc/resolv.conf");
     }
 };
@@ -193,12 +223,17 @@
 class HostDnsServiceLinux : public HostDnsServiceResolvConf
 {
-  public:
-    HostDnsServiceLinux():HostDnsServiceResolvConf(true){}
-    virtual ~HostDnsServiceLinux();
-    virtual HRESULT init(HostDnsMonitorProxy *proxy) {
-        return HostDnsServiceResolvConf::init(proxy, "/etc/resolv.conf");
-    }
-
-  protected:
+public:
+
+  HostDnsServiceLinux() : HostDnsServiceResolvConf(true) {}
+  virtual ~HostDnsServiceLinux();
+
+public:
+
+    virtual HRESULT init(HostDnsMonitorProxy *pProxy) {
+        return HostDnsServiceResolvConf::init(pProxy, "/etc/resolv.conf");
+    }
+
+protected:
+
     virtual void monitorThreadShutdown();
     virtual int monitorWorker();
@@ -209,9 +244,13 @@
 class HostDnsServiceFreebsd: public HostDnsServiceResolvConf
 {
-    public:
+public:
+
     HostDnsServiceFreebsd(){}
-    ~HostDnsServiceFreebsd(){}
-    virtual HRESULT init(HostDnsMonitorProxy *proxy) {
-        return HostDnsServiceResolvConf::init(proxy, "/etc/resolv.conf");
+    virtual ~HostDnsServiceFreebsd() {}
+
+public:
+
+    virtual HRESULT init(HostDnsMonitorProxy *pProxy) {
+        return HostDnsServiceResolvConf::init(pProxy, "/etc/resolv.conf");
     }
 };
@@ -221,10 +260,14 @@
 class HostDnsServiceOs2 : public HostDnsServiceResolvConf
 {
-  public:
-    HostDnsServiceOs2(){}
-    ~HostDnsServiceOs2(){}
+public:
+
+    HostDnsServiceOs2() {}
+    virtual ~HostDnsServiceOs2() {}
+
+public:
+
     /* XXX: \\MPTN\\ETC should be taken from environment variable ETC  */
-    virtual HRESULT init(HostDnsMonitorProxy *proxy) {
-        return HostDnsServiceResolvConf::init(proxy, "\\MPTN\\ETC\\RESOLV2");
+    virtual HRESULT init(HostDnsMonitorProxy *pProxy) {
+        return HostDnsServiceResolvConf::init(pProxy, "\\MPTN\\ETC\\RESOLV2");
     }
 };
Index: trunk/src/VBox/Main/src-server/HostDnsServiceResolvConf.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/HostDnsServiceResolvConf.cpp	(revision 77910)
+++ trunk/src/VBox/Main/src-server/HostDnsServiceResolvConf.cpp	(revision 77984)
@@ -55,5 +55,5 @@
 };
 
-const std::string& HostDnsServiceResolvConf::resolvConf() const
+const std::string& HostDnsServiceResolvConf::resolvConf(void) const
 {
     return m->resolvConfFilename;
@@ -70,9 +70,9 @@
 }
 
-HRESULT HostDnsServiceResolvConf::init(HostDnsMonitorProxy *proxy, const char *aResolvConfFileName)
+HRESULT HostDnsServiceResolvConf::init(HostDnsMonitorProxy *pProxy, const char *aResolvConfFileName)
 {
     m = new Data(aResolvConfFileName);
 
-    HostDnsMonitor::init(proxy);
+    HostDnsServiceBase::init(pProxy);
 
     readResolvConf();
@@ -81,6 +81,5 @@
 }
 
-
-HRESULT HostDnsServiceResolvConf::readResolvConf()
+HRESULT HostDnsServiceResolvConf::readResolvConf(void)
 {
     struct rcp_state st;
Index: trunk/src/VBox/Main/src-server/darwin/HostDnsServiceDarwin.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/darwin/HostDnsServiceDarwin.cpp	(revision 77910)
+++ trunk/src/VBox/Main/src-server/darwin/HostDnsServiceDarwin.cpp	(revision 77984)
@@ -51,5 +51,7 @@
 
 
-HostDnsServiceDarwin::HostDnsServiceDarwin():HostDnsMonitor(true),m(NULL)
+HostDnsServiceDarwin::HostDnsServiceDarwin()
+    : HostDnsServiceBase(true)
+    , m(NULL)
 {
     m = new HostDnsServiceDarwin::Data();
@@ -86,5 +88,5 @@
 
 
-HRESULT HostDnsServiceDarwin::init(HostDnsMonitorProxy *proxy)
+HRESULT HostDnsServiceDarwin::init(HostDnsMonitorProxy *pProxy)
 {
     SCDynamicStoreContext ctx;
@@ -94,6 +96,6 @@
 
     m->m_store = SCDynamicStoreCreate(NULL, CFSTR("org.virtualbox.VBoxSVC"),
-                                   (SCDynamicStoreCallBack)HostDnsServiceDarwin::hostDnsServiceStoreCallback,
-                                   &ctx);
+                                      (SCDynamicStoreCallBack)HostDnsServiceDarwin::hostDnsServiceStoreCallback,
+                                      &ctx);
     AssertReturn(m->m_store, E_FAIL);
 
@@ -111,5 +113,5 @@
     AssertReturn(m->m_Stopper, E_FAIL);
 
-    HRESULT hrc = HostDnsMonitor::init(proxy);
+    HRESULT hrc = HostDnsServiceBase::init(pProxy);
     AssertComRCReturn(hrc, hrc);
 
@@ -118,5 +120,5 @@
 
 
-void HostDnsServiceDarwin::monitorThreadShutdown()
+void HostDnsServiceDarwin::monitorThreadShutdown(void)
 {
     RTCLock grab(m_LockMtx);
@@ -132,5 +134,5 @@
 
 
-int HostDnsServiceDarwin::monitorWorker()
+int HostDnsServiceDarwin::monitorWorker(void)
 {
     m->m_RunLoopRef = CFRunLoopGetCurrent();
@@ -168,6 +170,5 @@
 }
 
-
-HRESULT HostDnsServiceDarwin::updateInfo()
+HRESULT HostDnsServiceDarwin::updateInfo(void)
 {
     CFPropertyListRef propertyRef = SCDynamicStoreCopyValue(m->m_store,
@@ -254,7 +255,7 @@
 }
 
-void HostDnsServiceDarwin::Data::performShutdownCallback(void *info)
-{
-    HostDnsServiceDarwin::Data *pThis = static_cast<HostDnsServiceDarwin::Data *>(info);
+void HostDnsServiceDarwin::Data::performShutdownCallback(void *pInfo)
+{
+    HostDnsServiceDarwin::Data *pThis = static_cast<HostDnsServiceDarwin::Data *>(pInfo);
     AssertPtrReturnVoid(pThis);
     pThis->m_fStop = true;
Index: trunk/src/VBox/Main/src-server/linux/HostDnsServiceLinux.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/linux/HostDnsServiceLinux.cpp	(revision 77910)
+++ trunk/src/VBox/Main/src-server/linux/HostDnsServiceLinux.cpp	(revision 77984)
@@ -94,5 +94,5 @@
 
 
-int HostDnsServiceLinux::monitorWorker()
+int HostDnsServiceLinux::monitorWorker(void)
 {
 
@@ -151,5 +151,5 @@
             RT_ZERO(combo);
             ssize_t r = read(polls[0].fd, static_cast<void *>(&combo), sizeof(combo));
-            NOREF(r);
+            RT_NOREF(r);
 
             if (combo.e.wd == wd[0])
Index: trunk/src/VBox/Main/src-server/win/HostDnsServiceWin.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/win/HostDnsServiceWin.cpp	(revision 77910)
+++ trunk/src/VBox/Main/src-server/win/HostDnsServiceWin.cpp	(revision 77984)
@@ -87,5 +87,5 @@
 
 
-HRESULT HostDnsServiceWin::init(HostDnsMonitorProxy *proxy)
+HRESULT HostDnsServiceWin::init(HostDnsMonitorProxy *pProxy)
 {
     if (m == NULL)
@@ -129,5 +129,5 @@
     }
 
-    HRESULT hrc = HostDnsMonitor::init(proxy);
+    HRESULT hrc = HostDnsServiceBase::init(pProxy);
     if (FAILED(hrc))
         return hrc;
@@ -248,5 +248,5 @@
 
 
-HRESULT HostDnsServiceWin::updateInfo()
+HRESULT HostDnsServiceWin::updateInfo(void)
 {
     HostDnsInformation info;
@@ -471,5 +471,5 @@
         info.searchList.clear();
 
-    HostDnsMonitor::setInfo(info);
+    HostDnsServiceBase::setInfo(info);
 
     return S_OK;
