Changeset 28571 in vbox
- Timestamp:
- Apr 21, 2010 6:06:34 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/GuestImpl.cpp
r28557 r28571 591 591 pCBData->u32HandleId = pData->u32HandleId; 592 592 pCBData->u32Flags = pData->u32Flags; 593 593 594 594 /* Allocate data buffer and copy it */ 595 595 if (pData->cbData && pData->pvData) … … 731 731 732 732 /* Prepare arguments. */ 733 com::SafeArray<IN_BSTR> args(ComSafeArrayInArg(aArguments));734 uint32_t uNumArgs = args.size();735 733 char **papszArgv = NULL; 736 if(uNumArgs > 0) 737 { 734 uint32_t uNumArgs = 0; 735 if(aArguments > 0) 736 { 737 com::SafeArray<IN_BSTR> args(ComSafeArrayInArg(aArguments)); 738 uNumArgs = args.size(); 738 739 papszArgv = (char**)RTMemAlloc(sizeof(char*) * (uNumArgs + 1)); 739 740 AssertPtr(papszArgv); … … 760 761 761 762 /* Prepare environment. */ 762 com::SafeArray<IN_BSTR> env(ComSafeArrayInArg(aEnvironment));763 764 763 void *pvEnv = NULL; 765 764 uint32_t uNumEnv = 0; 766 765 uint32_t cbEnv = 0; 767 768 for (unsigned i = 0; i < env.size(); i++) 766 if (aEnvironment > 0) 769 767 { 770 vrc = prepareExecuteEnv(Utf8Str(env[i]).raw(), &pvEnv, &cbEnv, &uNumEnv); 771 if (RT_FAILURE(vrc)) 772 break; 768 com::SafeArray<IN_BSTR> env(ComSafeArrayInArg(aEnvironment)); 769 770 for (unsigned i = 0; i < env.size(); i++) 771 { 772 vrc = prepareExecuteEnv(Utf8Str(env[i]).raw(), &pvEnv, &cbEnv, &uNumEnv); 773 if (RT_FAILURE(vrc)) 774 break; 775 } 773 776 } 774 777 … … 993 996 outputData.resize(pData->cbData); 994 997 995 /* Fill output in supplied out buffer. */ 998 /* Fill output in supplied out buffer. */ 996 999 memcpy(outputData.raw(), pData->pvData, pData->cbData); 997 1000 outputData.resize(pData->cbData); /* Shrink to fit actual buffer size. */
Note:
See TracChangeset
for help on using the changeset viewer.