Index: trunk/src/VBox/Main/include/DHCPServerImpl.h
===================================================================
--- trunk/src/VBox/Main/include/DHCPServerImpl.h	(revision 49617)
+++ trunk/src/VBox/Main/include/DHCPServerImpl.h	(revision 49618)
@@ -125,23 +125,9 @@
 
 private:
+    struct Data;
+    Data *m;
     /** weak VirtualBox parent */
     VirtualBox * const      mVirtualBox;
-
     const Bstr mName;
-
-    struct Data
-    {
-        Data() : enabled(FALSE) {}
-
-        Bstr IPAddress;
-        Bstr lowerIP;
-        Bstr upperIP;
-
-        BOOL enabled;
-        DHCPServerRunner dhcp;
-
-        DhcpOptionMap GlobalDhcpOptions;
-        VmSlot2OptionsMap VmSlot2Options;
-    } m;
 
     DhcpOptionMap& findOptMapByVmNameSlot(const com::Utf8Str& aVmName,
Index: trunk/src/VBox/Main/src-server/DHCPServerImpl.cpp
===================================================================
--- trunk/src/VBox/Main/src-server/DHCPServerImpl.cpp	(revision 49617)
+++ trunk/src/VBox/Main/src-server/DHCPServerImpl.cpp	(revision 49618)
@@ -38,7 +38,24 @@
 
 
+struct DHCPServer::Data
+{
+    Data() : enabled(FALSE) {}
+
+    Bstr IPAddress;
+    Bstr lowerIP;
+    Bstr upperIP;
+
+    BOOL enabled;
+    DHCPServerRunner dhcp;
+
+    DhcpOptionMap GlobalDhcpOptions;
+    VmSlot2OptionsMap VmSlot2Options;
+};
+
+
 DHCPServer::DHCPServer()
-    : mVirtualBox(NULL)
-{
+  : m(NULL), mVirtualBox(NULL)
+{
+    m = new DHCPServer::Data();
 }
 
@@ -46,4 +63,9 @@
 DHCPServer::~DHCPServer()
 {
+    if (m)
+    {
+        delete m;
+        m = NULL;
+    }
 }
 
@@ -85,10 +107,10 @@
 
     unconst(mName) = aName;
-    m.IPAddress = "0.0.0.0";
-    m.GlobalDhcpOptions.insert(DhcpOptValuePair(DhcpOpt_SubnetMask, Bstr("0.0.0.0")));
-    m.enabled = FALSE;
-
-    m.lowerIP = "0.0.0.0";
-    m.upperIP = "0.0.0.0";
+    m->IPAddress = "0.0.0.0";
+    m->GlobalDhcpOptions.insert(DhcpOptValuePair(DhcpOpt_SubnetMask, Bstr("0.0.0.0")));
+    m->enabled = FALSE;
+
+    m->lowerIP = "0.0.0.0";
+    m->upperIP = "0.0.0.0";
 
     /* Confirm a successful initialization */
@@ -110,15 +132,15 @@
 
     unconst(mName) = data.strNetworkName;
-    m.IPAddress = data.strIPAddress;
-    m.enabled = data.fEnabled;
-    m.lowerIP = data.strIPLower;
-    m.upperIP = data.strIPUpper;
-
-    m.GlobalDhcpOptions.clear();
-    m.GlobalDhcpOptions.insert(data.GlobalDhcpOptions.begin(),
+    m->IPAddress = data.strIPAddress;
+    m->enabled = data.fEnabled;
+    m->lowerIP = data.strIPLower;
+    m->upperIP = data.strIPUpper;
+
+    m->GlobalDhcpOptions.clear();
+    m->GlobalDhcpOptions.insert(data.GlobalDhcpOptions.begin(),
                                data.GlobalDhcpOptions.end());
 
-    m.VmSlot2Options.clear();
-    m.VmSlot2Options.insert(data.VmSlot2OptionsM.begin(),
+    m->VmSlot2Options.clear();
+    m->VmSlot2Options.insert(data.VmSlot2OptionsM.begin(),
                             data.VmSlot2OptionsM.end());
 
@@ -137,17 +159,17 @@
 
     data.strNetworkName = mName;
-    data.strIPAddress = m.IPAddress;
-
-    data.fEnabled = !!m.enabled;
-    data.strIPLower = m.lowerIP;
-    data.strIPUpper = m.upperIP;
+    data.strIPAddress = m->IPAddress;
+
+    data.fEnabled = !!m->enabled;
+    data.strIPLower = m->lowerIP;
+    data.strIPUpper = m->upperIP;
 
     data.GlobalDhcpOptions.clear();
-    data.GlobalDhcpOptions.insert(m.GlobalDhcpOptions.begin(),
-                                  m.GlobalDhcpOptions.end());
+    data.GlobalDhcpOptions.insert(m->GlobalDhcpOptions.begin(),
+                                  m->GlobalDhcpOptions.end());
 
     data.VmSlot2OptionsM.clear();
-    data.VmSlot2OptionsM.insert(m.VmSlot2Options.begin(),
-                                m.VmSlot2Options.end());
+    data.VmSlot2OptionsM.insert(m->VmSlot2Options.begin(),
+                                m->VmSlot2Options.end());
 
     return S_OK;
@@ -175,5 +197,5 @@
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
-    *aEnabled = m.enabled;
+    *aEnabled = m->enabled;
 
     return S_OK;
@@ -187,5 +209,5 @@
 
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
-    m.enabled = aEnabled;
+    m->enabled = aEnabled;
 
     // save the global settings; for that we should hold only the VirtualBox lock
@@ -205,5 +227,5 @@
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
-    m.IPAddress.cloneTo(aIPAddress);
+    m->IPAddress.cloneTo(aIPAddress);
 
     return S_OK;
@@ -218,5 +240,5 @@
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
-    m.GlobalDhcpOptions[DhcpOpt_SubnetMask].cloneTo(aNetworkMask);
+    m->GlobalDhcpOptions[DhcpOpt_SubnetMask].cloneTo(aNetworkMask);
 
     return S_OK;
@@ -231,5 +253,5 @@
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
-    m.lowerIP.cloneTo(aIPAddress);
+    m->lowerIP.cloneTo(aIPAddress);
 
     return S_OK;
@@ -244,5 +266,5 @@
     if (FAILED(autoCaller.rc())) return autoCaller.rc();
 
-    m.upperIP.cloneTo(aIPAddress);
+    m->upperIP.cloneTo(aIPAddress);
 
     return S_OK;
@@ -261,9 +283,9 @@
 
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
-    m.IPAddress = aIPAddress;
-    m.GlobalDhcpOptions[DhcpOpt_SubnetMask] = aNetworkMask;
-
-    m.lowerIP = aLowerIP;
-    m.upperIP = aUpperIP;
+    m->IPAddress = aIPAddress;
+    m->GlobalDhcpOptions[DhcpOpt_SubnetMask] = aNetworkMask;
+
+    m->lowerIP = aLowerIP;
+    m->upperIP = aUpperIP;
 
     // save the global settings; for that we should hold only the VirtualBox lock
@@ -283,10 +305,10 @@
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    m.GlobalDhcpOptions.insert(
+    m->GlobalDhcpOptions.insert(
       DhcpOptValuePair(aOption, Utf8Str(aValue)));
 
     /* Indirect way to understand that we're on NAT network */
     if (aOption == DhcpOpt_Router)
-        m.dhcp.setOption(NetworkServiceRunner::kNsrKeyNeedMain, "on");
+        m->dhcp.setOption(NetworkServiceRunner::kNsrKeyNeedMain, "on");
 
     alock.release();
@@ -306,9 +328,9 @@
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    SafeArray<BSTR> sf(m.GlobalDhcpOptions.size());
+    SafeArray<BSTR> sf(m->GlobalDhcpOptions.size());
     int i = 0;
 
-    for (DhcpOptIterator it = m.GlobalDhcpOptions.begin();
-         it != m.GlobalDhcpOptions.end(); ++it)
+    for (DhcpOptIterator it = m->GlobalDhcpOptions.begin();
+         it != m->GlobalDhcpOptions.end(); ++it)
     {
         Bstr(Utf8StrFmt("%d:%s", (*it).first, (*it).second.c_str())).detachTo(&sf[i]);
@@ -331,8 +353,8 @@
     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    SafeArray<BSTR> sf(m.VmSlot2Options.size());
-    VmSlot2OptionsIterator it = m.VmSlot2Options.begin();
+    SafeArray<BSTR> sf(m->VmSlot2Options.size());
+    VmSlot2OptionsIterator it = m->VmSlot2Options.begin();
     int i = 0;
-    for (;it != m.VmSlot2Options.end(); ++it)
+    for (;it != m->VmSlot2Options.end(); ++it)
     {
         Bstr(Utf8StrFmt("[%s]:%d",
@@ -354,5 +376,5 @@
     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
 
-    m.VmSlot2Options[settings::VmNameSlotKey(
+    m->VmSlot2Options[settings::VmNameSlotKey(
           com::Utf8Str(aVmName),
           aSlot)][aOption] = com::Utf8Str(aValue);
@@ -428,6 +450,6 @@
 
     VmSlot2OptionsIterator it;
-    for(it = m.VmSlot2Options.begin();
-        it != m.VmSlot2Options.end();
+    for(it = m->VmSlot2Options.begin();
+        it != m->VmSlot2Options.end();
         ++it)
     {
@@ -476,15 +498,15 @@
 {
     /* Silently ignore attempts to run disabled servers. */
-    if (!m.enabled)
+    if (!m->enabled)
         return S_OK;
 
     /* Commmon Network Settings */
-    m.dhcp.setOption(NetworkServiceRunner::kNsrKeyNetwork, Utf8Str(aNetworkName).c_str());
+    m->dhcp.setOption(NetworkServiceRunner::kNsrKeyNetwork, Utf8Str(aNetworkName).c_str());
 
     Bstr tmp(aTrunkName);
 
     if (!tmp.isEmpty())
-        m.dhcp.setOption(NetworkServiceRunner::kNsrTrunkName, Utf8Str(tmp).c_str());
-    m.dhcp.setOption(NetworkServiceRunner::kNsrKeyTrunkType, Utf8Str(aTrunkType).c_str());
+        m->dhcp.setOption(NetworkServiceRunner::kNsrTrunkName, Utf8Str(tmp).c_str());
+    m->dhcp.setOption(NetworkServiceRunner::kNsrKeyTrunkType, Utf8Str(aTrunkType).c_str());
 
     /* XXX: should this MAC default initialization moved to NetworkServiceRunner? */
@@ -496,13 +518,13 @@
                  guid.raw()->au8[1],
                  guid.raw()->au8[2]);
-    m.dhcp.setOption(NetworkServiceRunner::kNsrMacAddress, strMAC);
-    m.dhcp.setOption(NetworkServiceRunner::kNsrIpAddress,  Utf8Str(m.IPAddress).c_str());
-    m.dhcp.setOption(NetworkServiceRunner::kNsrIpNetmask, Utf8Str(m.GlobalDhcpOptions[DhcpOpt_SubnetMask]).c_str());
-    m.dhcp.setOption(DHCPServerRunner::kDsrKeyLowerIp, Utf8Str(m.lowerIP).c_str());
-    m.dhcp.setOption(DHCPServerRunner::kDsrKeyUpperIp, Utf8Str(m.upperIP).c_str());
+    m->dhcp.setOption(NetworkServiceRunner::kNsrMacAddress, strMAC);
+    m->dhcp.setOption(NetworkServiceRunner::kNsrIpAddress,  Utf8Str(m->IPAddress).c_str());
+    m->dhcp.setOption(NetworkServiceRunner::kNsrIpNetmask, Utf8Str(m->GlobalDhcpOptions[DhcpOpt_SubnetMask]).c_str());
+    m->dhcp.setOption(DHCPServerRunner::kDsrKeyLowerIp, Utf8Str(m->lowerIP).c_str());
+    m->dhcp.setOption(DHCPServerRunner::kDsrKeyUpperIp, Utf8Str(m->upperIP).c_str());
 
     /* XXX: This parameters Dhcp Server will fetch via API */
-    return RT_FAILURE(m.dhcp.start()) ? E_FAIL : S_OK;
-    //m.dhcp.detachFromServer(); /* need to do this to avoid server shutdown on runner destruction */
+    return RT_FAILURE(m->dhcp.start()) ? E_FAIL : S_OK;
+    //m->dhcp.detachFromServer(); /* need to do this to avoid server shutdown on runner destruction */
 }
 
@@ -510,5 +532,5 @@
 STDMETHODIMP DHCPServer::Stop (void)
 {
-    return RT_FAILURE(m.dhcp.stop()) ? E_FAIL : S_OK;
+    return RT_FAILURE(m->dhcp.stop()) ? E_FAIL : S_OK;
 }
 
@@ -517,5 +539,5 @@
                                                   LONG aSlot)
 {
-    return m.VmSlot2Options[settings::VmNameSlotKey(
+    return m->VmSlot2Options[settings::VmNameSlotKey(
           com::Utf8Str(aVmName),
           aSlot)];
