Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuestLib.h
r39454 r40211 4 4 5 5 /* 6 * Copyright (C) 2006-201 0Oracle Corporation6 * Copyright (C) 2006-2012 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 588 588 # endif /* VBOX_WITH_GUEST_CONTROL defined */ 589 589 590 /** @name Auto-logon handling 591 * @{ */ 592 VBGLR3DECL(int) VbglR3AutoLogonReportStatus(VBoxGuestFacilityStatus enmStatus); 593 VBGLR3DECL(bool) VbglR3AutoLogonIsRemoteSession(void); 594 /** @} */ 595 590 596 /** @name User credentials handling 591 597 * @{ */ 592 598 VBGLR3DECL(int) VbglR3CredentialsQueryAvailability(void); 593 599 VBGLR3DECL(int) VbglR3CredentialsRetrieve(char **ppszUser, char **ppszPassword, char **ppszDomain); 600 VBGLR3DECL(int) VbglR3CredentialsRetrieveUtf16(PRTUTF16 *ppwszUser, PRTUTF16 *ppwszPassword, PRTUTF16 *ppwszDomain); 594 601 VBGLR3DECL(void) VbglR3CredentialsDestroy(char *pszUser, char *pszPassword, char *pszDomain, uint32_t cPasses); 602 VBGLR3DECL(void) VbglR3CredentialsDestroyUtf16(PRTUTF16 pwszUser, PRTUTF16 pwszPassword, PRTUTF16 pwszDomain, 603 uint32_t cPasses); 595 604 /** @} */ 596 605 -
trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk
r39454 r40211 5 5 6 6 # 7 # Copyright (C) 2006-201 0Oracle Corporation7 # Copyright (C) 2006-2012 Oracle Corporation 8 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as … … 95 95 VBoxGuestR3Lib.cpp \ 96 96 VBoxGuestR3LibAdditions.cpp \ 97 VBoxGuestR3LibAutoLogon.cpp \ 97 98 VBoxGuestR3LibBalloon.cpp \ 98 99 VBoxGuestR3LibClipboard.cpp \ -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibCredentials.cpp
r33540 r40211 74 74 VBGLR3DECL(int) VbglR3CredentialsRetrieve(char **ppszUser, char **ppszPassword, char **ppszDomain) 75 75 { 76 AssertPtrReturn(ppszUser, VERR_INVALID_POINTER); 77 AssertPtrReturn(ppszPassword, VERR_INVALID_POINTER); 78 AssertPtrReturn(ppszDomain, VERR_INVALID_POINTER); 79 76 80 VMMDevCredentials Req; 77 81 RT_ZERO(Req); … … 102 106 103 107 /** 108 * Retrieves and clears the user credentials for logging into the guest OS. 109 * UTF-16 version. 110 * 111 * @returns IPRT status value 112 * @param ppwszUser Receives pointer of allocated user name string. 113 * The returned pointer must be freed using VbglR3CredentialsDestroyUtf16(). 114 * @param ppswzPassword Receives pointer of allocated user password string. 115 * The returned pointer must be freed using VbglR3CredentialsDestroyUtf16(). 116 * @param ppwszDomain Receives pointer of allocated domain name string. 117 * The returned pointer must be freed using VbglR3CredentialsDestroyUtf16(). 118 */ 119 VBGLR3DECL(int) VbglR3CredentialsRetrieveUtf16(PRTUTF16 *ppwszUser, PRTUTF16 *ppwszPassword, PRTUTF16 *ppwszDomain) 120 { 121 AssertPtrReturn(ppwszUser, VERR_INVALID_POINTER); 122 AssertPtrReturn(ppwszPassword, VERR_INVALID_POINTER); 123 AssertPtrReturn(ppwszDomain, VERR_INVALID_POINTER); 124 125 char *pszUser, *pszPassword, *pszDomain; 126 int rc = VbglR3CredentialsRetrieve(&pszUser, &pszPassword, &pszDomain); 127 if (RT_SUCCESS(rc)) 128 { 129 PRTUTF16 pwszUser = NULL; 130 PRTUTF16 pwszPassword = NULL; 131 PRTUTF16 pwszDomain = NULL; 132 133 rc = RTStrToUtf16(pszUser, &pwszUser); 134 if (RT_SUCCESS(rc)) 135 { 136 rc = RTStrToUtf16(pszPassword, &pwszPassword); 137 if (RT_SUCCESS(rc)) 138 rc = RTStrToUtf16(pszDomain, &pwszDomain); 139 } 140 141 if (RT_SUCCESS(rc)) 142 { 143 *ppwszUser = pwszUser; 144 *ppwszPassword = pwszPassword; 145 *ppwszDomain = pwszDomain; 146 } 147 else 148 VbglR3CredentialsDestroyUtf16(pwszUser, pwszPassword, pwszDomain, 149 3 /* Passes */); 150 151 VbglR3CredentialsDestroy(pszUser, pszPassword, pszDomain, 152 3 /* Passes */); 153 } 154 155 return rc; 156 } 157 158 /** 104 159 * Clears and frees the three strings. 105 160 * … … 128 183 } 129 184 185 /** 186 * Clears and frees the three strings. UTF-16 version. 187 * 188 * @param pwszUser Receives pointer of the user name string to destroy. 189 * Optional. 190 * @param pwszPassword Receives pointer of the password string to destroy. 191 * Optional. 192 * @param pwszDomain Receives pointer of allocated domain name string. 193 * Optional. 194 * @param cPasses Number of wipe passes. The more the better + slower. 195 */ 196 VBGLR3DECL(void) VbglR3CredentialsDestroyUtf16(PRTUTF16 pwszUser, PRTUTF16 pwszPassword, PRTUTF16 pwszDomain, 197 uint32_t cPasses) 198 { 199 /* wipe first */ 200 if (pwszUser) 201 RTMemWipeThoroughly(pwszUser, RTUtf16Len(pwszUser) + 1, cPasses); 202 if (pwszPassword) 203 RTMemWipeThoroughly(pwszPassword, RTUtf16Len(pwszPassword) + 1, cPasses); 204 if (pwszDomain) 205 RTMemWipeThoroughly(pwszDomain, RTUtf16Len(pwszDomain) + 1, cPasses); 206 207 /* then free. */ 208 RTUtf16Free(pwszUser); 209 RTUtf16Free(pwszPassword); 210 RTUtf16Free(pwszDomain); 211 } 212
Note:
See TracChangeset
for help on using the changeset viewer.