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

Reply via email to