Index: /trunk/include/VBox/settings.h
===================================================================
--- /trunk/include/VBox/settings.h	(revision 75278)
+++ /trunk/include/VBox/settings.h	(revision 75279)
@@ -549,5 +549,5 @@
 
 /** Map for keeping settings per virtual screen. */
-typedef std::map<unsigned long, CaptureScreenSettings> CaptureScreenMap;
+typedef std::map<uint32_t, CaptureScreenSettings> CaptureScreenMap;
 
 /**
Index: /trunk/src/VBox/Main/include/CaptureScreenSettingsImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/CaptureScreenSettingsImpl.h	(revision 75278)
+++ /trunk/src/VBox/Main/include/CaptureScreenSettingsImpl.h	(revision 75279)
@@ -39,5 +39,5 @@
 
     // public initializer/uninitializer for internal purposes only
-    HRESULT init(Machine *aParent, unsigned long uScreenId, const settings::CaptureScreenSettings& data);
+    HRESULT init(Machine *aParent, uint32_t uScreenId, const settings::CaptureScreenSettings& data);
     HRESULT init(Machine *aParent, CaptureScreenSettings *that);
     HRESULT initCopy(Machine *aParent, CaptureScreenSettings *that);
Index: /trunk/src/VBox/Main/include/CaptureSettingsImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/CaptureSettingsImpl.h	(revision 75278)
+++ /trunk/src/VBox/Main/include/CaptureSettingsImpl.h	(revision 75279)
@@ -68,5 +68,5 @@
 
     /** Map of screen settings objects. The key specifies the screen ID. */
-    typedef std::map <ULONG, ComObjPtr<CaptureScreenSettings> > CaptureScreenSettingsMap;
+    typedef std::map <uint32_t, ComObjPtr<CaptureScreenSettings> > CaptureScreenSettingsMap;
 
     struct Data;
Index: /trunk/src/VBox/Main/src-server/CaptureScreenSettingsImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/CaptureScreenSettingsImpl.cpp	(revision 75278)
+++ /trunk/src/VBox/Main/src-server/CaptureScreenSettingsImpl.cpp	(revision 75279)
@@ -43,5 +43,5 @@
     Machine * const                  pMachine;
     ComObjPtr<CaptureScreenSettings> pPeer;
-    unsigned long                    uScreenId;
+    uint32_t                         uScreenId;
 
     // use the XML settings structure in the members for simplicity
@@ -73,5 +73,5 @@
  * @returns COM result indicator
  */
-HRESULT CaptureScreenSettings::init(Machine *aParent, unsigned long uScreenId, const settings::CaptureScreenSettings &data)
+HRESULT CaptureScreenSettings::init(Machine *aParent, uint32_t uScreenId, const settings::CaptureScreenSettings& data)
 {
     LogFlowThisFuncEnter();
Index: /trunk/src/VBox/Main/src-server/CaptureSettingsImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-server/CaptureSettingsImpl.cpp	(revision 75278)
+++ /trunk/src/VBox/Main/src-server/CaptureSettingsImpl.cpp	(revision 75279)
@@ -292,4 +292,6 @@
     HRESULT rc = S_OK;
 
+    m->mapScreenSettings.clear();
+
     settings::CaptureScreenMap::const_iterator itScreen = data.mapScreens.begin();
     while (itScreen != data.mapScreens.end())
@@ -303,4 +305,6 @@
         if (FAILED(rc))
             break;
+
+        m->mapScreenSettings[itScreen->first] = captureScreenSettings;
 
         ++itScreen;
Index: /trunk/src/VBox/Main/xml/Settings.cpp
===================================================================
--- /trunk/src/VBox/Main/xml/Settings.cpp	(revision 75278)
+++ /trunk/src/VBox/Main/xml/Settings.cpp	(revision 75279)
@@ -2479,5 +2479,5 @@
 
     CaptureScreenSettings screenSettings; /* Apply default settings. */
-    for (unsigned long l = 0; l < SchemaDefs::MaxGuestMonitors; l++)
+    for (uint32_t l = 0; l < SchemaDefs::MaxGuestMonitors; l++)
     {
         mapScreens[l] = screenSettings;
@@ -2517,5 +2517,5 @@
 
     CaptureScreenMap::const_iterator itScreen = mapScreens.begin();
-    unsigned long i = 0;
+    uint32_t i = 0;
     while (itScreen != mapScreens.end())
     {
