Index: /trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
===================================================================
--- /trunk/src/VBox/Devices/VMMDev/VMMDev.cpp	(revision 30849)
+++ /trunk/src/VBox/Devices/VMMDev/VMMDev.cpp	(revision 30850)
@@ -1638,7 +1638,7 @@
                 if (credentials->u32Flags & VMMDEV_CREDENTIALS_QUERYPRESENCE)
                 {
-                    if (   pThis->credentialsLogon.szUserName[0]
-                        || pThis->credentialsLogon.szPassword[0]
-                        || pThis->credentialsLogon.szDomain[0])
+                    if (   pThis->pCredentials->Logon.szUserName[0]
+                        || pThis->pCredentials->Logon.szPassword[0]
+                        || pThis->pCredentials->Logon.szDomain[0])
                     {
                         credentials->u32Flags |= VMMDEV_CREDENTIALS_PRESENT;
@@ -1653,11 +1653,11 @@
                 if (credentials->u32Flags & VMMDEV_CREDENTIALS_READ)
                 {
-                    if (pThis->credentialsLogon.szUserName[0])
-                        strcpy(credentials->szUserName, pThis->credentialsLogon.szUserName);
-                    if (pThis->credentialsLogon.szPassword[0])
-                        strcpy(credentials->szPassword, pThis->credentialsLogon.szPassword);
-                    if (pThis->credentialsLogon.szDomain[0])
-                        strcpy(credentials->szDomain, pThis->credentialsLogon.szDomain);
-                    if (!pThis->credentialsLogon.fAllowInteractiveLogon)
+                    if (pThis->pCredentials->Logon.szUserName[0])
+                        strcpy(credentials->szUserName, pThis->pCredentials->Logon.szUserName);
+                    if (pThis->pCredentials->Logon.szPassword[0])
+                        strcpy(credentials->szPassword, pThis->pCredentials->Logon.szPassword);
+                    if (pThis->pCredentials->Logon.szDomain[0])
+                        strcpy(credentials->szDomain, pThis->pCredentials->Logon.szDomain);
+                    if (!pThis->pCredentials->Logon.fAllowInteractiveLogon)
                         credentials->u32Flags |= VMMDEV_CREDENTIALS_NOLOCALLOGON;
                     else
@@ -1670,7 +1670,7 @@
                     if (credentials->u32Flags & VMMDEV_CREDENTIALS_CLEAR)
                     {
-                        memset(pThis->credentialsLogon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
-                        memset(pThis->credentialsLogon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
-                        memset(pThis->credentialsLogon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
+                        memset(pThis->pCredentials->Logon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
+                        memset(pThis->pCredentials->Logon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
+                        memset(pThis->pCredentials->Logon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
                     }
                 }
@@ -1679,10 +1679,10 @@
                 if (credentials->u32Flags & VMMDEV_CREDENTIALS_READJUDGE)
                 {
-                    if (pThis->credentialsJudge.szUserName[0])
-                        strcpy(credentials->szUserName, pThis->credentialsJudge.szUserName);
-                    if (pThis->credentialsJudge.szPassword[0])
-                        strcpy(credentials->szPassword, pThis->credentialsJudge.szPassword);
-                    if (pThis->credentialsJudge.szDomain[0])
-                        strcpy(credentials->szDomain, pThis->credentialsJudge.szDomain);
+                    if (pThis->pCredentials->Judge.szUserName[0])
+                        strcpy(credentials->szUserName, pThis->pCredentials->Judge.szUserName);
+                    if (pThis->pCredentials->Judge.szPassword[0])
+                        strcpy(credentials->szPassword, pThis->pCredentials->Judge.szPassword);
+                    if (pThis->pCredentials->Judge.szDomain[0])
+                        strcpy(credentials->szDomain, pThis->pCredentials->Judge.szDomain);
                 }
 
@@ -1690,7 +1690,7 @@
                 if (credentials->u32Flags & VMMDEV_CREDENTIALS_CLEARJUDGE)
                 {
-                    memset(pThis->credentialsJudge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
-                    memset(pThis->credentialsJudge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
-                    memset(pThis->credentialsJudge.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
+                    memset(pThis->pCredentials->Judge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
+                    memset(pThis->pCredentials->Judge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
+                    memset(pThis->pCredentials->Judge.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
                 }
 
@@ -2336,8 +2336,8 @@
     {
         /* memorize the data */
-        strcpy(pThis->credentialsLogon.szUserName, pszUsername);
-        strcpy(pThis->credentialsLogon.szPassword, pszPassword);
-        strcpy(pThis->credentialsLogon.szDomain,   pszDomain);
-        pThis->credentialsLogon.fAllowInteractiveLogon = !(u32Flags & VMMDEV_SETCREDENTIALS_NOLOCALLOGON);
+        strcpy(pThis->pCredentials->Logon.szUserName, pszUsername);
+        strcpy(pThis->pCredentials->Logon.szPassword, pszPassword);
+        strcpy(pThis->pCredentials->Logon.szDomain,   pszDomain);
+        pThis->pCredentials->Logon.fAllowInteractiveLogon = !(u32Flags & VMMDEV_SETCREDENTIALS_NOLOCALLOGON);
     }
     /* credentials verification mode? */
@@ -2345,7 +2345,7 @@
     {
         /* memorize the data */
-        strcpy(pThis->credentialsJudge.szUserName, pszUsername);
-        strcpy(pThis->credentialsJudge.szPassword, pszPassword);
-        strcpy(pThis->credentialsJudge.szDomain,   pszDomain);
+        strcpy(pThis->pCredentials->Judge.szUserName, pszUsername);
+        strcpy(pThis->pCredentials->Judge.szPassword, pszPassword);
+        strcpy(pThis->pCredentials->Judge.szDomain,   pszDomain);
 
         VMMDevNotifyGuest (pThis, VMMDEV_EVENT_JUDGE_CREDENTIALS);
@@ -2682,11 +2682,11 @@
     if (!pThis->fKeepCredentials)
     {
-        memset(pThis->credentialsLogon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
-        memset(pThis->credentialsLogon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
-        memset(pThis->credentialsLogon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
-    }
-    memset(pThis->credentialsJudge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
-    memset(pThis->credentialsJudge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
-    memset(pThis->credentialsJudge.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
+        memset(pThis->pCredentials->Logon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
+        memset(pThis->pCredentials->Logon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
+        memset(pThis->pCredentials->Logon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
+    }
+    memset(pThis->pCredentials->Judge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);
+    memset(pThis->pCredentials->Judge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);
+    memset(pThis->pCredentials->Judge.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);
 
     /* Reset means that additions will report again. */
@@ -2761,4 +2761,26 @@
     NOREF(pDevIns);
     NOREF(offDelta);
+}
+
+
+/**
+ * @interface_method_impl{PDMDEVREG,pfnDestruct}
+ */
+static DECLCALLBACK(int) vmmdevDestroy(PPDMDEVINS pDevIns)
+{
+    PDMDEV_CHECK_VERSIONS_RETURN(pDevIns);
+    VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState *);
+
+    /*
+     * Wipe and free the credentials.
+     */
+    if (pThis->pCredentials)
+    {
+        RTMemWipeThoroughly(pThis->pCredentials, sizeof(*pThis->pCredentials), 10);
+        RTMemFree(pThis->pCredentials);
+        pThis->pCredentials = NULL;
+    }
+
+    return VINF_SUCCESS;
 }
 
@@ -2826,4 +2848,9 @@
 #endif
 
+    pThis->pCredentials = (VMMDEVCREDS *)RTMemAllocZ(sizeof(*pThis->pCredentials));
+    if (!pThis->pCredentials)
+        return VERR_NO_MEMORY;
+
+
     /*
      * Validate and read the configuration.
@@ -2874,5 +2901,5 @@
         return PDMDEV_SET_ERROR(pDevIns, rc,
                                 N_("Configuration error: Failed querying \"TestingEnabled\" as a boolean"));
-# ifdef DEBUG_bird /* lazy bird */
+# if 1 //def DEBUG_bird /* lazy bird */ - do not commit this!!!!
     pThis->fTestingEnabled = true;
 # endif
Index: /trunk/src/VBox/Devices/VMMDev/VMMDevState.h
===================================================================
--- /trunk/src/VBox/Devices/VMMDev/VMMDevState.h	(revision 30849)
+++ /trunk/src/VBox/Devices/VMMDev/VMMDevState.h	(revision 30850)
@@ -52,4 +52,31 @@
     DISPLAYCHANGEREQUEST aRequests[64]; // @todo maxMonitors
 } DISPLAYCHANGEDATA;
+
+
+/**
+ * Credentials for automatic guest logon and host configured logon (?).
+ *
+ * This is not stored in the same block as the instance data in order to make it
+ * harder to access.
+ */
+typedef struct VMMDEVCREDS
+{
+    /** credentials for guest logon purposes */
+    struct
+    {
+        char szUserName[VMMDEV_CREDENTIALS_STRLEN];
+        char szPassword[VMMDEV_CREDENTIALS_STRLEN];
+        char szDomain[VMMDEV_CREDENTIALS_STRLEN];
+        bool fAllowInteractiveLogon;
+    } Logon;
+
+    /** credentials for verification by guest */
+    struct
+    {
+        char szUserName[VMMDEV_CREDENTIALS_STRLEN];
+        char szPassword[VMMDEV_CREDENTIALS_STRLEN];
+        char szDomain[VMMDEV_CREDENTIALS_STRLEN];
+    } Judge;
+} VMMDEVCREDS;
 
 
@@ -152,22 +179,8 @@
     DISPLAYCHANGEDATA displayChangeData;
 
-    /** credentials for guest logon purposes */
-    struct
-    {
-        char szUserName[VMMDEV_CREDENTIALS_STRLEN];
-        char szPassword[VMMDEV_CREDENTIALS_STRLEN];
-        char szDomain[VMMDEV_CREDENTIALS_STRLEN];
-        bool fAllowInteractiveLogon;
-    } credentialsLogon;
-
-    /** credentials for verification by guest */
-    struct
-    {
-        char szUserName[VMMDEV_CREDENTIALS_STRLEN];
-        char szPassword[VMMDEV_CREDENTIALS_STRLEN];
-        char szDomain[VMMDEV_CREDENTIALS_STRLEN];
-    } credentialsJudge;
-
-    bool afAlignment4[HC_ARCH_BITS == 32 ? 7 : 7];
+    /** Pointer to the credentials. */
+    R3PTRTYPE(VMMDEVCREDS *) pCredentials;
+
+    bool afAlignment4[HC_ARCH_BITS == 32 ? 3 : 7];
 
     /* memory balloon change request */
Index: /trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
===================================================================
--- /trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp	(revision 30849)
+++ /trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp	(revision 30850)
@@ -1,5 +1,5 @@
 /* $Id$ */
 /** @file
- * tstDeviceStructSizeGC - Generate structure member and size checks from the GC perspective.
+ * tstDeviceStructSizeGC - Generate structure member and size checks from the RC perspective.
  *
  * This is built using the VBoxRc template but linked into a host
@@ -8,5 +8,5 @@
 
 /*
- * Copyright (C) 2006-2008 Oracle Corporation
+ * Copyright (C) 2006-2010 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -1451,13 +1451,5 @@
     GEN_CHECK_OFF(VMMDevState, u32VideoAccelEnabled);
     GEN_CHECK_OFF(VMMDevState, displayChangeData);
-    GEN_CHECK_OFF(VMMDevState, credentialsLogon);
-    GEN_CHECK_OFF(VMMDevState, credentialsLogon.szUserName);
-    GEN_CHECK_OFF(VMMDevState, credentialsLogon.szPassword);
-    GEN_CHECK_OFF(VMMDevState, credentialsLogon.szDomain);
-    GEN_CHECK_OFF(VMMDevState, credentialsLogon.fAllowInteractiveLogon);
-    GEN_CHECK_OFF(VMMDevState, credentialsJudge);
-    GEN_CHECK_OFF(VMMDevState, credentialsJudge.szUserName);
-    GEN_CHECK_OFF(VMMDevState, credentialsJudge.szPassword);
-    GEN_CHECK_OFF(VMMDevState, credentialsJudge.szDomain);
+    GEN_CHECK_OFF(VMMDevState, pCredentials);
     GEN_CHECK_OFF(VMMDevState, u32MemoryBalloonSize);
     GEN_CHECK_OFF(VMMDevState, u32LastMemoryBalloonSize);
