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

github.com/neutrinolabs/xrdp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoichiro IWAO <meta@vmeta.jp>2022-10-28 19:59:40 +0300
committerKoichiro IWAO <meta@vmeta.jp>2022-11-01 13:24:02 +0300
commitfe14cb14a3d0afda1d9e24a4357b73b74068a093 (patch)
tree724c32c5e9f21f225a3f4fd3539392bee6f70bb1
parent791f055e18ff5cab29b1f27fa1c338ca49bf236a (diff)
libxrdp: record codec GUID to identify unknown codec
-rw-r--r--libxrdp/xrdp_caps.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/libxrdp/xrdp_caps.c b/libxrdp/xrdp_caps.c
index c9532053..035f4576 100644
--- a/libxrdp/xrdp_caps.c
+++ b/libxrdp/xrdp_caps.c
@@ -25,6 +25,7 @@
#include <limits.h>
+#include "guid.h"
#include "libxrdp.h"
#include "ms-rdpbcgr.h"
#include "ms-rdperp.h"
@@ -521,6 +522,7 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len)
int i1;
char *codec_guid;
char *next_guid;
+ char codec_guid_str[GUID_STR_SIZE];
if (len < 1)
{
@@ -533,6 +535,8 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len)
for (index = 0; index < codec_count; index++)
{
codec_guid = s->p;
+ ms_guid_to_str(codec_guid, codec_guid_str);
+
if (len < 16 + 1 + 2)
{
LOG(LOG_LEVEL_ERROR, "xrdp_caps_process_codecs: error");
@@ -552,8 +556,8 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len)
if (g_memcmp(codec_guid, XR_CODEC_GUID_NSCODEC, 16) == 0)
{
- LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: nscodec, codec id %d, properties len %d",
- codec_id, codec_properties_length);
+ LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: NSCodec(%s), codec id [%d], properties len [%d]",
+ codec_guid_str, codec_id, codec_properties_length);
self->client_info.ns_codec_id = codec_id;
i1 = MIN(64, codec_properties_length);
g_memcpy(self->client_info.ns_prop, s->p, i1);
@@ -561,8 +565,8 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len)
}
else if (g_memcmp(codec_guid, XR_CODEC_GUID_REMOTEFX, 16) == 0)
{
- LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: RemoteFX, codec id %d, properties len %d",
- codec_id, codec_properties_length);
+ LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: RemoteFX(%s), codec id [%d], properties len [%d]",
+ codec_guid_str, codec_id, codec_properties_length);
self->client_info.rfx_codec_id = codec_id;
i1 = MIN(64, codec_properties_length);
g_memcpy(self->client_info.rfx_prop, s->p, i1);
@@ -570,8 +574,8 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len)
}
else if (g_memcmp(codec_guid, XR_CODEC_GUID_JPEG, 16) == 0)
{
- LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: jpeg, codec id %d, properties len %d",
- codec_id, codec_properties_length);
+ LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: JPEG(%s), codec id [%d], properties len [%d]",
+ codec_guid_str, codec_id, codec_properties_length);
self->client_info.jpeg_codec_id = codec_id;
i1 = MIN(64, codec_properties_length);
g_memcpy(self->client_info.jpeg_prop, s->p, i1);
@@ -587,8 +591,8 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len)
}
else if (g_memcmp(codec_guid, XR_CODEC_GUID_H264, 16) == 0)
{
- LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: h264, codec id %d, properties len %d",
- codec_id, codec_properties_length);
+ LOG(LOG_LEVEL_INFO, "xrdp_caps_process_codecs: H264(%s), codec id [%d], properties len [%d]",
+ codec_guid_str, codec_id, codec_properties_length);
self->client_info.h264_codec_id = codec_id;
i1 = MIN(64, codec_properties_length);
g_memcpy(self->client_info.h264_prop, s->p, i1);
@@ -596,7 +600,8 @@ xrdp_caps_process_codecs(struct xrdp_rdp *self, struct stream *s, int len)
}
else
{
- LOG(LOG_LEVEL_WARNING, "xrdp_caps_process_codecs: unknown codec id %d", codec_id);
+ LOG(LOG_LEVEL_WARNING, "xrdp_caps_process_codecs: unknown(%s), codec id [%d], properties len [%d]",
+ codec_guid_str, codec_id, codec_properties_length);
}
s->p = next_guid;