On Wed, Sep 26, 2018 at 3:15 PM, Alexandr via FreeRDP-devel
<[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> В Ср, 26/09/2018 в 18:02 +0300, Alexandr пишет:
>> В Ср, 26/09/2018 в 08:49 -0500, Eric Brown via FreeRDP-devel пишет:
>> > freerdp_client_settings_parse_command_line
>>
>> Sorry for confusion, looks like my questions is not precise enough.
>> THe problem is what for some reason in my case libfreerdp do not
>> using
>> instance->settings strructure, which lead for example to
>> https://github.com/FreeRDP/FreeRDP/issues/4890 this problem, which is
>> looks like a bug.
>>
>> so my question is how to pass allocated and filled "rdpSettings*" to
>> allocated "freerdp*"
>>
>> under gdb i can see what
>> libfreerdp/core/connectionc:rdp_client_connect
>> using freerdp->context->rdp->settings which is != freerdp->settings.
>> so my question is: How to pass "rdpSettings*" to "freerdp*" properly.
>> or what additional steps i need to do for whole thing to work.
>>
>> also, can it be build issue ?, i am building freerdp like this:
>> "cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF
>> -DWITH_LIBSYSTEMD=OFF -DBUILTIN_CHANNELS=ON -DWITH_OSS=OFF
>> -DWITH_ALSA=OFF -DWITH_SERVER=OFF -DWITH_SERVER_INTERFACE=OFF
>> -DWITH_WAYLAND=OFF -DWITH_X11=OFF -DWITH_SERVER_CHANNELS=OFF
>> -DWITH_CLIENT_CHANNELS=OFF -DWITH_THIRD_PARTY=ON"
>
> ok, so i have done some research on this problem.
>
> i am able to have working sample with replacing:
> "i->instance->settings = freerdp_settings_new(0);"
> with:
>
> char **argv = malloc(sizeof(char*));
> argv[0] = strdup("./core");
> freerdp_client_settings_parse_command_line(i->instance-
>>settings, 1, argv, FALSE);
> free(argv[0]);
> free(argv);
>
At the end of this message you will find all the code I use that
interacts with the settings structure. I apologize, I would give you
the complete project but there is still some work to be done.
> i still do not understand why freerdp_settings_new does not work.
> using freerdp_client_settings_parse_command_line introduce a lot of
> additional dependenices from freerdp optional libraries:
> "../../3rdparty/FreeRDP/build/client/common/libfreerdp-
> client2.a;../../3rdparty/FreeRDP/build/channels/geometry/client/libgeom
> etry-
> client.a;../../3rdparty/FreeRDP/build/channels/rdpgfx/client/librdpgfx-
> client.a;../../3rdparty/FreeRDP/build/channels/video/client/libvideo-
> client.a;../../3rdparty/FreeRDP/build/channels/parallel/client/libparal
> lel-
> client.a;../../3rdparty/FreeRDP/build/channels/drive/client/libdrive-
> client.a;../../3rdparty/FreeRDP/build/channels/cliprdr/client/libcliprd
> r-
> client.a;../../3rdparty/FreeRDP/build/channels/drdynvc/client/libdrdynv
> c-client.a;../../3rdparty/FreeRDP/build/channels/tsmf/client/libtsmf-
> client.a;../../3rdparty/FreeRDP/build/channels/remdesk/client/libremdes
> k-client.a;../../3rdparty/FreeRDP/build/channels/rdpdr/client/librdpdr-
> client.a;../../3rdparty/FreeRDP/build/channels/rdpei/client/librdpei-
> client.a;../../3rdparty/FreeRDP/build/channels/encomsp/client/libencoms
> p-client.a;../../3rdparty/FreeRDP/build/channels/audin/client/libaudin-
> client.a;../../3rdparty/FreeRDP/build/channels/disp/client/libdisp-
> client.a;../../3rdparty/FreeRDP/build/channels/echo/client/libecho-
> client.a;../../3rdparty/FreeRDP/build/channels/rail/client/librail-
> client.a;../../3rdparty/FreeRDP/build/channels/serial/client/libserial-
> client.a;../../3rdparty/FreeRDP/build/channels/rdpsnd/client/librdpsnd-
> client.a;../../3rdparty/FreeRDP/build/channels/rdpsnd/client/fake/librd
> psnd-client-
> fake.a;../../3rdparty/FreeRDP/build/channels/smartcard/client/libsmartc
> ard-client.a"
> which is completely unwanted.
>
As you can see below there is not a lot being done with the settings.
Starting the client with the structure mostly uninitialized works,
i.e. avoiding a call to the command line parser but simply populating
host, user, and password.
Can you be more specific in how it does not work? I had other errors
but they were related to failing to link in freerdp-client which at
this point seems to be necessary. If you want to avoid the
dependencies you've given you will need to distribute a specially
configured libfreerdp which does not depend on them.
Cheers,
R0b0t1
---
BOOL rdpuppet_preconnect(freerdp *instance)
{
printf("rdpuppet_preconnect\n");
if ((PubSub_SubscribeChannelConnected(
instance->context->pubSub,
rdpuppet_channel_connected)) != CHANNEL_RC_OK)
return FALSE;
if ((PubSub_SubscribeChannelDisconnected(
instance->context->pubSub,
rdpuppet_channel_disconnected)) != CHANNEL_RC_OK)
return FALSE;
/*
if (freerdp_client_load_addins(instance->context->channels,
instance->settings))
return FALSE;
*/
rdpSettings *settings;
BOOL bitmap_cache;
if (!instance)
return FALSE;
settings = instance->settings;
if (!settings || !settings->OrderSupport)
return FALSE;
bitmap_cache = settings->BitmapCacheEnabled;
settings->OrderSupport[NEG_DSTBLT_INDEX] = TRUE;
settings->OrderSupport[NEG_PATBLT_INDEX] = TRUE;
settings->OrderSupport[NEG_SCRBLT_INDEX] = TRUE;
settings->OrderSupport[NEG_OPAQUE_RECT_INDEX] = TRUE;
settings->OrderSupport[NEG_DRAWNINEGRID_INDEX] = FALSE;
settings->OrderSupport[NEG_MULTIDSTBLT_INDEX] = FALSE;
settings->OrderSupport[NEG_MULTIPATBLT_INDEX] = FALSE;
settings->OrderSupport[NEG_MULTISCRBLT_INDEX] = FALSE;
settings->OrderSupport[NEG_MULTIOPAQUERECT_INDEX] = TRUE;
settings->OrderSupport[NEG_MULTI_DRAWNINEGRID_INDEX] = FALSE;
settings->OrderSupport[NEG_LINETO_INDEX] = TRUE;
settings->OrderSupport[NEG_POLYLINE_INDEX] = TRUE;
settings->OrderSupport[NEG_MEMBLT_INDEX] = bitmap_cache;
settings->OrderSupport[NEG_MEM3BLT_INDEX] = TRUE;
settings->OrderSupport[NEG_MEMBLT_V2_INDEX] = bitmap_cache;
settings->OrderSupport[NEG_MEM3BLT_V2_INDEX] = FALSE;
settings->OrderSupport[NEG_SAVEBITMAP_INDEX] = FALSE;
settings->OrderSupport[NEG_GLYPH_INDEX_INDEX] = TRUE;
settings->OrderSupport[NEG_FAST_INDEX_INDEX] = TRUE;
settings->OrderSupport[NEG_FAST_GLYPH_INDEX] = TRUE;
settings->OrderSupport[NEG_POLYGON_SC_INDEX] = FALSE;
settings->OrderSupport[NEG_POLYGON_CB_INDEX] = FALSE;
settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = FALSE;
settings->OrderSupport[NEG_ELLIPSE_CB_INDEX] = FALSE;
return TRUE;
}
// ... snip ...
int rdpuppet_parse_command_line(
struct rdpuppet_context *puppet_context,
int argc, char *argv[]
)
{
printf("rdpuppet_parse_command_line\n");
rdpSettings *rds = puppet_context->rdp_context.settings;
int r = 0;
if ((r = freerdp_client_settings_parse_command_line(rds, argc, argv, 0)))
printf("freerdp_client_settings_parse_command_line\n");
freerdp_client_settings_command_line_status_print(rds, r, argc, argv);
return r;
}
int rdpuppet_setup(
struct rdpuppet_context *puppet_context,
char *hostname,
char *username,
char *password
)
{
rdpSettings *rds = puppet_context->rdp_context.settings;
rds->ServerHostname = hostname;
rds->Username = username;
rds->Password = password;
return 0;
}
_______________________________________________
FreeRDP-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freerdp-devel