Changeset 66012 in vbox for trunk/src/VBox/HostServices/SharedFolders/testcase
- Timestamp:
- Mar 9, 2017 1:02:50 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp
r66011 r66012 511 511 const char *pcszSource) 512 512 { 513 AssertRelease( strlen(pcszSource) * 2 + 2 513 const size_t cchSource = strlen(pcszSource); 514 AssertRelease( cchSource * 2 + 2 514 515 < sizeof(*pDest) - RT_UOFFSETOF(SHFLSTRING, String)); 515 pDest->string.u16Length = (uint16_t)( strlen(pcszSource)* sizeof(RTUTF16));516 pDest->string.u16Length = (uint16_t)(cchSource * sizeof(RTUTF16)); 516 517 pDest->string.u16Size = pDest->string.u16Length + sizeof(RTUTF16); 517 for (unsigned i = 0; i <= pDest->string.u16Length; ++i) 518 /* Copy pcszSource ASCIIZ, including the trailing 0, to the UTF16 pDest->string.String.ucs2. */ 519 for (unsigned i = 0; i <= cchSource; ++i) 518 520 ((uint16_t*)pDest->string.String.ucs2)[i] = (uint16_t)pcszSource[i]; 519 521 }
Note:
See TracChangeset
for help on using the changeset viewer.