summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/xrdp_constants.h2
-rw-r--r--libxrdp/libxrdp.c30
-rw-r--r--libxrdp/libxrdpinc.h2
-rw-r--r--rdp/rdp_rdp.c2
-rw-r--r--vnc/vnc.c15
-rw-r--r--vnc/vnc.h1
-rw-r--r--xrdp/xrdp.h4
-rw-r--r--xrdp/xrdp_mm.c14
-rw-r--r--xrdp/xrdp_types.h1
-rw-r--r--xrdp/xrdp_wm.c7
10 files changed, 76 insertions, 2 deletions
diff --git a/common/xrdp_constants.h b/common/xrdp_constants.h
index f61c320b..56420e1d 100644
--- a/common/xrdp_constants.h
+++ b/common/xrdp_constants.h
@@ -108,7 +108,7 @@
#define RDP_DATA_PDU_POINTER 27
#define RDP_DATA_PDU_INPUT 28
#define RDP_DATA_PDU_SYNCHRONISE 31
-#define RDP_DATA_PDU_BELL 34
+#define RDP_DATA_PDU_PLAY_SOUND 34
#define RDP_DATA_PDU_LOGON 38
#define RDP_DATA_PDU_FONT2 39
#define RDP_DATA_PDU_DISCONNECT 47
diff --git a/libxrdp/libxrdp.c b/libxrdp/libxrdp.c
index 534f838d..0d7a86b1 100644
--- a/libxrdp/libxrdp.c
+++ b/libxrdp/libxrdp.c
@@ -168,6 +168,36 @@ libxrdp_send_palette(struct xrdp_session* session, int* palette)
return 0;
}
+/******************************************************************************/
+int EXPORT_CC
+libxrdp_send_bell(struct xrdp_session* session)
+{
+ struct stream* s = (struct stream *)NULL;
+
+ DEBUG(("libxrdp_send_bell sending bell signal"));
+ /* see MS documentation: Server play sound PDU, TS_PLAY_SOUND_PDU_DATA */
+
+ make_stream(s);
+ init_stream(s, 8192);
+
+ if (xrdp_rdp_init_data((struct xrdp_rdp*)session->rdp, s) != 0)
+ {
+ free_stream(s);
+ return 1;
+ }
+ out_uint32_le(s, 440); /* frequency */
+ out_uint32_le(s, 100); /* duration (ms) */
+ s_mark_end(s);
+ if (xrdp_rdp_send_data((struct xrdp_rdp*)session->rdp, s, RDP_DATA_PDU_PLAY_SOUND) != 0)
+ {
+ free_stream(s);
+ return 1;
+ }
+ free_stream(s);
+ return 0;
+}
+
+
/*****************************************************************************/
int EXPORT_CC
libxrdp_send_bitmap(struct xrdp_session* session, int width, int height,
diff --git a/libxrdp/libxrdpinc.h b/libxrdp/libxrdpinc.h
index 245416c6..258fbb83 100644
--- a/libxrdp/libxrdpinc.h
+++ b/libxrdp/libxrdpinc.h
@@ -125,6 +125,8 @@ libxrdp_process_data(struct xrdp_session* session);
int DEFAULT_CC
libxrdp_send_palette(struct xrdp_session* session, int* palette);
int DEFAULT_CC
+libxrdp_send_bell(struct xrdp_session* session);
+int DEFAULT_CC
libxrdp_send_bitmap(struct xrdp_session* session, int width, int height,
int bpp, char* data, int x, int y, int cx, int cy);
int DEFAULT_CC
diff --git a/rdp/rdp_rdp.c b/rdp/rdp_rdp.c
index 9bdf042e..e3bd45bc 100644
--- a/rdp/rdp_rdp.c
+++ b/rdp/rdp_rdp.c
@@ -890,7 +890,7 @@ rdp_rdp_process_data_pdu(struct rdp_rdp* self, struct stream* s)
case RDP_DATA_PDU_POINTER:
rv = rdp_rdp_process_pointer_pdu(self, s);
break;
- case RDP_DATA_PDU_BELL:
+ case RDP_DATA_PDU_PLAY_SOUND:
break;
case RDP_DATA_PDU_LOGON:
break;
diff --git a/vnc/vnc.c b/vnc/vnc.c
index da5d2dcd..2b3ab530 100644
--- a/vnc/vnc.c
+++ b/vnc/vnc.c
@@ -750,6 +750,17 @@ lib_palette_update(struct vnc* v)
/******************************************************************************/
int DEFAULT_CC
+lib_bell_trigger(struct vnc* v)
+{
+ struct stream* s;
+ int error;
+
+ error = v->server_bell_trigger(v);
+ return error;
+}
+
+/******************************************************************************/
+int DEFAULT_CC
lib_mod_signal(struct vnc* v)
{
char type;
@@ -767,6 +778,10 @@ lib_mod_signal(struct vnc* v)
{
error = lib_palette_update(v);
}
+ else if (type == 2) /* bell */
+ {
+ error = lib_bell_trigger(v);
+ }
else if (type == 3) /* clipboard */
{
g_writeln("got clip data");
diff --git a/vnc/vnc.h b/vnc/vnc.h
index fcb0646b..f5b2f984 100644
--- a/vnc/vnc.h
+++ b/vnc/vnc.h
@@ -50,6 +50,7 @@ struct vnc
/* server functions */
int (*server_begin_update)(struct vnc* v);
int (*server_end_update)(struct vnc* v);
+ int (*server_bell_trigger)(struct vnc* v);
int (*server_fill_rect)(struct vnc* v, int x, int y, int cx, int cy);
int (*server_screen_blt)(struct vnc* v, int x, int y, int cx, int cy,
int srcx, int srcy);
diff --git a/xrdp/xrdp.h b/xrdp/xrdp.h
index 36e6dc59..0c91f52a 100644
--- a/xrdp/xrdp.h
+++ b/xrdp/xrdp.h
@@ -89,6 +89,8 @@ xrdp_wm_delete(struct xrdp_wm* self);
int APP_CC
xrdp_wm_send_palette(struct xrdp_wm* self);
int APP_CC
+xrdp_wm_send_bell(struct xrdp_wm* self);
+int APP_CC
xrdp_wm_load_static_colors(struct xrdp_wm* self);
int APP_CC
xrdp_wm_load_static_pointers(struct xrdp_wm* self);
@@ -352,6 +354,8 @@ server_begin_update(struct xrdp_mod* mod);
int DEFAULT_CC
server_end_update(struct xrdp_mod* mod);
int DEFAULT_CC
+server_bell_trigger(struct xrdp_mod* mod);
+int DEFAULT_CC
server_fill_rect(struct xrdp_mod* mod, int x, int y, int cx, int cy);
int DEFAULT_CC
server_screen_blt(struct xrdp_mod* mod, int x, int y, int cx, int cy,
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c
index 5dd76e25..d9fe0431 100644
--- a/xrdp/xrdp_mm.c
+++ b/xrdp/xrdp_mm.c
@@ -297,6 +297,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm* self)
self->mod->wm = (long)(self->wm);
self->mod->server_begin_update = server_begin_update;
self->mod->server_end_update = server_end_update;
+ self->mod->server_bell_trigger = server_bell_trigger;
self->mod->server_fill_rect = server_fill_rect;
self->mod->server_screen_blt = server_screen_blt;
self->mod->server_paint_rect = server_paint_rect;
@@ -1061,6 +1062,19 @@ server_end_update(struct xrdp_mod* mod)
}
/*****************************************************************************/
+/* got bell signal... try to send to client */
+int DEFAULT_CC
+server_bell_trigger(struct xrdp_mod* mod)
+{
+ struct xrdp_wm* wm;
+ wm = (struct xrdp_wm*)(mod->wm);
+
+ xrdp_wm_send_bell(wm);
+ return 0;
+}
+
+
+/*****************************************************************************/
int DEFAULT_CC
server_fill_rect(struct xrdp_mod* mod, int x, int y, int cx, int cy)
{
diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h
index d4e6caa9..8ecc945c 100644
--- a/xrdp/xrdp_types.h
+++ b/xrdp/xrdp_types.h
@@ -42,6 +42,7 @@ struct xrdp_mod
/* server functions */
int (*server_begin_update)(struct xrdp_mod* v);
int (*server_end_update)(struct xrdp_mod* v);
+ int (*server_bell_trigger)(struct xrdp_mod* v);
int (*server_fill_rect)(struct xrdp_mod* v, int x, int y, int cx, int cy);
int (*server_screen_blt)(struct xrdp_mod* v, int x, int y, int cx, int cy,
int srcx, int srcy);
diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c
index 2b7a030f..bae6c494 100644
--- a/xrdp/xrdp_wm.c
+++ b/xrdp/xrdp_wm.c
@@ -86,6 +86,13 @@ xrdp_wm_send_palette(struct xrdp_wm* self)
/*****************************************************************************/
int APP_CC
+xrdp_wm_send_bell(struct xrdp_wm* self)
+{
+ return libxrdp_send_bell(self->session);
+}
+
+/*****************************************************************************/
+int APP_CC
xrdp_wm_send_bitmap(struct xrdp_wm* self, struct xrdp_bitmap* bitmap,
int x, int y, int cx, int cy)
{