Changeset 27945 in vbox
- Timestamp:
- Apr 1, 2010 3:20:08 PM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.cpp
r27926 r27945 112 112 execData.szPassword, sizeof(execData.szPassword), 113 113 &execData.uTimeLimitMS); 114 if (RT_SUCCESS(rc)) 114 if (RT_FAILURE(rc)) 115 { 116 VBoxServiceError("Control: Failed to retrieve execution command! Error: %Rrc\n", rc); 117 } 118 else 115 119 { 116 120 /* Adjust time limit value. */ -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r27929 r27945 37 37 #include <VBox/log.h> 38 38 #include <iprt/asm.h> 39 #include <iprt/getopt.h> 39 40 #include <iprt/stream.h> 40 41 #include <iprt/string.h> … … 62 63 { 63 64 RTPrintf("VBoxManage guestcontrol execute <vmname>|<uuid>\n" 64 " <path to program> [--arguments <arguments>] [--environment NAME=VALUE]\n"65 " <path to program> [--arguments \"<arguments>\"] [--environment \"NAME=VALUE NAME=VALUE\"]\n" 65 66 " [--flags <flags>] [--username <name> [--password <password>]]\n" 66 67 " [--timeout <msec>]\n" … … 108 109 || !strcmp(a->argv[i], "--env")) 109 110 { 110 /** @todo Allow more environment blocks be spcecified per "--environment"111 * option, e.g. "--environment "FOO=BAR HOHO=HEHE;QWER=ASDF". */112 111 if (i + 1 >= a->argc) 113 112 usageOK = false; 114 113 else 115 114 { 116 env.push_back(Bstr(a->argv[i + 1])); 115 char **papszArg; 116 int cArgs; 117 118 rc = RTGetOptArgvFromString(&papszArg, &cArgs, a->argv[i + 1], NULL); 119 if (RT_SUCCESS(rc)) 120 { 121 for (int a = 0; a < cArgs; a++) 122 env.push_back(Bstr(papszArg[a])); 123 124 RTGetOptArgvFree(papszArg); 125 } 117 126 ++i; 118 127 } … … 204 213 CHECK_ERROR_BREAK(console, COMGETTER(Guest)(guest.asOutParam())); 205 214 215 ComPtr<IProgress> progress; 206 216 ULONG uPID = 0; 207 217 CHECK_ERROR_BREAK(guest, ExecuteProgram(Bstr(Utf8Cmd), uFlags, … … 209 219 Bstr(Utf8StdIn), Bstr(Utf8StdOut), Bstr(Utf8StdErr), 210 220 Bstr(Utf8UserName), Bstr(Utf8Password), uTimeoutMS, 211 &uPID)); 221 &uPID, progress.asOutParam())); 222 /** @todo Show some progress here? */ 212 223 a->session->Close(); 213 224 } while (0); -
trunk/src/VBox/HostServices/GuestControl/service.cpp
r27897 r27945 36 36 #include <iprt/cpp/autores.h> 37 37 #include <iprt/cpp/utils.h> 38 #include <iprt/critsect.h> 38 39 #include <iprt/err.h> 39 40 #include <iprt/mem.h> … … 77 78 /** The execution data to hold (atm only one buffer!) */ 78 79 VBOXGUESTCTRPARAMBUFFER mExec; 80 RTCRITSECT critsect; 79 81 80 82 public: … … 93 95 "GuestCtrlReq"); 94 96 #endif 97 mExec.uParmCount = 0; 98 mExec.pParms = NULL; 99 100 if (RT_SUCCESS(rc)) 101 rc = RTCritSectInit(&critsect); 102 95 103 if (RT_FAILURE(rc)) 96 104 throw rc; … … 204 212 int Service::execBufferAllocate(PVBOXGUESTCTRPARAMBUFFER pBuf, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 205 213 { 214 RTCritSectEnter(&critsect); 215 206 216 AssertPtr(pBuf); 207 217 int rc = VINF_SUCCESS; … … 260 270 } 261 271 } 272 RTCritSectLeave(&critsect); 262 273 return rc; 263 274 } … … 266 277 void Service::execBufferFree(PVBOXGUESTCTRPARAMBUFFER pBuf) 267 278 { 279 RTCritSectEnter(&critsect); 268 280 AssertPtr(pBuf); 269 281 for (uint32_t i = 0; i < pBuf->uParmCount; i++) … … 272 284 { 273 285 case VBOX_HGCM_SVC_PARM_PTR: 274 RTMemFree(pBuf->pParms[i].u.pointer.addr); 286 if (pBuf->pParms[i].u.pointer.size > 0) 287 RTMemFree(pBuf->pParms[i].u.pointer.addr); 275 288 break; 276 289 } … … 281 294 pBuf->uParmCount = 0; 282 295 } 296 RTCritSectLeave(&critsect); 283 297 } 284 298 … … 286 300 int Service::execBufferAssign(PVBOXGUESTCTRPARAMBUFFER pBuf, uint32_t cParms, VBOXHGCMSVCPARM paParms[]) 287 301 { 302 execBufferFree(pBuf); 303 304 RTCritSectEnter(&critsect); 305 288 306 AssertPtr(pBuf); 307 int rc = VINF_SUCCESS; 289 308 if (cParms != pBuf->uParmCount) 290 return VERR_INVALID_PARAMETER; 291 /** @todo Add check to verify if the HGCM request is the same *type* as the buffered one! */ 292 293 for (uint32_t i = 0; i < pBuf->uParmCount; i++) 294 { 295 paParms[i].type = pBuf->pParms[i].type; 296 switch (paParms[i].type) 297 { 298 case VBOX_HGCM_SVC_PARM_32BIT: 299 paParms[i].u.uint32 = pBuf->pParms[i].u.uint32; 300 break; 301 302 case VBOX_HGCM_SVC_PARM_64BIT: 303 /* Not supported yet. */ 304 break; 305 306 case VBOX_HGCM_SVC_PARM_PTR: 307 paParms[i].u.pointer.size = pBuf->pParms[i].u.pointer.size; 308 paParms[i].u.pointer.addr = pBuf->pParms[i].u.pointer.addr; 309 break; 310 311 default: 312 break; 313 } 314 } 315 316 return VINF_SUCCESS; 309 { 310 rc = VERR_INVALID_PARAMETER; 311 } 312 else 313 { 314 /** @todo Add check to verify if the HGCM request is the same *type* as the buffered one! */ 315 for (uint32_t i = 0; i < pBuf->uParmCount; i++) 316 { 317 paParms[i].type = pBuf->pParms[i].type; 318 switch (paParms[i].type) 319 { 320 case VBOX_HGCM_SVC_PARM_32BIT: 321 paParms[i].u.uint32 = pBuf->pParms[i].u.uint32; 322 break; 323 324 case VBOX_HGCM_SVC_PARM_64BIT: 325 /* Not supported yet. */ 326 break; 327 328 case VBOX_HGCM_SVC_PARM_PTR: 329 memcpy(paParms[i].u.pointer.addr, 330 pBuf->pParms[i].u.pointer.addr, 331 pBuf->pParms[i].u.pointer.size); 332 break; 333 334 default: 335 break; 336 } 337 } 338 } 339 RTCritSectLeave(&critsect); 340 return rc; 317 341 } 318 342 … … 333 357 LogFlowFunc(("u32ClientID = %d, fn = %d, cParms = %d, pparms = %d\n", 334 358 u32ClientID, eFunction, cParms, paParms)); 359 360 ASMBreakpoint(); 361 335 362 try 336 363 { -
trunk/src/VBox/Main/GuestImpl.cpp
r27930 r27945 423 423 IN_BSTR aStdIn, IN_BSTR aStdOut, IN_BSTR aStdErr, 424 424 IN_BSTR aUserName, IN_BSTR aPassword, 425 ULONG aTimeoutMS, ULONG *aPID )425 ULONG aTimeoutMS, ULONG *aPID, IProgress **aProgress) 426 426 { 427 427 #ifndef VBOX_WITH_GUEST_CONTROL … … 431 431 432 432 CheckComArgStrNotEmptyOrNull(aCommand); 433 CheckComArgOutPointerValid(aProgress); 433 434 CheckComArgOutPointerValid(aPID); 434 435 /* Flags are not supported at the moment. */ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r27911 r27945 8353 8353 <interface 8354 8354 name="IGuest" extends="$unknown" 8355 uuid=" 66dfe00b-f174-40d8-9d78-4e30d58137ed"8355 uuid="a4dac036-f7ed-4634-98d8-44b8672b1779" 8356 8356 wsmap="managed" 8357 8357 > … … 8528 8528 <desc>Foobar</desc> 8529 8529 </param> 8530 <param name="pid" type="unsigned long" dir=" return">8530 <param name="pid" type="unsigned long" dir="out"> 8531 8531 <desc>Foobar</desc> 8532 8532 </param> 8533 </method> 8533 <param name="progress" type="IProgress" dir="return"> 8534 <desc>Progress object to track the operation completion.</desc> 8535 </param> 8536 </method> 8534 8537 8535 8538 </interface> -
trunk/src/VBox/Main/include/GuestImpl.h
r27913 r27945 87 87 IN_BSTR aStdIn, IN_BSTR aStdOut, IN_BSTR aStdErr, 88 88 IN_BSTR aUserName, IN_BSTR aPassword, 89 ULONG aTimeoutMS, ULONG* aPID );89 ULONG aTimeoutMS, ULONG* aPID, IProgress **aProgress); 90 90 STDMETHOD(InternalGetStatistics)(ULONG aCpuId, ULONG *aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle, 91 91 ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, ULONG *aMemCache,
Note:
See TracChangeset
for help on using the changeset viewer.