vbox的更動 45350 路徑 trunk/src/VBox/Runtime/r3/init.cpp
- 時間撮記:
- 2013-4-4 下午08:22:25 (12 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Runtime/r3/init.cpp
r44528 r45350 276 276 return VERR_NO_MEMORY; 277 277 278 for (int i = 0; i < cArgs; i++) 278 #ifdef RT_OS_WINDOWS 279 /* HACK ALERT! Try convert from unicode versions if possible. 280 Unfortunately for us, __wargv is only initialized if we have a 281 unicode main function. So, we have to use CommandLineToArgvW to get 282 something similar. It should do the same conversion... :-) */ 283 int cArgsW = -1; 284 PWSTR *papwszArgs = NULL; 285 if ( papszOrgArgs == __argv 286 && cArgs == __argc 287 && (papwszArgs = CommandLineToArgvW(GetCommandLineW(), &cArgsW)) != NULL ) 279 288 { 280 int rc = RTStrCurrentCPToUtf8(&papszArgs[i], papszOrgArgs[i]);281 if (RT_FAILURE(rc))289 AssertMsg(cArgsW == cArgs, ("%d vs %d\n", cArgsW, cArgs)); 290 for (int i = 0; i < cArgs; i++) 282 291 { 283 while (i--) 284 RTStrFree(papszArgs[i]); 285 RTMemFree(papszArgs); 286 return rc; 292 int rc = RTUtf16ToUtf8(papwszArgs[i], &papszArgs[i]); 293 if (RT_FAILURE(rc)) 294 { 295 while (i--) 296 RTStrFree(papszArgs[i]); 297 RTMemFree(papszArgs); 298 LocalFree(papwszArgs); 299 return rc; 300 } 301 } 302 LocalFree(papwszArgs); 303 } 304 else 305 #endif 306 { 307 for (int i = 0; i < cArgs; i++) 308 { 309 int rc = RTStrCurrentCPToUtf8(&papszArgs[i], papszOrgArgs[i]); 310 if (RT_FAILURE(rc)) 311 { 312 while (i--) 313 RTStrFree(papszArgs[i]); 314 RTMemFree(papszArgs); 315 return rc; 316 } 287 317 } 288 318 } 319 289 320 papszArgs[cArgs] = NULL; 290 321
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器