1. There is `gdi->stride` which is the byte size of a line, so you donĀ“t need to calculate it yourself (the lines might have additional alignment) 2. If you set freerdp_settings_set_bool(context->settings, FreeRDP_IgnoreCertificate, TRUE) the command line /cert-ignore is useless
3. /gdi:hw is useless, only does something in xfreerdp
4. Where do you call your dump function? `EndPaint` callback should be the place to capture such data. 5. Check FreeRDP_DeactivateClientDecoding is FALSE otherwise no data will be decoded (this is done in tf_post_connect as the sample client does not output anything)

regards
Armin

On 12.10.21 02:13, ontario78 ontario78 via FreeRDP-devel wrote:
Greetings, here i try to make use of example provided with freerdp project - 
'tf_client.c'
I did alter settings a bit, i hardcoded:
" if (!freerdp_settings_set_bool(context->settings, FreeRDP_IgnoreCertificate, 
TRUE)) return FALSE;
if (!freerdp_settings_set_bool(context->settings, FreeRDP_Authentication, FALSE)) 
return FALSE; if (!freerdp_settings_set_bool(context->settings, 
FreeRDP_AuthenticationOnly, FALSE)) return FALSE; 
if(!freerdp_settings_set_bool(context->settings, FreeRDP_NlaSecurity, FALSE)) return 
FALSE;
"
And i connect to target server, which runs on Win 2012R2 x64 with options: 
/cert-ignore /gdi:hw
I get zeroes inside gdi->primary_buffer in tf_end_paint, i want to capture 
bitmap in there, and save to disk, i pulled function from remmina and made it save 
primary buffer on the disk.
static BOOL remmina_rdp_get_screenshot_test(rdpContext *ctx) {
rdpGdi *gdi; size_t szmem;
UINT32 bytesPerPixel; UINT32 bitsPerPixel;
gdi = ctx->gdi;
bytesPerPixel = GetBytesPerPixel(gdi->hdc->format); bitsPerPixel = 
GetBitsPerPixel(gdi->hdc->format); szmem = gdi->width * gdi->height * bytesPerPixel;
sprintf(namebuf, "%s%d","output",n); n++; FILE * fp = fopen(namebuf,"wb"); 
fwrite(gdi->primary_buffer,1,szmem,fp); fclose(fp);
return TRUE; }
static BOOL tf_end_paint(rdpContext* context) { rdpGdi* gdi = context->gdi;
remmina_rdp_get_screenshot_test(ctx); if 
(gdi->primary->hdc->hwnd->invalid->null) return TRUE;
return TRUE; }
I got a lot ouf out<number> files filled with zeroes. There was issue with 
screenshoting in this mailing list, unfortunately the user who posted it, delete code 
listing of how he solved it. Hope somebody can help

_______________________________________________
FreeRDP-devel mailing list
FreeRDP-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freerdp-devel



_______________________________________________
FreeRDP-devel mailing list
FreeRDP-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freerdp-devel

Reply via email to