diff --git a/client/Windows/wfreerdp.c b/client/Windows/wfreerdp.c index 960c6194c..f4dad7c5a 100644 --- a/client/Windows/wfreerdp.c +++ b/client/Windows/wfreerdp.c @@ -143,6 +143,8 @@ boolean wf_pre_connect(freerdp* instance) settings = instance->settings; + settings->os_major_type = OSMAJORTYPE_WINDOWS; + settings->os_minor_type = OSMINORTYPE_WINDOWS_NT; settings->order_support[NEG_DSTBLT_INDEX] = true; settings->order_support[NEG_PATBLT_INDEX] = true; settings->order_support[NEG_SCRBLT_INDEX] = true; diff --git a/client/X11/xfreerdp.c b/client/X11/xfreerdp.c index f80a4e3e7..3f41fe608 100644 --- a/client/X11/xfreerdp.c +++ b/client/X11/xfreerdp.c @@ -478,6 +478,8 @@ boolean xf_pre_connect(freerdp* instance) settings = instance->settings; bitmap_cache = settings->bitmap_cache; + settings->os_major_type = OSMAJORTYPE_UNIX; + settings->os_minor_type = OSMINORTYPE_NATIVE_XSERVER; settings->order_support[NEG_DSTBLT_INDEX] = true; settings->order_support[NEG_PATBLT_INDEX] = true; settings->order_support[NEG_SCRBLT_INDEX] = true; diff --git a/include/freerdp/constants.h b/include/freerdp/constants.h index a980a7cf0..6f481714c 100644 --- a/include/freerdp/constants.h +++ b/include/freerdp/constants.h @@ -88,4 +88,26 @@ enum RDP_SVC_CHANNEL_EVENT */ #define CPU_SSE2 0x1 +/** + * OSMajorType + */ +#define OSMAJORTYPE_UNSPECIFIED 0x0000 +#define OSMAJORTYPE_WINDOWS 0x0001 +#define OSMAJORTYPE_OS2 0x0002 +#define OSMAJORTYPE_MACINTOSH 0x0003 +#define OSMAJORTYPE_UNIX 0x0004 + +/** + * OSMinorType + */ +#define OSMINORTYPE_UNSPECIFIED 0x0000 +#define OSMINORTYPE_WINDOWS_31X 0x0001 +#define OSMINORTYPE_WINDOWS_95 0x0002 +#define OSMINORTYPE_WINDOWS_NT 0x0003 +#define OSMINORTYPE_OS2_V21 0x0004 +#define OSMINORTYPE_POWER_PC 0x0005 +#define OSMINORTYPE_MACINTOSH 0x0006 +#define OSMINORTYPE_NATIVE_XSERVER 0x0007 +#define OSMINORTYPE_PSEUDO_XSERVER 0x0008 + #endif diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index 75140aa24..a22cb64d1 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -275,6 +275,8 @@ struct rdp_settings TIME_ZONE_INFO client_time_zone; /* Capabilities */ + uint16 os_major_type; + uint16 os_minor_type; uint32 vc_chunk_size; boolean sound_beeps; boolean smooth_fonts; diff --git a/libfreerdp-core/capabilities.c b/libfreerdp-core/capabilities.c index 5751446e6..d537bad9b 100644 --- a/libfreerdp-core/capabilities.c +++ b/libfreerdp-core/capabilities.c @@ -107,8 +107,16 @@ void rdp_read_general_capability_set(STREAM* s, uint16 length, rdpSettings* sett uint8 refreshRectSupport; uint8 suppressOutputSupport; - stream_seek_uint16(s); /* osMajorType (2 bytes) */ - stream_seek_uint16(s); /* osMinorType (2 bytes) */ + if (settings->server_mode) + { + stream_read_uint16(s, settings->os_major_type); /* osMajorType (2 bytes) */ + stream_read_uint16(s, settings->os_minor_type); /* osMinorType (2 bytes) */ + } + else + { + stream_seek_uint16(s); /* osMajorType (2 bytes) */ + stream_seek_uint16(s); /* osMinorType (2 bytes) */ + } stream_seek_uint16(s); /* protocolVersion (2 bytes) */ stream_seek_uint16(s); /* pad2OctetsA (2 bytes) */ stream_seek_uint16(s); /* generalCompressionTypes (2 bytes) */ @@ -158,8 +166,8 @@ void rdp_write_general_capability_set(STREAM* s, rdpSettings* settings) settings->suppress_output = false; } - stream_write_uint16(s, OSMAJORTYPE_WINDOWS); /* osMajorType (2 bytes) */ - stream_write_uint16(s, OSMINORTYPE_WINDOWS_NT); /* osMinorType (2 bytes) */ + stream_write_uint16(s, settings->os_major_type); /* osMajorType (2 bytes) */ + stream_write_uint16(s, settings->os_minor_type); /* osMinorType (2 bytes) */ stream_write_uint16(s, CAPS_PROTOCOL_VERSION); /* protocolVersion (2 bytes) */ stream_write_uint16(s, 0); /* pad2OctetsA (2 bytes) */ stream_write_uint16(s, 0); /* generalCompressionTypes (2 bytes) */ diff --git a/libfreerdp-core/capabilities.h b/libfreerdp-core/capabilities.h index 5e85e8e79..85460c1fa 100644 --- a/libfreerdp-core/capabilities.h +++ b/libfreerdp-core/capabilities.h @@ -61,22 +61,6 @@ #define SOURCE_DESCRIPTOR "MSTSC" -#define OSMAJORTYPE_UNSPECIFIED 0x0000 -#define OSMAJORTYPE_WINDOWS 0x0001 -#define OSMAJORTYPE_OS2 0x0002 -#define OSMAJORTYPE_MACINTOSH 0x0003 -#define OSMAJORTYPE_UNIX 0x0004 - -#define OSMINORTYPE_UNSPECIFIED 0x0000 -#define OSMINORTYPE_WINDOWS_31X 0x0001 -#define OSMINORTYPE_WINDOWS_95 0x0002 -#define OSMINORTYPE_WINDOWS_NT 0x0003 -#define OSMINORTYPE_OS2_V21 0x0004 -#define OSMINORTYPE_POWER_PC 0x0005 -#define OSMINORTYPE_MACINTOSH 0x0006 -#define OSMINORTYPE_NATIVE_XSERVER 0x0007 -#define OSMINORTYPE_PSEUDO_XSERVER 0x0008 - /* Capabilities Protocol Version */ #define CAPS_PROTOCOL_VERSION 0x0200 diff --git a/server/test/tfreerdp.c b/server/test/tfreerdp.c index 74761cf53..bf67f13c5 100644 --- a/server/test/tfreerdp.c +++ b/server/test/tfreerdp.c @@ -395,7 +395,8 @@ boolean tf_peer_post_connect(freerdp_peer* client) * The server may start sending graphics output and receiving keyboard/mouse input after this * callback returns. */ - printf("Client %s is activated", client->hostname); + printf("Client %s is activated (osMajorType %d osMinorType %d)", client->hostname, + client->settings->os_major_type, client->settings->os_minor_type); if (client->settings->autologon) { printf(" and wants to login automatically as %s\\%s",