#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
#include "mszip.h"
Go to the source code of this file.
|
| WINE_DEFAULT_DEBUG_CHANNEL (d3dxof) |
|
static void | fdi_Ziphuft_free (HFDI hfdi, struct Ziphuft *t) |
|
static cab_LONG | fdi_Ziphuft_build (cab_ULONG *b, cab_ULONG n, cab_ULONG s, const cab_UWORD *d, const cab_UWORD *e, struct Ziphuft **t, cab_LONG *m, fdi_decomp_state *decomp_state) |
|
static cab_LONG | fdi_Zipinflate_codes (const struct Ziphuft *tl, const struct Ziphuft *td, cab_LONG bl, cab_LONG bd, fdi_decomp_state *decomp_state) |
|
static cab_LONG | fdi_Zipinflate_stored (fdi_decomp_state *decomp_state) |
|
static cab_LONG | fdi_Zipinflate_fixed (fdi_decomp_state *decomp_state) |
|
static cab_LONG | fdi_Zipinflate_dynamic (fdi_decomp_state *decomp_state) |
|
static cab_LONG | fdi_Zipinflate_block (cab_LONG *e, fdi_decomp_state *decomp_state) |
|
static int | ZIPfdi_decomp (int inlen, int outlen, fdi_decomp_state *decomp_state) |
|
static void *__cdecl | fdi_alloc (ULONG cb) |
|
static void __cdecl | fdi_free (void *pv) |
|
int | mszip_decompress (unsigned int inlen, unsigned int outlen, char *inbuffer, char *outbuffer) |
|
◆ fdi_alloc()
◆ fdi_free()
◆ fdi_Ziphuft_build()
Definition at line 57 of file mszip.c.
59{
76
78
79
81
85 do
86 {
90 {
93 return 0;
94 }
95
96
99 break;
105 break;
109
110
111 for (
y = 1 <<
j;
j <
i;
j++,
y <<= 1)
113 return 2;
115 return 2;
117
118
122 {
124 }
125
126
128 do{
132
133
134
142
143
145 {
148 {
149
150
152 {
154
155
158 if ((
f = 1 << (
j =
k -
w)) >
a + 1)
159 {
163 {
164 if ((
f <<= 1) <= *++xp)
165 break;
167 }
168 }
173
174
176 {
179 return 3;
180 }
184
185
187 {
192 j = (
i & ((1 <<
w) - 1)) >> (
w -
l[
h-1]);
194 }
195 }
196
197
202 {
205 }
206 else
207 {
210 }
211
212
214 for (
j =
i >>
w;
j <
z;
j +=
f)
216
217
218 for (
j = 1 << (
k - 1);
i &
j;
j >>= 1)
221
222
223 while ((
i & ((1 <<
w) - 1)) !=
ZIP(
x)[
h])
225 }
226 }
227
228
230
231
232 return y != 0 &&
g != 1;
233}
#define PFDI_ALLOC(hfdi, size)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble GLdouble q
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLubyte GLubyte GLubyte GLubyte w
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static void fdi_Ziphuft_free(HFDI hfdi, struct Ziphuft *t)
Referenced by fdi_Zipinflate_dynamic(), and fdi_Zipinflate_fixed().
◆ fdi_Ziphuft_free()
◆ fdi_Zipinflate_block()
Definition at line 545 of file mszip.c.
546{
550
551
554
555
559
560
564
565
568
569
576
578}
static cab_LONG fdi_Zipinflate_fixed(fdi_decomp_state *decomp_state)
static cab_LONG fdi_Zipinflate_stored(fdi_decomp_state *decomp_state)
static cab_LONG fdi_Zipinflate_dynamic(fdi_decomp_state *decomp_state)
Referenced by ZIPfdi_decomp().
◆ fdi_Zipinflate_codes()
Definition at line 238 of file mszip.c.
240{
248
249
252 w =
ZIP(window_posn);
253
254
255 ml = Zipmask[bl];
257
258 for(;;)
259 {
261 if((
e = (
t = tl + (
b & ml))->
e) > 16)
262 do
263 {
265 return 1;
274 {
275
277 break;
278
279
281 n =
t->v.n + (
b & Zipmask[
e]);
283
284
286 if ((
e = (
t = td + (
b &
md))->
e) > 16)
287 do {
289 return 1;
296 d =
w -
t->
v.
n - (
b & Zipmask[
e]);
299 {
304 do
305 {
306 CAB(outbuf)[
w++] =
CAB(outbuf)[
d++];
309 }
310 }
311
312
313 ZIP(window_posn) =
w;
316
317
318 return 0;
319}
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
Referenced by fdi_Zipinflate_dynamic(), and fdi_Zipinflate_fixed().
◆ fdi_Zipinflate_dynamic()
Definition at line 412 of file mszip.c.
414{
430
431
435
436
438 nl = 257 + (
b & 0x1f);
446 if(nl > 288 || nd > 32)
448
449
451 {
453 ll[Zipborder[
j]] =
b & 7;
455 }
457 ll[Zipborder[
j]] = 0;
458
459
460 bl = 7;
462 {
466 }
467
468
473 {
475 j = (td = tl + (
b &
m))->b;
481 {
489 }
491 {
500 }
502 {
511 }
512 }
513
514
516
517
520
521
524 {
528 }
531
532
534 return 1;
535
536
539 return 0;
540}
static cab_LONG fdi_Ziphuft_build(cab_ULONG *b, cab_ULONG n, cab_ULONG s, const cab_UWORD *d, const cab_UWORD *e, struct Ziphuft **t, cab_LONG *m, fdi_decomp_state *decomp_state)
static cab_LONG fdi_Zipinflate_codes(const struct Ziphuft *tl, const struct Ziphuft *td, cab_LONG bl, cab_LONG bd, fdi_decomp_state *decomp_state)
Referenced by fdi_Zipinflate_block().
◆ fdi_Zipinflate_fixed()
Definition at line 368 of file mszip.c.
369{
375
377
378
379 for(
i = 0;
i < 144;
i++)
390
391
392 for(
i = 0;
i < 30;
i++)
396 {
399 }
400
401
403
407}
const inflate_huft fixed_tl[]
const inflate_huft fixed_td[]
Referenced by fdi_Zipinflate_block().
◆ fdi_Zipinflate_stored()
Definition at line 324 of file mszip.c.
326{
331
332
335 w =
ZIP(window_posn);
336
337
340
341
346 if (
n != ((~
b) & 0xffff))
349
350
352 {
356 }
357
358
359 ZIP(window_posn) =
w;
363}
Referenced by fdi_Zipinflate_block().
◆ mszip_decompress()
Definition at line 620 of file mszip.c.
621{
625
627
629 {
630 FIXME(
"Big file not supported yet (inlen = %u, outlen = %u)\n", inlen, outlen);
632 }
633
636 decomp_state.
hfdi = (
void*)&fdi;
637
639
641
643
645}
const unsigned char * inbuffer
#define memcpy(s1, s2, n)
static void __cdecl fdi_free(void *pv)
static int ZIPfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state)
static void *__cdecl fdi_alloc(ULONG cb)
cab_UBYTE outbuf[CAB_BLOCKMAX]
cab_UBYTE inbuf[CAB_INPUTMAX+2]
◆ WINE_DEFAULT_DEBUG_CHANNEL()
WINE_DEFAULT_DEBUG_CHANNEL |
( |
d3dxof |
| ) |
|
◆ ZIPfdi_decomp()
Definition at line 583 of file mszip.c.
584{
586
587 TRACE(
"(inlen == %d, outlen == %d)\n", inlen, outlen);
588
590 ZIP(bb) =
ZIP(bk) =
ZIP(window_posn) = 0;
591
594
595
596 if(
ZIP(inpos)[0] != 0x43 ||
ZIP(inpos)[1] != 0x4B)
598
600
601 do {
605
606
608}
static cab_LONG fdi_Zipinflate_block(cab_LONG *e, fdi_decomp_state *decomp_state)
Referenced by mszip_decompress().
◆ THOSE_ZIP_CONSTS