ReactOS 0.4.16-dev-88-ga65b6ae
rdp5.c File Reference
#include "precomp.h"
Include dependency graph for rdp5.c:

Go to the source code of this file.

Functions

void rdp5_process (STREAM s)
 

Variables

uint8g_next_packet
 
RDPCOMP g_mppc_dict
 

Function Documentation

◆ rdp5_process()

void rdp5_process ( STREAM  s)

Definition at line 28 of file rdp5.c.

29{
32 uint8 *next;
33
34 uint32 roff, rlen;
35 struct stream *ns = &(g_mppc_dict.ns);
36 struct stream *ts;
37
38#if 0
39 printf("RDP5 data:\n");
40 hexdump(s->p, s->end - s->p);
41#endif
42
44 while (s->p < s->end)
45 {
46 in_uint8(s, type);
48 {
52 }
53 else
54 {
55 ctype = 0;
57 }
58 g_next_packet = next = s->p + length;
59
61 {
62 if (mppc_expand(s->p, length, ctype, &roff, &rlen) == -1)
63 error("error while decompressing packet\n");
64
65 /* allocate memory and copy the uncompressed data into the temporary stream */
66 ns->data = (uint8 *) xrealloc(ns->data, rlen);
67
68 memcpy((ns->data), (unsigned char *) (g_mppc_dict.hist + roff), rlen);
69
70 ns->size = rlen;
71 ns->end = (ns->data + ns->size);
72 ns->p = ns->data;
73 ns->rdp_hdr = ns->p;
74
75 ts = ns;
76 }
77 else
78 ts = s;
79
80 switch (type)
81 {
82 case 0: /* update orders */
85 break;
86 case 1: /* update bitmap */
87 in_uint8s(ts, 2); /* part length */
89 break;
90 case 2: /* update palette */
91 in_uint8s(ts, 2); /* uint16 = 2 */
93 break;
94 case 3: /* update synchronize */
95 break;
96 case 5: /* null pointer */
98 break;
99 case 6: /* default pointer */
100 break;
101 case 8: /* pointer position */
102 in_uint16_le(ts, x);
103 in_uint16_le(ts, y);
104 if (s_check(ts))
106 break;
107 case 9: /* color pointer */
109 break;
110 case 10: /* cached pointer */
112 break;
113 case 11:
115 break;
116 default:
117 unimpl("RDP5 opcode %d\n", type);
118 }
119
120 s->p = next;
121 }
123}
#define RDP_MPPC_COMPRESSED
Definition: constants.h:355
#define RDP5_COMPRESSED
Definition: constants.h:360
int mppc_expand(uint8 *data, uint32 clen, uint8 ctype, uint32 *roff, uint32 *rlen)
Definition: mppc.c:58
void process_orders(STREAM s, uint16 num_orders)
Definition: orders.c:1311
#define s_check(s)
Definition: parse.h:42
#define in_uint16_le(s, v)
Definition: parse.h:55
#define in_uint8s(s, n)
Definition: parse.h:91
#define in_uint8(s, v)
Definition: parse.h:88
void process_bitmap_updates(STREAM s)
Definition: rdp.c:1224
void process_cached_pointer_pdu(STREAM s)
Definition: rdp.c:1156
void ui_set_null_cursor(void)
Definition: uimain.c:227
void process_palette(STREAM s)
Definition: rdp.c:1295
void unimpl(char *format,...)
Definition: uimain.c:801
void hexdump(unsigned char *p, unsigned int len)
Definition: shimdbg.c:234
void process_colour_pointer_pdu(STREAM s)
Definition: rdp.c:1139
void ui_begin_update(void)
Definition: uimain.c:657
void ui_move_pointer(int x, int y)
Definition: uimain.c:616
void ui_end_update(void)
Definition: uimain.c:664
void process_new_pointer_pdu(STREAM s)
Definition: rdp.c:1146
void * xrealloc(void *oldmem, size_t size)
Definition: uimain.c:736
uint8 * g_next_packet
Definition: rdp.c:45
RDPCOMP g_mppc_dict
Definition: mppc.c:55
unsigned short uint16
Definition: types.h:30
unsigned int uint32
Definition: types.h:32
unsigned char uint8
Definition: types.h:28
Definition: _ctype.h:58
#define printf
Definition: freeldr.h:97
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define error(str)
Definition: mkdosfs.c:1605
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static unsigned __int64 next
Definition: rand_nt.c:6
struct stream ns
Definition: types.h:192
uint8 hist[RDP_MPPC_DICT_SIZE]
Definition: types.h:191
Definition: mxnamespace.c:45
Definition: parse.h:23

Referenced by rdp_recv().

Variable Documentation

◆ g_mppc_dict

RDPCOMP g_mppc_dict
extern

Definition at line 55 of file mppc.c.

Referenced by mppc_expand(), and rdp5_process().

◆ g_next_packet

uint8* g_next_packet
extern

Definition at line 45 of file rdp.c.

Referenced by rdp5_process(), rdp_loop(), rdp_recv(), and rdp_reset_state().