Changeset 22663 in vbox
- Timestamp:
- Sep 1, 2009 2:02:28 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
include/VBox/vrdpapi.h (modified) (2 diffs)
-
src/VBox/Main/ConsoleVRDPServer.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vrdpapi.h
r22044 r22663 951 951 #define VRDP_QP_NETWORK_ADDRESS (2) 952 952 #define VRDP_QP_NUMBER_MONITORS (3) 953 #define VRDP_QP_NETWORK_PORT_RANGE (4) 954 955 #define VRDP_SP_BASE 0x1000 956 #define VRDP_SP_NETWORK_BIND_PORT (VRDP_SP_BASE + 1) 953 957 954 958 #pragma pack(1) … … 1006 1010 1007 1011 /** 1008 * Query various information, on how the VRDP server must operate, from the application. 1012 * Query or set various information, on how the VRDP server operates, from or to the application. 1013 * 1009 1014 * 1010 1015 * @param pvCallback The callback specific pointer. -
trunk/src/VBox/Main/ConsoleVRDPServer.cpp
r21878 r22663 706 706 707 707 *pcbOut = sizeof (uint32_t); 708 } break; 709 710 case VRDP_QP_NETWORK_PORT_RANGE: 711 { 712 com::Bstr bstr; 713 HRESULT hrc = server->mConsole->machine ()->GetExtraData(Bstr("VBoxInternal2/VRDPPortRange"), bstr.asOutParam()); 714 if (hrc != S_OK) 715 { 716 bstr = ""; 717 } 718 719 /* The server expects UTF8. */ 720 com::Utf8Str portRange = bstr; 721 722 size_t cbPortRange = portRange.length () + 1; 723 724 if (cbPortRange >= 0x10000) 725 { 726 /* More than 64K seems to be an invalid port range string. */ 727 rc = VERR_TOO_MUCH_DATA; 728 break; 729 } 730 731 if ((size_t)cbBuffer >= cbPortRange) 732 { 733 if (cbPortRange > 0) 734 { 735 if (portRange.raw()) 736 { 737 memcpy (pvBuffer, portRange.raw(), cbPortRange); 738 } 739 else 740 { 741 /* The value is an empty string. */ 742 *(uint8_t *)pvBuffer = 0; 743 } 744 } 745 746 rc = VINF_SUCCESS; 747 } 748 else 749 { 750 rc = VINF_BUFFER_OVERFLOW; 751 } 752 753 *pcbOut = (uint32_t)cbPortRange; 754 } break; 755 756 case VRDP_SP_NETWORK_BIND_PORT: 757 { 758 if (cbBuffer != sizeof (uint32_t)) 759 { 760 rc = VERR_INVALID_PARAMETER; 761 break; 762 } 763 764 ULONG port = *(uint32_t *)pvBuffer; 765 766 com::Bstr bstr = Utf8StrFmt("%d", port); 767 768 server->mConsole->machine ()->SetExtraData(Bstr("VBoxInternal2/VRDPBindPort"), bstr); 769 770 rc = VINF_SUCCESS; 771 772 if (pcbOut) 773 { 774 *pcbOut = sizeof (uint32_t); 775 } 708 776 } break; 709 777
Note:
See TracChangeset
for help on using the changeset viewer.

