Changeset 31957 in vbox for trunk/src/VBox
- Timestamp:
- Aug 25, 2010 1:27:52 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleVRDPServer.cpp
r31747 r31957 754 754 } break; 755 755 #endif /* VBOX_WITH_VRDP_VIDEO_CHANNEL */ 756 757 case VRDP_QP_FEATURE: 758 { 759 if (cbBuffer < sizeof(VRDPFEATURE)) 760 { 761 rc = VERR_INVALID_PARAMETER; 762 break; 763 } 764 765 size_t cbInfo = cbBuffer - RT_OFFSETOF(VRDPFEATURE, achInfo); 766 767 VRDPFEATURE *pFeature = (VRDPFEATURE *)pvBuffer; 768 769 size_t cchInfo = 0; 770 rc = RTStrNLenEx(pFeature->achInfo, cbInfo, &cchInfo); 771 772 if (RT_FAILURE(rc)) 773 { 774 rc = VERR_INVALID_PARAMETER; 775 break; 776 } 777 778 /* features are mapped to "VRDP/Feature/NAME" extra data. */ 779 com::Utf8Str extraData("VRDP/Feature/"); 780 extraData += pFeature->achInfo; 781 782 com::Bstr bstrValue; 783 784 /* @todo these features should be per client. */ 785 NOREF(pFeature->u32ClientId); 786 787 if ( RTStrICmp(pFeature->achInfo, "Client/DisableDisplay") == 0 788 || RTStrICmp(pFeature->achInfo, "Client/DisableInput") == 0 789 || RTStrICmp(pFeature->achInfo, "Client/DisableAudio") == 0 790 || RTStrICmp(pFeature->achInfo, "Client/DisableUSB") == 0 791 || RTStrICmp(pFeature->achInfo, "Client/DisableClipboard") == 0 792 ) 793 { 794 HRESULT hrc = server->mConsole->machine ()->GetExtraData(com::Bstr(extraData), bstrValue.asOutParam()); 795 if (hrc == S_OK && !bstrValue.isEmpty()) 796 { 797 rc = VINF_SUCCESS; 798 } 799 } 800 else 801 { 802 rc = VERR_NOT_SUPPORTED; 803 } 804 805 /* Copy the value string to the callers buffer. */ 806 if (rc == VINF_SUCCESS) 807 { 808 com::Utf8Str value = bstrValue; 809 810 size_t cb = value.length() + 1; 811 812 if ((size_t)cbInfo >= cb) 813 { 814 memcpy(pFeature->achInfo, value.c_str(), cb); 815 } 816 else 817 { 818 rc = VINF_BUFFER_OVERFLOW; 819 } 820 821 *pcbOut = (uint32_t)cb; 822 } 823 } break; 756 824 757 825 case VRDP_SP_NETWORK_BIND_PORT:
Note:
See TracChangeset
for help on using the changeset viewer.