Changeset 35105 in vbox
- Timestamp:
- Dec 14, 2010 4:39:21 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/RemoteDesktop/VRDE.h
r34903 r35105 1416 1416 typedef FNVRDECREATESERVER *PFNVRDECREATESERVER; 1417 1417 1418 /** 1419 * List of names of the VRDE properties, which are recognized by the VRDE. 1420 * 1421 * @returns pointer to array of pointers to name strings (UTF8). 1422 */ 1423 DECLEXPORT(const char * const *) VRDESupportedProperties (void); 1424 1425 typedef DECLCALLBACK(const char * const *) FNVRDESUPPORTEDPROPERTIES (void); 1426 typedef FNVRDESUPPORTEDPROPERTIES *PFNVRDESUPPORTEDPROPERTIES; 1427 1418 1428 RT_C_DECLS_END 1419 1429 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
r34971 r35105 612 612 else if (!strcmp(a->argv[1], "vrdpport")) 613 613 { 614 RTStrmPrintf(g_pStdErr, "Warning: 'vrdpport' is deprecated. Use 'setvrdeproperty'.\n");615 616 614 if (a->argc <= 1 + 1) 617 615 { … … 620 618 break; 621 619 } 620 621 RTStrmPrintf(g_pStdErr, "Warning: 'vrdpport' is deprecated. Use 'vrdeproperty TCP/Ports=%s'.\n", a->argv[2]); 622 622 623 ComPtr<IVRDEServer> vrdeServer; 623 624 sessionMachine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r34010 r35105 1448 1448 RTPrintf("vrde=\"on\"\n"); 1449 1449 RTPrintf("vrdeport=%d\n", currentPort); 1450 RTPrintf("vrdep roperty[TCP/Ports]=\"%lS\"\n", ports.raw());1451 RTPrintf("vrde property[TCP/Address]=\"%lS\"\n", address.raw());1450 RTPrintf("vrdeports=\"%lS\"\n", ports.raw()); 1451 RTPrintf("vrdeaddress=\"%lS\"\n", address.raw()); 1452 1452 RTPrintf("vrdeauthtype=\"%s\"\n", strAuthType); 1453 1453 RTPrintf("vrdemulticon=\"%s\"\n", fMultiCon ? "on" : "off"); … … 1468 1468 else 1469 1469 RTPrintf("Video redirection: disabled\n"); 1470 } 1471 com::SafeArray<BSTR> aProperties; 1472 if (SUCCEEDED(vrdeServer->COMGETTER(VRDEProperties)(ComSafeArrayAsOutParam(aProperties)))) 1473 { 1474 unsigned i; 1475 for (i = 0; i < aProperties.size(); ++i) 1476 { 1477 Bstr value; 1478 vrdeServer->GetVRDEProperty(aProperties[i], value.asOutParam()); 1479 if (details == VMINFO_MACHINEREADABLE) 1480 { 1481 if (value.isEmpty()) 1482 RTPrintf("vrdeproperty[%lS]=<not set>\n", aProperties[i]); 1483 else 1484 RTPrintf("vrdeproperty[%lS]=\"%lS\"\n", aProperties[i], value.raw()); 1485 } 1486 else 1487 { 1488 if (value.isEmpty()) 1489 RTPrintf("VRDE property: %-10lS = <not set>\n", aProperties[i]); 1490 else 1491 RTPrintf("VRDE property: %-10lS = \"%lS\"\n", aProperties[i], value.raw()); 1492 } 1493 } 1470 1494 } 1471 1495 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r34574 r35105 141 141 MODIFYVM_VRDP, /* VRDE: deprecated */ 142 142 MODIFYVM_VRDEPROPERTY, 143 MODIFYVM_VRDEPORT, 144 MODIFYVM_VRDEADDRESS, 143 145 MODIFYVM_VRDEAUTHTYPE, 144 146 MODIFYVM_VRDEAUTHLIBRARY, … … 265 267 { "--vrdp", MODIFYVM_VRDP, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */ 266 268 { "--vrdeproperty", MODIFYVM_VRDEPROPERTY, RTGETOPT_REQ_STRING }, 269 { "--vrdeport", MODIFYVM_VRDEPORT, RTGETOPT_REQ_STRING }, 270 { "--vrdeaddress", MODIFYVM_VRDEADDRESS, RTGETOPT_REQ_STRING }, 267 271 { "--vrdeauthtype", MODIFYVM_VRDEAUTHTYPE, RTGETOPT_REQ_STRING }, 268 272 { "--vrdeauthlibrary", MODIFYVM_VRDEAUTHLIBRARY, RTGETOPT_REQ_STRING }, … … 296 300 { 297 301 RTStrmPrintf(g_pStdErr, "Warning: '--vrdp%s' is deprecated. Use '--vrde%s'.\n", pszOption, pszOption); 298 }299 300 static void vrdeWarningDeprecatedProperty(const char *pszOption, const char *pszProperty, const char *pszArg)301 {302 RTStrmPrintf(g_pStdErr, "Warning: '--%s' is deprecated. Use '--vrdeproperty \"%s=%s\"'.\n",303 pszOption, pszProperty, pszArg);304 302 } 305 303 … … 1883 1881 1884 1882 case MODIFYVM_VRDPPORT: 1885 { 1886 vrdeWarningDeprecatedProperty("vrdpport", "TCP/Ports", ValueUnion.psz); 1887 1883 vrdeWarningDeprecatedOption("port"); 1884 1885 case MODIFYVM_VRDEPORT: 1886 { 1888 1887 ComPtr<IVRDEServer> vrdeServer; 1889 1888 machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); … … 1898 1897 1899 1898 case MODIFYVM_VRDPADDRESS: 1900 { 1901 vrdeWarningDeprecatedProperty("vrdpaddress", "TCP/Address", ValueUnion.psz); 1902 1899 vrdeWarningDeprecatedOption("address"); 1900 1901 case MODIFYVM_VRDEADDRESS: 1902 { 1903 1903 ComPtr<IVRDEServer> vrdeServer; 1904 1904 machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); -
trunk/src/VBox/Main/VRDEServerImpl.cpp
r34574 r35105 26 26 #include <iprt/ctype.h> 27 27 #include <iprt/ldr.h> 28 #include <iprt/path.h> 28 29 29 30 #include <VBox/err.h> 31 #include <VBox/sup.h> 30 32 31 33 #include <VBox/RemoteDesktop/VRDE.h> … … 487 489 } 488 490 491 static int loadVRDELibrary(const char *pszLibraryName, RTLDRMOD *phmod, PFNVRDESUPPORTEDPROPERTIES *ppfn) 492 { 493 int rc = VINF_SUCCESS; 494 495 RTLDRMOD hmod = NIL_RTLDRMOD; 496 497 char szErr[4096 + 512]; 498 szErr[0] = '\0'; 499 if (RTPathHavePath(pszLibraryName)) 500 rc = SUPR3HardenedLdrLoadPlugIn(pszLibraryName, &hmod, szErr, sizeof(szErr)); 501 else 502 rc = SUPR3HardenedLdrLoadAppPriv(pszLibraryName, &hmod, szErr, sizeof(szErr)); 503 if (RT_SUCCESS(rc)) 504 { 505 rc = RTLdrGetSymbol(hmod, "VRDESupportedProperties", (void **)ppfn); 506 507 if (RT_FAILURE(rc) && rc != VERR_SYMBOL_NOT_FOUND) 508 LogRel(("VRDE: Error resolving symbol '%s', rc %Rrc.\n", "VRDESupportedProperties", rc)); 509 } 510 else 511 { 512 if (szErr[0]) 513 LogRel(("VRDE: Error loading the library '%s': %s (%Rrc)\n", pszLibraryName, szErr, rc)); 514 else 515 LogRel(("VRDE: Error loading the library '%s' rc = %Rrc.\n", pszLibraryName, rc)); 516 517 hmod = NIL_RTLDRMOD; 518 } 519 520 if (RT_SUCCESS(rc)) 521 { 522 *phmod = hmod; 523 } 524 else 525 { 526 if (hmod != NIL_RTLDRMOD) 527 { 528 RTLdrClose(hmod); 529 hmod = NIL_RTLDRMOD; 530 } 531 } 532 533 return rc; 534 } 535 536 STDMETHODIMP VRDEServer::COMGETTER(VRDEProperties)(ComSafeArrayOut(BSTR, aProperties)) 537 { 538 if (ComSafeArrayOutIsNull(aProperties)) 539 return E_POINTER; 540 541 AutoCaller autoCaller(this); 542 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 543 544 size_t cProperties = 0; 545 546 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 547 if (!mData->mEnabled) 548 { 549 com::SafeArray<BSTR> properties(cProperties); 550 properties.detachTo(ComSafeArrayOutArg(aProperties)); 551 return S_OK; 552 } 553 alock.release(); 554 555 /* 556 * Check that a VRDE extension pack name is set and resolve it into a 557 * library path. 558 */ 559 Bstr bstrExtPack; 560 HRESULT hrc = COMGETTER(VRDEExtPack)(bstrExtPack.asOutParam()); 561 Log(("VRDEPROP: get extpack hrc 0x%08X, isEmpty %d\n", hrc, bstrExtPack.isEmpty())); 562 if (FAILED(hrc)) 563 return hrc; 564 if (bstrExtPack.isEmpty()) 565 return E_FAIL; 566 567 Utf8Str strExtPack(bstrExtPack); 568 Utf8Str strVrdeLibrary; 569 int vrc = VINF_SUCCESS; 570 if (strExtPack.equals(VBOXVRDP_KLUDGE_EXTPACK_NAME)) 571 strVrdeLibrary = "VBoxVRDP"; 572 else 573 { 574 #ifdef VBOX_WITH_EXTPACK 575 VirtualBox *pVirtualBox = mParent->getVirtualBox(); 576 ExtPackManager *pExtPackMgr = pVirtualBox->getExtPackManager(); 577 vrc = pExtPackMgr->getVrdeLibraryPathForExtPack(&strExtPack, &strVrdeLibrary); 578 #else 579 vrc = VERR_FILE_NOT_FOUND; 580 #endif 581 } 582 Log(("VRDEPROP: library get rc %Rrc\n", vrc)); 583 584 if (RT_SUCCESS(vrc)) 585 { 586 /* 587 * Load the VRDE library and start the server, if it is enabled. 588 */ 589 PFNVRDESUPPORTEDPROPERTIES pfn = NULL; 590 RTLDRMOD hmod = NIL_RTLDRMOD; 591 vrc = loadVRDELibrary(strVrdeLibrary.c_str(), &hmod, &pfn); 592 Log(("VRDEPROP: load library [%s] rc %Rrc\n", strVrdeLibrary.c_str(), vrc)); 593 if (RT_SUCCESS(vrc)) 594 { 595 const char * const *papszNames = pfn(); 596 597 if (papszNames) 598 { 599 size_t i; 600 for (i = 0; papszNames[i] != NULL; ++i) 601 { 602 cProperties++; 603 } 604 } 605 Log(("VRDEPROP: %d properties\n", cProperties)); 606 607 com::SafeArray<BSTR> properties(cProperties); 608 609 if (cProperties > 0) 610 { 611 size_t i; 612 for (i = 0; papszNames[i] != NULL && i < cProperties; ++i) 613 { 614 Bstr tmp(papszNames[i]); 615 tmp.cloneTo(&properties[i]); 616 } 617 } 618 619 /* Do not forget to unload the library. */ 620 RTLdrClose(hmod); 621 hmod = NIL_RTLDRMOD; 622 623 properties.detachTo(ComSafeArrayOutArg(aProperties)); 624 } 625 } 626 627 if (RT_FAILURE(vrc)) 628 { 629 return E_FAIL; 630 } 631 632 return S_OK; 633 } 489 634 490 635 STDMETHODIMP VRDEServer::COMGETTER(AuthType) (AuthType_T *aType) -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r35100 r35105 12758 12758 </attribute> 12759 12759 12760 <attribute name="VRDEProperties" type="wstring" readonly="yes" safearray="yes"> 12761 <desc> 12762 Array of names of properties, which are supported by this VRDE server. 12763 </desc> 12764 </attribute> 12765 12760 12766 <method name="setVRDEProperty"> 12761 12767 <desc> -
trunk/src/VBox/Main/include/VRDEServerImpl.h
r34574 r35105 88 88 STDMETHOD(COMGETTER(AuthLibrary)) (BSTR *aValue); 89 89 STDMETHOD(COMSETTER(AuthLibrary)) (IN_BSTR aValue); 90 STDMETHOD(COMGETTER(VRDEProperties)) (ComSafeArrayOut (BSTR, aProperties)); 90 91 91 92 // IVRDEServer methods
Note:
See TracChangeset
for help on using the changeset viewer.