59 |
mppc_expand(uint8 * data, uint32 clen, uint8 ctype, uint32 * roff, uint32 * rlen) |
mppc_expand(uint8 * data, uint32 clen, uint8 ctype, uint32 * roff, uint32 * rlen) |
60 |
{ |
{ |
61 |
int k, walker_len = 0, walker; |
int k, walker_len = 0, walker; |
62 |
int i = 0; |
uint32 i = 0; |
63 |
int next_offset, match_off; |
int next_offset, match_off; |
64 |
int match_len; |
int match_len; |
65 |
int old_offset, match_bits; |
int old_offset, match_bits; |
66 |
|
|
67 |
signed char *dict = &(g_mppc_dict.hist); |
uint8 *dict = g_mppc_dict.hist; |
68 |
|
|
69 |
if ((ctype & RDP_MPPC_COMPRESSED) == 0) |
if ((ctype & RDP_MPPC_COMPRESSED) == 0) |
70 |
{ |
{ |
279 |
|
|
280 |
match_bits = match_len; |
match_bits = match_len; |
281 |
match_len = |
match_len = |
282 |
walker >> 32 - match_bits & ~(-1 << match_bits) | 1 << match_bits; |
((walker >> (32 - match_bits)) & (~(-1 << match_bits))) | (1 << |
283 |
|
match_bits); |
284 |
walker <<= match_bits; |
walker <<= match_bits; |
285 |
walker_len -= match_bits; |
walker_len -= match_bits; |
286 |
} |
} |
289 |
return -1; |
return -1; |
290 |
} |
} |
291 |
/* memory areas can overlap - meaning we can't use memXXX functions */ |
/* memory areas can overlap - meaning we can't use memXXX functions */ |
292 |
k = next_offset - match_off & (RDP_MPPC_DICT_SIZE - 1); |
k = (next_offset - match_off) & (RDP_MPPC_DICT_SIZE - 1); |
293 |
do |
do |
294 |
{ |
{ |
295 |
dict[next_offset++] = dict[k++]; |
dict[next_offset++] = dict[k++]; |