Changeset 30850 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jul 14, 2010 5:41:01 PM (14 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r30758 r30850 1638 1638 if (credentials->u32Flags & VMMDEV_CREDENTIALS_QUERYPRESENCE) 1639 1639 { 1640 if ( pThis-> credentialsLogon.szUserName[0]1641 || pThis-> credentialsLogon.szPassword[0]1642 || pThis-> credentialsLogon.szDomain[0])1640 if ( pThis->pCredentials->Logon.szUserName[0] 1641 || pThis->pCredentials->Logon.szPassword[0] 1642 || pThis->pCredentials->Logon.szDomain[0]) 1643 1643 { 1644 1644 credentials->u32Flags |= VMMDEV_CREDENTIALS_PRESENT; … … 1653 1653 if (credentials->u32Flags & VMMDEV_CREDENTIALS_READ) 1654 1654 { 1655 if (pThis-> credentialsLogon.szUserName[0])1656 strcpy(credentials->szUserName, pThis-> credentialsLogon.szUserName);1657 if (pThis-> credentialsLogon.szPassword[0])1658 strcpy(credentials->szPassword, pThis-> credentialsLogon.szPassword);1659 if (pThis-> credentialsLogon.szDomain[0])1660 strcpy(credentials->szDomain, pThis-> credentialsLogon.szDomain);1661 if (!pThis-> credentialsLogon.fAllowInteractiveLogon)1655 if (pThis->pCredentials->Logon.szUserName[0]) 1656 strcpy(credentials->szUserName, pThis->pCredentials->Logon.szUserName); 1657 if (pThis->pCredentials->Logon.szPassword[0]) 1658 strcpy(credentials->szPassword, pThis->pCredentials->Logon.szPassword); 1659 if (pThis->pCredentials->Logon.szDomain[0]) 1660 strcpy(credentials->szDomain, pThis->pCredentials->Logon.szDomain); 1661 if (!pThis->pCredentials->Logon.fAllowInteractiveLogon) 1662 1662 credentials->u32Flags |= VMMDEV_CREDENTIALS_NOLOCALLOGON; 1663 1663 else … … 1670 1670 if (credentials->u32Flags & VMMDEV_CREDENTIALS_CLEAR) 1671 1671 { 1672 memset(pThis-> credentialsLogon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);1673 memset(pThis-> credentialsLogon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);1674 memset(pThis-> credentialsLogon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);1672 memset(pThis->pCredentials->Logon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN); 1673 memset(pThis->pCredentials->Logon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN); 1674 memset(pThis->pCredentials->Logon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN); 1675 1675 } 1676 1676 } … … 1679 1679 if (credentials->u32Flags & VMMDEV_CREDENTIALS_READJUDGE) 1680 1680 { 1681 if (pThis-> credentialsJudge.szUserName[0])1682 strcpy(credentials->szUserName, pThis-> credentialsJudge.szUserName);1683 if (pThis-> credentialsJudge.szPassword[0])1684 strcpy(credentials->szPassword, pThis-> credentialsJudge.szPassword);1685 if (pThis-> credentialsJudge.szDomain[0])1686 strcpy(credentials->szDomain, pThis-> credentialsJudge.szDomain);1681 if (pThis->pCredentials->Judge.szUserName[0]) 1682 strcpy(credentials->szUserName, pThis->pCredentials->Judge.szUserName); 1683 if (pThis->pCredentials->Judge.szPassword[0]) 1684 strcpy(credentials->szPassword, pThis->pCredentials->Judge.szPassword); 1685 if (pThis->pCredentials->Judge.szDomain[0]) 1686 strcpy(credentials->szDomain, pThis->pCredentials->Judge.szDomain); 1687 1687 } 1688 1688 … … 1690 1690 if (credentials->u32Flags & VMMDEV_CREDENTIALS_CLEARJUDGE) 1691 1691 { 1692 memset(pThis-> credentialsJudge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);1693 memset(pThis-> credentialsJudge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);1694 memset(pThis-> credentialsJudge.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);1692 memset(pThis->pCredentials->Judge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN); 1693 memset(pThis->pCredentials->Judge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN); 1694 memset(pThis->pCredentials->Judge.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN); 1695 1695 } 1696 1696 … … 2336 2336 { 2337 2337 /* memorize the data */ 2338 strcpy(pThis-> credentialsLogon.szUserName, pszUsername);2339 strcpy(pThis-> credentialsLogon.szPassword, pszPassword);2340 strcpy(pThis-> credentialsLogon.szDomain, pszDomain);2341 pThis-> credentialsLogon.fAllowInteractiveLogon = !(u32Flags & VMMDEV_SETCREDENTIALS_NOLOCALLOGON);2338 strcpy(pThis->pCredentials->Logon.szUserName, pszUsername); 2339 strcpy(pThis->pCredentials->Logon.szPassword, pszPassword); 2340 strcpy(pThis->pCredentials->Logon.szDomain, pszDomain); 2341 pThis->pCredentials->Logon.fAllowInteractiveLogon = !(u32Flags & VMMDEV_SETCREDENTIALS_NOLOCALLOGON); 2342 2342 } 2343 2343 /* credentials verification mode? */ … … 2345 2345 { 2346 2346 /* memorize the data */ 2347 strcpy(pThis-> credentialsJudge.szUserName, pszUsername);2348 strcpy(pThis-> credentialsJudge.szPassword, pszPassword);2349 strcpy(pThis-> credentialsJudge.szDomain, pszDomain);2347 strcpy(pThis->pCredentials->Judge.szUserName, pszUsername); 2348 strcpy(pThis->pCredentials->Judge.szPassword, pszPassword); 2349 strcpy(pThis->pCredentials->Judge.szDomain, pszDomain); 2350 2350 2351 2351 VMMDevNotifyGuest (pThis, VMMDEV_EVENT_JUDGE_CREDENTIALS); … … 2682 2682 if (!pThis->fKeepCredentials) 2683 2683 { 2684 memset(pThis-> credentialsLogon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);2685 memset(pThis-> credentialsLogon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);2686 memset(pThis-> credentialsLogon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);2687 } 2688 memset(pThis-> credentialsJudge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN);2689 memset(pThis-> credentialsJudge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN);2690 memset(pThis-> credentialsJudge.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN);2684 memset(pThis->pCredentials->Logon.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN); 2685 memset(pThis->pCredentials->Logon.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN); 2686 memset(pThis->pCredentials->Logon.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN); 2687 } 2688 memset(pThis->pCredentials->Judge.szUserName, '\0', VMMDEV_CREDENTIALS_STRLEN); 2689 memset(pThis->pCredentials->Judge.szPassword, '\0', VMMDEV_CREDENTIALS_STRLEN); 2690 memset(pThis->pCredentials->Judge.szDomain, '\0', VMMDEV_CREDENTIALS_STRLEN); 2691 2691 2692 2692 /* Reset means that additions will report again. */ … … 2761 2761 NOREF(pDevIns); 2762 2762 NOREF(offDelta); 2763 } 2764 2765 2766 /** 2767 * @interface_method_impl{PDMDEVREG,pfnDestruct} 2768 */ 2769 static DECLCALLBACK(int) vmmdevDestroy(PPDMDEVINS pDevIns) 2770 { 2771 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); 2772 VMMDevState *pThis = PDMINS_2_DATA(pDevIns, VMMDevState *); 2773 2774 /* 2775 * Wipe and free the credentials. 2776 */ 2777 if (pThis->pCredentials) 2778 { 2779 RTMemWipeThoroughly(pThis->pCredentials, sizeof(*pThis->pCredentials), 10); 2780 RTMemFree(pThis->pCredentials); 2781 pThis->pCredentials = NULL; 2782 } 2783 2784 return VINF_SUCCESS; 2763 2785 } 2764 2786 … … 2826 2848 #endif 2827 2849 2850 pThis->pCredentials = (VMMDEVCREDS *)RTMemAllocZ(sizeof(*pThis->pCredentials)); 2851 if (!pThis->pCredentials) 2852 return VERR_NO_MEMORY; 2853 2854 2828 2855 /* 2829 2856 * Validate and read the configuration. … … 2874 2901 return PDMDEV_SET_ERROR(pDevIns, rc, 2875 2902 N_("Configuration error: Failed querying \"TestingEnabled\" as a boolean")); 2876 # if def DEBUG_bird /* lazy bird */2903 # if 1 //def DEBUG_bird /* lazy bird */ - do not commit this!!!! 2877 2904 pThis->fTestingEnabled = true; 2878 2905 # endif -
trunk/src/VBox/Devices/VMMDev/VMMDevState.h
r30775 r30850 52 52 DISPLAYCHANGEREQUEST aRequests[64]; // @todo maxMonitors 53 53 } DISPLAYCHANGEDATA; 54 55 56 /** 57 * Credentials for automatic guest logon and host configured logon (?). 58 * 59 * This is not stored in the same block as the instance data in order to make it 60 * harder to access. 61 */ 62 typedef struct VMMDEVCREDS 63 { 64 /** credentials for guest logon purposes */ 65 struct 66 { 67 char szUserName[VMMDEV_CREDENTIALS_STRLEN]; 68 char szPassword[VMMDEV_CREDENTIALS_STRLEN]; 69 char szDomain[VMMDEV_CREDENTIALS_STRLEN]; 70 bool fAllowInteractiveLogon; 71 } Logon; 72 73 /** credentials for verification by guest */ 74 struct 75 { 76 char szUserName[VMMDEV_CREDENTIALS_STRLEN]; 77 char szPassword[VMMDEV_CREDENTIALS_STRLEN]; 78 char szDomain[VMMDEV_CREDENTIALS_STRLEN]; 79 } Judge; 80 } VMMDEVCREDS; 54 81 55 82 … … 152 179 DISPLAYCHANGEDATA displayChangeData; 153 180 154 /** credentials for guest logon purposes */ 155 struct 156 { 157 char szUserName[VMMDEV_CREDENTIALS_STRLEN]; 158 char szPassword[VMMDEV_CREDENTIALS_STRLEN]; 159 char szDomain[VMMDEV_CREDENTIALS_STRLEN]; 160 bool fAllowInteractiveLogon; 161 } credentialsLogon; 162 163 /** credentials for verification by guest */ 164 struct 165 { 166 char szUserName[VMMDEV_CREDENTIALS_STRLEN]; 167 char szPassword[VMMDEV_CREDENTIALS_STRLEN]; 168 char szDomain[VMMDEV_CREDENTIALS_STRLEN]; 169 } credentialsJudge; 170 171 bool afAlignment4[HC_ARCH_BITS == 32 ? 7 : 7]; 181 /** Pointer to the credentials. */ 182 R3PTRTYPE(VMMDEVCREDS *) pCredentials; 183 184 bool afAlignment4[HC_ARCH_BITS == 32 ? 3 : 7]; 172 185 173 186 /* memory balloon change request */ -
trunk/src/VBox/Devices/testcase/tstDeviceStructSizeRC.cpp
r30772 r30850 1 1 /* $Id$ */ 2 2 /** @file 3 * tstDeviceStructSizeGC - Generate structure member and size checks from the GC perspective.3 * tstDeviceStructSizeGC - Generate structure member and size checks from the RC perspective. 4 4 * 5 5 * This is built using the VBoxRc template but linked into a host … … 8 8 9 9 /* 10 * Copyright (C) 2006-20 08Oracle Corporation10 * Copyright (C) 2006-2010 Oracle Corporation 11 11 * 12 12 * This file is part of VirtualBox Open Source Edition (OSE), as … … 1451 1451 GEN_CHECK_OFF(VMMDevState, u32VideoAccelEnabled); 1452 1452 GEN_CHECK_OFF(VMMDevState, displayChangeData); 1453 GEN_CHECK_OFF(VMMDevState, credentialsLogon); 1454 GEN_CHECK_OFF(VMMDevState, credentialsLogon.szUserName); 1455 GEN_CHECK_OFF(VMMDevState, credentialsLogon.szPassword); 1456 GEN_CHECK_OFF(VMMDevState, credentialsLogon.szDomain); 1457 GEN_CHECK_OFF(VMMDevState, credentialsLogon.fAllowInteractiveLogon); 1458 GEN_CHECK_OFF(VMMDevState, credentialsJudge); 1459 GEN_CHECK_OFF(VMMDevState, credentialsJudge.szUserName); 1460 GEN_CHECK_OFF(VMMDevState, credentialsJudge.szPassword); 1461 GEN_CHECK_OFF(VMMDevState, credentialsJudge.szDomain); 1453 GEN_CHECK_OFF(VMMDevState, pCredentials); 1462 1454 GEN_CHECK_OFF(VMMDevState, u32MemoryBalloonSize); 1463 1455 GEN_CHECK_OFF(VMMDevState, u32LastMemoryBalloonSize);
Note:
See TracChangeset
for help on using the changeset viewer.