boolean frame_marker;
boolean bitmap_cache_v3;
+ uint8 received_caps[32];
uint8 order_support[32];
boolean color_pointer;
boolean frame_acknowledge;
+ uint8* app_name;
boolean remote_app;
- char app_name[64];
- int desktop_save;
- int polygon_ellipse_orders;
- int off_screen_bitmaps;
- int triblt;
- int new_cursors;
- int mouse_motion;
int rfx_flags;
int ui_decode_flags;
- int use_frame_ack;
- int software_gdi;
+ boolean mouse_motion;
};
typedef struct rdp_settings rdpSettings;
void rdp_write_offscreen_bitmap_cache_capability_set(STREAM* s, rdpSettings* settings)
{
uint8* header;
+ uint32 offscreenSupportLevel;
header = rdp_capability_set_start(s);
- stream_read_uint32(s, settings->offscreen_bitmap_cache); /* offscreenSupportLevel (4 bytes) */
+ if (settings->offscreen_bitmap_cache)
+ offscreenSupportLevel = True;
+
+ stream_read_uint32(s, offscreenSupportLevel); /* offscreenSupportLevel (4 bytes) */
stream_write_uint16(s, settings->offscreen_bitmap_cache_size); /* offscreenCacheSize (2 bytes) */
stream_write_uint16(s, settings->offscreen_bitmap_cache_entries); /* offscreenCacheEntries (2 bytes) */
rdp_read_capability_set_header(s, &length, &type);
printf("%s Capability Set (0x%02X), length:%d\n", CAPSET_TYPE_STRINGS[type], type, length);
-
+ settings->received_caps[type] = True;
em = bm + length;
switch (type)
rdp_write_color_cache_capability_set(s, settings);
rdp_write_window_activation_capability_set(s, settings);
+ if (settings->offscreen_bitmap_cache)
+ {
+ numberCapabilities++;
+ rdp_write_offscreen_bitmap_cache_capability_set(s, settings);
+ }
+
+ if (settings->received_caps[CAPSET_TYPE_MULTI_FRAGMENT_UPDATE])
+ {
+ numberCapabilities++;
+ rdp_write_multifragment_update_capability_set(s, settings);
+ }
+
+ if (settings->received_caps[CAPSET_TYPE_LARGE_POINTER])
+ {
+ numberCapabilities++;
+ rdp_write_large_pointer_capability_set(s, settings);
+ }
+
+ if (settings->received_caps[CAPSET_TYPE_SURFACE_COMMANDS])
+ {
+ numberCapabilities++;
+ rdp_write_surface_commands_capability_set(s, settings);
+ }
+
+#if 0
+ if (settings->received_caps[CAPSET_TYPE_BITMAP_CODECS])
+ {
+ numberCapabilities++;
+ rdp_write_bitmap_codecs_capability_set(s, settings);
+ }
+
+#endif
+
+ if (settings->received_caps[CAPSET_TYPE_FRAME_ACKNOWLEDGE])
+ {
+ if (settings->frame_acknowledge)
+ {
+ numberCapabilities++;
+ rdp_write_frame_acknowledge_capability_set(s, settings);
+ }
+ }
+
stream_get_mark(s, em);
stream_set_mark(s, lm); /* go back to lengthCombinedCapabilities */
rdp_send_pdu(rdp, s, PDU_TYPE_CONFIRM_ACTIVE, MCS_BASE_CHANNEL_ID + rdp->mcs->user_id);
}
-void rdp_read_deactivate_all(STREAM* s, rdpSettings* settings)
+void rdp_recv_deactivate_all(rdpRdp* rdp, STREAM* s)
{
+ uint16 lengthSourceDescriptor;
+
printf("Deactivate All PDU\n");
+
+ stream_read_uint32(s, rdp->settings->share_id); /* shareId (4 bytes) */
+ stream_read_uint16(s, lengthSourceDescriptor); /* lengthSourceDescriptor (2 bytes) */
+ stream_seek(s, lengthSourceDescriptor); /* sourceDescriptor (should be 0x00) */
}
void rdp_recv_demand_active(rdpRdp* rdp, STREAM* s, rdpSettings* settings);
void rdp_write_confirm_active(STREAM* s, rdpSettings* settings);
void rdp_send_confirm_active(rdpRdp* rdp);
-
-void rdp_read_deactivate_all(STREAM* s, rdpSettings* settings);
+void rdp_recv_deactivate_all(rdpRdp* rdp, STREAM* s);
#endif /* __CAPABILITIES_H */
rdp_read_server_control_pdu(s, &action);
- printf("Server Control Action: %s\n", CTRLACTION_STRINGS[action]);
-
if (action == CTRLACTION_COOPERATE)
{
rdp_send_client_control_pdu(rdp, CTRLACTION_REQUEST_CONTROL);
s = rdp_data_pdu_init(rdp);
- printf("Client Control Action: %s\n", CTRLACTION_STRINGS[action]);
-
rdp_write_client_control_pdu(s, action);
rdp_send_data_pdu(rdp, s, DATA_PDU_TYPE_CONTROL, rdp->mcs->user_id);
stream_read_uint32(s, errorInfo); /* errorInfo (4 bytes) */
- printf("Error Info: 0x%08X\n", errorInfo);
+ if (errorInfo != 0)
+ printf("Error Info: 0x%08X\n", errorInfo);
}
void rdp_read_data_pdu(rdpRdp* rdp, STREAM* s)
break;
case PDU_TYPE_DEACTIVATE_ALL:
- rdp_read_deactivate_all(s, rdp->settings);
+ rdp_recv_deactivate_all(rdp, s);
break;
case PDU_TYPE_SERVER_REDIRECTION:
settings->frame_marker = False;
settings->bitmap_cache_v3 = False;
+ settings->offscreen_bitmap_cache = True;
settings->offscreen_bitmap_cache_size = 7680;
settings->offscreen_bitmap_cache_entries = 100;
}
else if (strcmp("--no-osb", argv[index]) == 0)
{
- settings->off_screen_bitmaps = 0;
+ settings->offscreen_bitmap_cache = 0;
}
else if (strcmp("--rfx", argv[index]) == 0)
{
settings->rfx_flags = 1;
settings->ui_decode_flags = 1;
- settings->use_frame_ack = 0;
settings->color_depth = 32;
+ settings->frame_acknowledge = False;
settings->performance_flags = PERF_FLAG_NONE;
}
else if (strcmp("-m", argv[index]) == 0)
printf("missing application name\n");
return 0;
}
- strncpy(settings->app_name, argv[index], sizeof(settings->app_name) - 1);
- settings->app_name[sizeof(settings->app_name) - 1] = 0;
- settings->remote_app = 1;
+ settings->app_name = (uint8*) xstrdup(argv[index]);
+ settings->remote_app = True;
}
else if (strcmp("-x", argv[index]) == 0)
{