Changeset 39493 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Dec 1, 2011 3:42:02 PM (13 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r39435 r39493 809 809 } 810 810 811 void Console::guestPropertiesVRDPUpdateClientAttach(uint32_t u32ClientId, bool fAttached) 812 { 813 if (!guestPropertiesVRDPEnabled()) 814 return; 815 816 Bstr bstrReadOnlyGuest(L"RDONLYGUEST"); 817 818 char szPropNm[256]; 819 RTStrPrintf(szPropNm, sizeof(szPropNm), "/VirtualBox/HostInfo/VRDP/Client/%u/Attach", u32ClientId); 820 821 Bstr bstrValue = fAttached? "1": "0"; 822 823 mMachine->SetGuestProperty(Bstr(szPropNm).raw(), 824 bstrValue.raw(), 825 bstrReadOnlyGuest.raw()); 826 } 827 811 828 void Console::guestPropertiesVRDPUpdateDisconnect(uint32_t u32ClientId) 812 829 { … … 826 843 827 844 RTStrPrintf(szPropNm, sizeof(szPropNm), "/VirtualBox/HostInfo/VRDP/Client/%u/Domain", u32ClientId); 845 mMachine->SetGuestProperty(Bstr(szPropNm).raw(), NULL, 846 bstrReadOnlyGuest.raw()); 847 848 RTStrPrintf(szPropNm, sizeof(szPropNm), "/VirtualBox/HostInfo/VRDP/Client/%u/Attach", u32ClientId); 828 849 mMachine->SetGuestProperty(Bstr(szPropNm).raw(), NULL, 829 850 bstrReadOnlyGuest.raw()); … … 1088 1109 } 1089 1110 1090 void Console::VRDPClient NameChange(uint32_t u32ClientId, const char *pszName)1111 void Console::VRDPClientStatusChange(uint32_t u32ClientId, const char *pszStatus) 1091 1112 { 1092 1113 LogFlowFuncEnter(); … … 1095 1116 AssertComRCReturnVoid(autoCaller.rc()); 1096 1117 1097 guestPropertiesVRDPUpdateNameChange(u32ClientId, pszName); 1118 /* Parse the status string. */ 1119 if (RTStrICmp(pszStatus, "ATTACH") == 0) 1120 { 1121 guestPropertiesVRDPUpdateClientAttach(u32ClientId, true); 1122 } 1123 else if (RTStrICmp(pszStatus, "DETACH") == 0) 1124 { 1125 guestPropertiesVRDPUpdateClientAttach(u32ClientId, false); 1126 } 1127 else if (RTStrNICmp(pszStatus, "NAME=", strlen("NAME=")) == 0) 1128 { 1129 guestPropertiesVRDPUpdateNameChange(u32ClientId, pszStatus + strlen("NAME=")); 1130 } 1131 1132 LogFlowFuncLeave(); 1098 1133 } 1099 1134 -
trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp
r39435 r39493 856 856 } break; 857 857 858 case VRDE_SP_CLIENT_ NAME:859 { 860 if (cbBuffer < sizeof(VRDECLIENT NAME))858 case VRDE_SP_CLIENT_STATUS: 859 { 860 if (cbBuffer < sizeof(VRDECLIENTSTATUS)) 861 861 { 862 862 rc = VERR_INVALID_PARAMETER; … … 864 864 } 865 865 866 size_t cbName = cbBuffer - RT_OFFSETOF(VRDECLIENTNAME, achName); 867 868 VRDECLIENTNAME *pClientName = (VRDECLIENTNAME *)pvBuffer; 869 870 size_t cchName = 0; 871 rc = RTStrNLenEx(pClientName->achName, cbName, &cchName); 872 873 if (RT_FAILURE(rc)) 866 size_t cbStatus = cbBuffer - RT_UOFFSETOF(VRDECLIENTSTATUS, achStatus); 867 868 VRDECLIENTSTATUS *pStatus = (VRDECLIENTSTATUS *)pvBuffer; 869 870 if (cbBuffer < RT_UOFFSETOF(VRDECLIENTSTATUS, achStatus) + pStatus->cbStatus) 874 871 { 875 872 rc = VERR_INVALID_PARAMETER; … … 877 874 } 878 875 879 Log(("VRDE_SP_CLIENT_NAME [%s]\n", pClientName->achName)); 880 881 server->mConsole->VRDPClientNameChange(pClientName->u32ClientId, pClientName->achName); 876 size_t cchStatus = 0; 877 rc = RTStrNLenEx(pStatus->achStatus, cbStatus, &cchStatus); 878 879 if (RT_FAILURE(rc)) 880 { 881 rc = VERR_INVALID_PARAMETER; 882 break; 883 } 884 885 Log(("VRDE_SP_CLIENT_STATUS [%s]\n", pStatus->achStatus)); 886 887 server->mConsole->VRDPClientStatusChange(pStatus->u32ClientId, pStatus->achStatus); 882 888 883 889 rc = VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.