Changeset 7418 in vbox for trunk/src/VBox/Main
- Timestamp:
- Mar 10, 2008 4:01:58 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 28852
- Location:
- trunk/src/VBox/Main
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r7327 r7418 4480 4480 Log (("Adding shared folder '%ls' -> '%ls'\n", aName, aData.mHostPath.raw())); 4481 4481 4482 cbString = (RT StrUcs2Len (aData.mHostPath) + 1) * sizeof (RTUCS2);4482 cbString = (RTUtf16Len (aData.mHostPath) + 1) * sizeof (RTUTF16); 4483 4483 if (cbString >= UINT16_MAX) 4484 4484 return setError (E_INVALIDARG, tr ("The name is too long")); … … 4488 4488 4489 4489 pFolderName->u16Size = (uint16_t)cbString; 4490 pFolderName->u16Length = (uint16_t)cbString - sizeof(RTU CS2);4490 pFolderName->u16Length = (uint16_t)cbString - sizeof(RTUTF16); 4491 4491 4492 4492 parms[0].type = VBOX_HGCM_SVC_PARM_PTR; … … 4494 4494 parms[0].u.pointer.size = sizeof (SHFLSTRING) + (uint16_t)cbString; 4495 4495 4496 cbString = (RT StrUcs2Len (aName) + 1) * sizeof (RTUCS2);4496 cbString = (RTUtf16Len (aName) + 1) * sizeof (RTUTF16); 4497 4497 if (cbString >= UINT16_MAX) 4498 4498 { … … 4505 4505 4506 4506 pMapName->u16Size = (uint16_t)cbString; 4507 pMapName->u16Length = (uint16_t)cbString - sizeof (RTU CS2);4507 pMapName->u16Length = (uint16_t)cbString - sizeof (RTUTF16); 4508 4508 4509 4509 parms[1].type = VBOX_HGCM_SVC_PARM_PTR; … … 4551 4551 Log (("Removing shared folder '%ls'\n", aName)); 4552 4552 4553 cbString = (RT StrUcs2Len (aName) + 1) * sizeof (RTUCS2);4553 cbString = (RTUtf16Len (aName) + 1) * sizeof (RTUTF16); 4554 4554 if (cbString >= UINT16_MAX) 4555 4555 return setError (E_INVALIDARG, tr ("The name is too long")); … … 4559 4559 4560 4560 pMapName->u16Size = (uint16_t)cbString; 4561 pMapName->u16Length = (uint16_t)cbString - sizeof (RTU CS2);4561 pMapName->u16Length = (uint16_t)cbString - sizeof (RTUTF16); 4562 4562 4563 4563 parms.type = VBOX_HGCM_SVC_PARM_PTR; … … 6121 6121 BSTR str = NULL; 6122 6122 *phrc = S_OK; 6123 #define STR_CONV() do { rc = RT StrUcs2ToUtf8(&psz, str); RC_CHECK(); } while (0)6123 #define STR_CONV() do { rc = RTUtf16ToUtf8(str, &psz); RC_CHECK(); } while (0) 6124 6124 #define STR_FREE() do { if (str) { SysFreeString(str); str = NULL; } if (psz) { RTStrFree(psz); psz = NULL; } } while (0) 6125 6125 #define RC_CHECK() do { if (VBOX_FAILURE(rc)) { AssertMsgFailed(("rc=%Vrc\n", rc)); STR_FREE(); return rc; } } while (0) -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r7359 r7418 98 98 unsigned i; 99 99 100 #define STR_CONV() do { rc = RT StrUcs2ToUtf8(&psz, str); RC_CHECK(); } while (0)100 #define STR_CONV() do { rc = RTUtf16ToUtf8(str, &psz); RC_CHECK(); } while (0) 101 101 #define STR_FREE() do { if (str) { SysFreeString(str); str = NULL; } if (psz) { RTStrFree(psz); psz = NULL; } } while (0) 102 102 #define RC_CHECK() do { if (VBOX_FAILURE(rc)) { AssertMsgFailed(("rc=%Vrc\n", rc)); STR_FREE(); return rc; } } while (0) -
trunk/src/VBox/Main/glue/com.cpp
r6076 r7418 51 51 #else 52 52 #define VBOX_USER_HOME_SUFFIX ".VirtualBox" 53 #endif 53 #endif 54 54 55 55 … … 117 117 iinfo->GetNameShared (&iname); 118 118 char *utf8IName = NULL; 119 if ( VBOX_SUCCESS (RTStrCurrentCPToUtf8 (&utf8IName, iname)))119 if (RT_SUCCESS (RTStrCurrentCPToUtf8 (&utf8IName, iname))) 120 120 { 121 121 PRTUCS2 ucs2IName = NULL; 122 if ( VBOX_SUCCESS (RTStrUtf8ToUcs2 (&ucs2IName, utf8IName)))122 if (RT_SUCCESS (RTStrToUtf16 (utf8IName, &ucs2IName))) 123 123 { 124 124 *aName = SysAllocString ((OLECHAR *) ucs2IName); 125 RT StrUcs2Free (ucs2IName);125 RTUtf16Free (ucs2IName); 126 126 } 127 127 RTStrFree (utf8IName); … … 170 170 if (RT_SUCCESS (vrc)) 171 171 { 172 size_t len = 172 size_t len = 173 173 RTStrPrintf (aDir, aDirLen, "%s%c%s", 174 174 path, RTPATH_DELIMITER, VBOX_USER_HOME_SUFFIX); … … 187 187 188 188 /* static */ 189 const Guid Guid::Empty; /* default ctor is OK */ 189 const Guid Guid::Empty; /* default ctor is OK */ 190 190 191 191 } /* namespace com */ -
trunk/src/VBox/Main/linux/helpers.cpp
r5999 r7418 176 176 unsigned int SysStringByteLen(BSTR bstr) 177 177 { 178 return RT StrUcs2Len(bstr) * sizeof(OLECHAR);178 return RTUtf16Len(bstr) * sizeof(OLECHAR); 179 179 } 180 180 … … 186 186 unsigned int SysStringLen(BSTR bstr) 187 187 { 188 return RT StrUcs2Len(bstr);188 return RTUtf16Len(bstr); 189 189 } -
trunk/src/VBox/Main/testcase/tstAPI.cpp
r7207 r7418 379 379 char *driveNameUtf8; 380 380 dvdDrive->GetDriveName(&driveName); 381 RT StrUcs2ToUtf8(&driveNameUtf8, (PCRTUCS2)driveName);381 RTUtf16ToUtf8((PCRTUTF16)driveName, &driveNameUtf8); 382 382 printf("Host DVD drive name: %s\n", driveNameUtf8); 383 383 RTStrFree(driveNameUtf8); … … 404 404 char *driveNameUtf8; 405 405 floppyDrive->GetDriveName(&driveName); 406 RT StrUcs2ToUtf8(&driveNameUtf8, (PCRTUCS2)driveName);406 RTUtf16ToUtf8((PCRTUTF16)driveName, &driveNameUtf8); 407 407 printf("Host floppy drive name: %s\n", driveNameUtf8); 408 408 RTStrFree(driveNameUtf8);
Note:
See TracChangeset
for help on using the changeset viewer.