VirtualBox

Ignore:
Timestamp:
Jul 16, 2009 10:16:31 AM (15 years ago)
Author:
vboxsync
Message:

Pass RDP client name via a guest property (xTracker #4123)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r21404 r21639  
    659659    }
    660660
     661    /* Set guest properties. */
     662    int rc;
     663    char *pszPropertyName;
     664    rc = RTStrAPrintf(&pszPropertyName, "/VirtualBox/HostInfo/VRDP/Client/%d/Name", u32ClientId);
     665    if (RT_SUCCESS(rc))
     666    {
     667        Bstr clientName;
     668        mRemoteDisplayInfo->COMGETTER(ClientName)(clientName.asOutParam());
     669
     670        mMachine->SetGuestPropertyValue(Bstr(pszPropertyName), clientName);
     671        RTStrFree(pszPropertyName);
     672    }
     673
     674    char *pszClientId;
     675    rc = RTStrAPrintf(&pszClientId, "%d", u32ClientId);
     676    if (RT_SUCCESS(rc))
     677    {
     678        mMachine->SetGuestPropertyValue(Bstr("/VirtualBox/HostInfo/VRDP/LastConnectedClient"), Bstr(pszClientId));
     679        RTStrFree(pszClientId);
     680    }
     681
    661682    return VINF_SUCCESS;
    662683}
     
    749770    if (authType == VRDPAuthType_External)
    750771        mConsoleVRDPServer->AuthDisconnect (uuid, u32ClientId);
     772
     773    /* Reset guest properties for the client. */
     774    int rc;
     775    char *pszPropertyName;
     776    rc = RTStrAPrintf(&pszPropertyName, "/VirtualBox/HostInfo/VRDP/Client/%d/Name", u32ClientId);
     777    if (RT_SUCCESS(rc))
     778    {
     779        mMachine->SetGuestPropertyValue(Bstr(pszPropertyName), Bstr(""));
     780        RTStrFree(pszPropertyName);
     781    }
     782
     783    char *pszClientId;
     784    rc = RTStrAPrintf(&pszClientId, "%d", u32ClientId);
     785    if (RT_SUCCESS(rc))
     786    {
     787        mMachine->SetGuestPropertyValue(Bstr("/VirtualBox/HostInfo/VRDP/LastDisconnectedClient"), Bstr(pszClientId));
     788        RTStrFree(pszClientId);
     789    }
    751790
    752791    LogFlowFuncLeave();
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette