Hello,

Many thanks for pointing that piece of code it really helped.
There is a nice example as well here:
https://www.codeproject.com/Articles/714651/Desktop-Sharing-using-RDP-APIs-and-Socket

For what I can see Windows Desktop Sharing API creates
AuthConnectionString2 and remote assistance generates AuthConnectionString1
that can enable remote assistance virtual channel. AuthConnectionString2
can only enable multiparty channel.

Thanks again.

Jaime.

On Fri, Mar 3, 2017 at 4:10 PM, Marc-André Moreau <
marcandre.mor...@gmail.com> wrote:

> Hi Jaime,
>
> You can refer to the following code to see how to parse the connection
> string, extract its components, and feed the proper parameters to the
> freerdp client afterwards.
>
> We have a special "shadow" server that has multiple capture techniques on
> Windows, one of which involves creating a local desktop sharing invitation
> and connecting to it as a way of "capturing". It's inefficient, but it
> works and it shows how to use the APIs.
>
> The interesting code starts here:
>
> https://github.com/FreeRDP/FreeRDP/blob/master/server/
> shadow/Win/win_wds.c#L747
> hr = 
> subsystem->pInvitation->lpVtbl->get_ConnectionString(subsystem->pInvitation,
> &bstrConnectionString);
>
> The parsing is handled with the the rdpAssistanceFile* structure and
> functions from <freerdp/assistance.h>:
>
> rdpAssistanceFile* file = freerdp_assistance_file_new();
> file->ConnectionString2 = <your connection string>;
> status = freerdp_assistance_parse_connection_string2(file);
>
> The expanded members of the string will be stored in rdpAssistanceFile*.
>
> The configuration of the freerdp client settings starts here:
>
> https://github.com/FreeRDP/FreeRDP/blob/master/server/
> shadow/Win/win_wds.c#L810
>
> freerdp_set_param_bool(settings, FreeRDP_RemoteAssistanceMode, TRUE);
> freerdp_set_param_string(settings, FreeRDP_RemoteAssistanceSessionId,
> file->RASessionId);
> freerdp_set_param_string(settings, FreeRDP_RemoteAssistanceRCTicket,
> file->ConnectionString2);
> freerdp_set_param_string(settings, FreeRDP_Domain, "RDP");
> freerdp_set_param_string(settings, FreeRDP_Username, "Shadow");
> freerdp_set_param_string(settings, FreeRDP_RemoteAssistancePassword,
> "Shadow123!");
> freerdp_set_param_bool(settings, FreeRDP_AutoLogonEnabled, TRUE);
> freerdp_set_param_string(settings, FreeRDP_ServerHostname,
> file->MachineAddress);
> freerdp_set_param_uint32(settings, FreeRDP_ServerPort, file->MachinePort);
> freerdp_set_param_uint32(settings, FreeRDP_DesktopWidth, width);
> freerdp_set_param_uint32(settings, FreeRDP_DesktopHeight, height);
>
> Some of the parameters are hardcoded, because they have been hardcoded in
> the invitation creation as well for simplicity.
>
> Experiment with this code, and adapt it to the shadowing use case. It may
> take some trial and error before you get it right, I don't expect it to be
> 100% identical in configuration to a remote assistance session.
>
> Best regards,
> -Marc-Andre
>
> On Fri, Mar 3, 2017 at 9:56 AM, Jaime Crespo <jaime.crespo....@gmail.com>
> wrote:
>
>> Hello,
>>
>> Many thanks for the info. Using SessEnvRpc.idl or Windows Desktop
>> Sharing API you can obtain an auth string and password
>> that can be used in Windows Desktop Sharing API IRDPSRAPIViewer::Connect
>> method to connect to the session running in the target session (specified
>> by TargetSessionId).
>>
>> But I can not see how can I join that with FreeRDP as the auth string is
>> used on IRDPSRAPIViewer
>> <https://msdn.microsoft.com/en-us/library/aa373327(v=vs.85).aspx> that
>> is an activeX interface.
>> Do you have any idea how? Thanks again,
>>
>> Regards,
>>
>> Jaime.
>>
>>
>>
>> On Wed, Mar 1, 2017 at 2:16 PM, <bernhard.mikla...@shacknet.at> wrote:
>>
>>> Hi,
>>>
>>> On Wed, Mar 01, 2017 at 09:32:11AM +0100, Jaime Crespo wrote:
>>> > Thanks for your answer. Do you know where could I find more
>>> > documentation/info about how that process works?
>>> > I have been looking around the tech docs on:
>>> > https://msdn.microsoft.com/en-us/library/jj712081.aspx
>>> > but I could not find anything.
>>> I'd guess it's documented somewhere there but I haven't found that
>>> exact spot yet.
>>> The RDP connection itself seems to be regular but on a different
>>> TCP port. What I'm not sure yet is how the initiation is done.
>>>
>>> As I initially thought it's all done with RDP I started the FreeRDP
>>> shadow server for testing and tried to connect with the /shadow:
>>> parameter from a Windows 10. What happened is that mstsc said "The
>>> computer name is invalid" after a while. When doing a TCP dump you will
>>> see that before the RDP itself happens some SMB messages are exchanged
>>> on port 445 (also after the RDP session is torn down).
>>>
>>> Best regards,
>>> Bernhard
>>>
>>
>>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
FreeRDP-devel mailing list
FreeRDP-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freerdp-devel

Reply via email to