Changeset 26073 in vbox
- Timestamp:
- Jan 27, 2010 3:06:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp
r26072 r26073 208 208 usBuffer = (sessionData->UserName).Buffer; 209 209 iLength = (sessionData->UserName).Length; 210 if (iLength > sizeof(a_pUserInfo->szUser) - sizeof( TCHAR)) /* -sizeof(TCHAR) because we have to add the terminating null char at the end later. */210 if (iLength > sizeof(a_pUserInfo->szUser) - sizeof(WCHAR)) /* -sizeof(WCHAR) because we have to add the terminating null char at the end later. */ 211 211 { 212 212 VBoxServiceVerbose(0, "User name too long (%d bytes) for buffer! Name will be truncated.\n", iLength); 213 iLength = sizeof(a_pUserInfo->szUser) - sizeof( TCHAR);213 iLength = sizeof(a_pUserInfo->szUser) - sizeof(WCHAR); 214 214 } 215 215 wcsncpy (a_pUserInfo->szUser, usBuffer, iLength); … … 218 218 usBuffer = (sessionData->AuthenticationPackage).Buffer; 219 219 iLength = (sessionData->AuthenticationPackage).Length; 220 if (iLength > sizeof(a_pUserInfo->szAuthenticationPackage) - sizeof( TCHAR)) /* -sizeof(TCHAR) because we have to add the terminating null char at the end later. */220 if (iLength > sizeof(a_pUserInfo->szAuthenticationPackage) - sizeof(WCHAR)) /* -sizeof(WCHAR) because we have to add the terminating null char at the end later. */ 221 221 { 222 222 VBoxServiceVerbose(0, "Authentication pkg name too long (%d bytes) for buffer! Name will be truncated.\n", iLength); 223 iLength = sizeof(a_pUserInfo->szAuthenticationPackage) - sizeof( TCHAR);223 iLength = sizeof(a_pUserInfo->szAuthenticationPackage) - sizeof(WCHAR); 224 224 } 225 225 if (iLength) 226 {227 226 wcsncpy (a_pUserInfo->szAuthenticationPackage, usBuffer, iLength); 228 }229 227 230 228 /* Get logon domain. */ 231 229 usBuffer = (sessionData->LogonDomain).Buffer; 232 230 iLength = (sessionData->LogonDomain).Length; 233 if (iLength > sizeof(a_pUserInfo->szLogonDomain) - sizeof( TCHAR)) /* -sizeof(TCHAR) because we have to add the terminating null char at the end later. */231 if (iLength > sizeof(a_pUserInfo->szLogonDomain) - sizeof(WCHAR)) /* -sizeof(WCHAR) because we have to add the terminating null char at the end later. */ 234 232 { 235 233 VBoxServiceVerbose(0, "Logon domain name too long (%d bytes) for buffer! Name will be truncated.\n", iLength); 236 iLength = sizeof(a_pUserInfo->szLogonDomain) - sizeof( TCHAR);234 iLength = sizeof(a_pUserInfo->szLogonDomain) - sizeof(WCHAR); 237 235 } 238 236 if (iLength) 239 {240 237 wcsncpy (a_pUserInfo->szLogonDomain, usBuffer, iLength); 241 }242 238 243 239 /* Only handle users which can login interactively or logged in remotely over native RDP. */
Note:
See TracChangeset
for help on using the changeset viewer.