summaryrefslogtreecommitdiffstats
path: root/rdp/rdp_rdp.c
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2005-12-14 01:11:34 +0000
committerjsorg71 <jsorg71>2005-12-14 01:11:34 +0000
commit4e93fc3c373c0fa85efee998fa2f6aa4fde822cd (patch)
tree90436de484fc2de80300c13305ebf0a40c955bf3 /rdp/rdp_rdp.c
parentc46c748148bb8e1d6b48bb2740adf6b2d1a11b1b (diff)
downloadxrdp-proprietary-4e93fc3c373c0fa85efee998fa2f6aa4fde822cd.tar.gz
xrdp-proprietary-4e93fc3c373c0fa85efee998fa2f6aa4fde822cd.zip
started rec file
Diffstat (limited to 'rdp/rdp_rdp.c')
-rw-r--r--rdp/rdp_rdp.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/rdp/rdp_rdp.c b/rdp/rdp_rdp.c
index 62cef281..e4e07e05 100644
--- a/rdp/rdp_rdp.c
+++ b/rdp/rdp_rdp.c
@@ -35,6 +35,7 @@ rdp_rdp_create(struct mod* owner)
self->bitmap_cache = 1;
self->desktop_save = 0;
self->orders = rdp_orders_create(self);
+ self->rec_mode = 0;
return self;
}
@@ -48,6 +49,11 @@ rdp_rdp_delete(struct rdp_rdp* self)
}
rdp_orders_delete(self->orders);
rdp_sec_delete(self->sec_layer);
+ if (self->rec_fd != 0)
+ {
+ g_file_close(self->rec_fd);
+ self->rec_fd = 0;
+ }
g_free(self);
}
@@ -1010,3 +1016,59 @@ rdp_rdp_process_demand_active(struct rdp_rdp* self, struct stream* s)
rdp_orders_reset_state(self->orders);
return 0;
}
+
+/******************************************************************************/
+int APP_CC
+rdp_rec_check_file(struct rdp_rdp* self)
+{
+ char file_name[256];
+ int index;
+ int len;
+ struct stream* s;
+
+ if (self->rec_fd == 0)
+ {
+ index = 1;
+ g_sprintf(file_name, "rec%8.8d.rec", index);
+ while (g_file_exist(file_name))
+ {
+ index++;
+ if (index >= 9999)
+ {
+ return 1;
+ }
+ g_sprintf(file_name, "rec%8.8d.rec", index);
+ }
+ self->rec_fd = g_file_open(file_name);
+ make_stream(s);
+ init_stream(s, 8192);
+ out_uint8a(s, "XRDPREC1", 8);
+ out_uint8s(s, 8);
+ s_mark_end(s);
+ len = s->end - s->data;
+ g_file_write(self->rec_fd, s->data, len);
+ free_stream(s);
+ }
+ return 0;
+}
+
+/******************************************************************************/
+int APP_CC
+rdp_rec_write_item(struct rdp_rdp* self, struct stream* s)
+{
+ int len;
+ int time;
+
+ if (self->rec_fd == 0)
+ {
+ return 1;
+ }
+ time = g_time1();
+ out_uint32_le(s, time);
+ s_mark_end(s);
+ len = s->end - s->data;
+ s_pop_layer(s, iso_hdr);
+ out_uint32_le(s, len);
+ g_file_write(self->rec_fd, s->data, len);
+ return 0;
+}