Changeset 27788 in vbox for trunk/src/VBox
- Timestamp:
- Mar 29, 2010 12:42:22 PM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
r27773 r27788 77 77 */ 78 78 /** @todo */ 79 if (a->argc < 2) 79 if (a->argc < 2) /* At least the command we want to execute should be present. */ 80 80 return errorSyntax(USAGE_GUESTCONTROL, "Incorrect parameters"); 81 const char *pszCmd = a->argv[1];81 Utf8Str Utf8Cmd(a->argv[1]); 82 82 uint32_t uFlags = 0; 83 const char *pszArgs;83 Utf8Str Utf8Args; 84 84 com::SafeArray <BSTR> env; 85 const char *pszStdIn = NULL;86 const char *pszStdOut = NULL;87 const char *pszStdErr = NULL;88 const char *pszUserName = NULL;89 const char *pszPassword = NULL;85 Utf8Str Utf8StdIn; 86 Utf8Str Utf8StdOut; 87 Utf8Str Utf8StdErr; 88 Utf8Str Utf8UserName; 89 Utf8Str Utf8Password; 90 90 uint32_t uTimeoutMS = 0; 91 91 … … 107 107 108 108 /* open an existing session for VM - so the VM has to be running */ 109 CHECK_ERROR_BREAK(a->virtualBox, OpenExistingSession(a->session, uuid) , 1);109 CHECK_ERROR_BREAK(a->virtualBox, OpenExistingSession(a->session, uuid)); 110 110 111 111 /* get the mutable session machine */ … … 120 120 121 121 ULONG uPID = 0; 122 CHECK_ERROR_BREAK(guest, ExecuteProgram(Bstr( pszCmd), uFlags,123 Bstr( pszArgs), ComSafeArrayAsInParam(env),124 Bstr( pszStdIn), Bstr(pszStdOut), Bstr(pszStdErr),125 Bstr( pszUserName), Bstr(pszPassword), uTimeoutMS,122 CHECK_ERROR_BREAK(guest, ExecuteProgram(Bstr(Utf8Cmd), uFlags, 123 Bstr(Utf8Args), ComSafeArrayAsInParam(env), 124 Bstr(Utf8StdIn), Bstr(Utf8StdOut), Bstr(Utf8StdErr), 125 Bstr(Utf8UserName), Bstr(Utf8Password), uTimeoutMS, 126 126 &uPID)); 127 127 a->session->Close(); -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r27719 r27788 2166 2166 #endif /* VBOX_WITH_GUEST_PROPS defined */ 2167 2167 2168 #ifdef VBOX_WITH_GUEST_CONTROL 2169 /* 2170 * Guest control service 2171 */ 2172 2173 rc = configGuestControl(pConsole); 2174 #endif /* VBOX_WITH_GUEST_CONTROL defined */ 2175 2168 2176 /* 2169 2177 * ACPI … … 3519 3527 #endif /* !VBOX_WITH_GUEST_PROPS */ 3520 3528 } 3529 3530 /** 3531 * Set up the Guest Control service. 3532 */ 3533 /* static */ int Console::configGuestControl(void *pvConsole) 3534 { 3535 #ifdef VBOX_WITH_GUEST_CONTROL 3536 AssertReturn(pvConsole, VERR_GENERAL_FAILURE); 3537 ComObjPtr<Console> pConsole = static_cast <Console *> (pvConsole); 3538 3539 /* Load the service */ 3540 int rc = pConsole->mVMMDev->hgcmLoadService ("VBoxGuestControlSvc", "VBoxGuestControlSvc"); 3541 3542 if (RT_FAILURE(rc)) 3543 { 3544 LogRel(("VBoxGuestControlSvc is not available. rc = %Rrc\n", rc)); 3545 /* That is not a fatal failure. */ 3546 rc = VINF_SUCCESS; 3547 } 3548 3549 return VINF_SUCCESS; 3550 #else /* !VBOX_WITH_GUEST_CONTROL */ 3551 return VERR_NOT_SUPPORTED; 3552 #endif /* !VBOX_WITH_GUEST_CONTROL */ 3553 } 3554 -
trunk/src/VBox/Main/GuestImpl.cpp
r27773 r27788 352 352 *ppvList = pszTemp; 353 353 *pcArgs = iArgs; 354 *pcbList = strlen(pszTemp) + 1; /* Include zero termination. */ 354 if (pszTemp) 355 *pcbList = strlen(pszTemp) + 1; /* Include zero termination. */ 355 356 } 356 357 else … … 455 456 { 456 457 /* Prepare environment. */ 458 com::SafeArray<IN_BSTR> env(ComSafeArrayInArg(aEnvironment)); 459 457 460 void *pvEnv = NULL; 458 uint32_t uNumEnv; 459 uint32_t cbEnv; 460 461 com::SafeArray<IN_BSTR> env(ComSafeArrayInArg(aEnvironment)); 462 for (unsigned i = 0; i < env.size(); ++i) 461 uint32_t uNumEnv = env.size(); 462 uint32_t cbEnv = 0; 463 464 for (unsigned i = 0; i < uNumEnv; i++) 463 465 { 464 466 const char *pszCurEnv = Utf8Str(env[i]).raw(); … … 497 499 { 498 500 vrc = vmmDev->hgcmHostCall("VBoxGuestControlSvc", HOST_EXEC_CMD, 499 13, &paParms[0]);501 13, paParms); 500 502 /** @todo Get the PID. */ 501 503 } -
trunk/src/VBox/Main/include/ConsoleImpl.h
r27761 r27788 435 435 static DECLCALLBACK(int) configConstructor(PVM pVM, void *pvConsole); 436 436 static DECLCALLBACK(int) configGuestProperties(void *pvConsole); 437 static DECLCALLBACK(int) configGuestControl(void *pvConsole); 437 438 static int configNetwork(Console *pThis, const char *pszDevice, 438 439 unsigned uInstance, unsigned uLun,
Note:
See TracChangeset
for help on using the changeset viewer.