Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/Remmina/Remmina.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2013-06-10 05:20:57 +0400
committerMike Gilbert <floppym@gentoo.org>2013-06-10 05:20:57 +0400
commitf40bcf97e97cb34648383bd7da0d6cc5b0ad233b (patch)
tree170668916246bd437bdb83e5973955f011c668be /remmina-plugins/rdp
parentd23012f2783f7821f1707e4978d8a17cdc00b7ff (diff)
Replace the rest of the stream macros with the new Stream macros from winpr/stream.h
Diffstat (limited to 'remmina-plugins/rdp')
-rw-r--r--remmina-plugins/rdp/rdp_cliprdr.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/remmina-plugins/rdp/rdp_cliprdr.c b/remmina-plugins/rdp/rdp_cliprdr.c
index 3192ceef2..313aa1b75 100644
--- a/remmina-plugins/rdp/rdp_cliprdr.c
+++ b/remmina-plugins/rdp/rdp_cliprdr.c
@@ -200,7 +200,7 @@ void remmina_rdp_cliprdr_process_data_request(RemminaProtocolWidget* gp, RDP_CB_
void remmina_rdp_cliprdr_process_data_response(RemminaProtocolWidget* gp, RDP_CB_DATA_RESPONSE_EVENT* event)
{
UINT8* data;
- int size;
+ size_t size;
rfContext* rfi = GET_DATA(gp);
GdkPixbufLoader *pixbuf;
gpointer output = NULL;
@@ -235,29 +235,26 @@ void remmina_rdp_cliprdr_process_data_response(RemminaProtocolWidget* gp, RDP_CB
UINT32 offset;
UINT32 ncolors;
- s = Stream_New(NULL, 0);
- stream_attach(s, data, size);
- stream_seek(s, 14);
- stream_read_UINT16(s, bpp);
- stream_read_UINT32(s, ncolors);
+ s = Stream_New(data, size);
+ Stream_Seek(s, 14);
+ Stream_Read_UINT16(s, bpp);
+ Stream_Read_UINT32(s, ncolors);
offset = 14 + 40 + (bpp <= 8 ? (ncolors == 0 ? (1 << bpp) : ncolors) * 4 : 0);
- stream_detach(s);
Stream_Free(s, TRUE);
s = Stream_New(NULL, 14 + size);
- stream_write_BYTE(s, 'B');
- stream_write_BYTE(s, 'M');
- stream_write_UINT32(s, 14 + size);
- stream_write_UINT32(s, 0);
- stream_write_UINT32(s, offset);
- stream_write(s, data, size);
-
- data = stream_get_head(s);
- size = stream_get_length(s);
- stream_detach(s);
- Stream_Free(s, TRUE);
+ Stream_Write_UINT8(s, 'B');
+ Stream_Write_UINT8(s, 'M');
+ Stream_Write_UINT32(s, 14 + size);
+ Stream_Write_UINT32(s, 0);
+ Stream_Write_UINT32(s, offset);
+ Stream_Write(s, data, size);
+
+ data = Stream_Buffer(s);
+ size = Stream_Length(s);
pixbuf = gdk_pixbuf_loader_new();
gdk_pixbuf_loader_write(pixbuf, data, size, NULL);
+ Stream_Free(s, TRUE);
output = g_object_ref(gdk_pixbuf_loader_get_pixbuf(pixbuf));
gdk_pixbuf_loader_close(pixbuf, NULL);
g_object_unref(pixbuf);