Changeset 7418 in vbox for trunk/src/VBox/Main/ConsoleImpl.cpp
- Timestamp:
- Mar 10, 2008 4:01:58 PM (17 years ago)
- File:
-
- 1 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)
Note:
See TracChangeset
for help on using the changeset viewer.