2428{
2434 size_t pathlen, filenamelen;
2435 char emptystring = '\0';
2441
2442 TRACE(
"(hfdi == ^%p, pszCabinet == %s, pszCabPath == %s, flags == %x, "
2443 "pfnfdin == ^%p, pfnfdid == ^%p, pvUser == ^%p)\n",
2445
2446 if (!fdi)
return FALSE;
2447
2449 {
2452 }
2454
2455 pathlen = pszCabPath ?
strlen(pszCabPath) : 0;
2456 filenamelen = pszCabinet ?
strlen(pszCabinet) : 0;
2457
2458
2459 if ((pathlen + filenamelen + 3) >
MAX_PATH) {
2460 ERR(
"MAX_PATH exceeded.\n");
2461 fdi->
free(decomp_state);
2464 }
2465
2466
2467 fullpath[0] = '\0';
2468 if (pathlen)
2469 strcpy(fullpath, pszCabPath);
2470 if (filenamelen)
2471 strcat(fullpath, pszCabinet);
2472
2474
2475
2477 if (cabhf == -1) {
2478 fdi->
free(decomp_state);
2482 }
2483
2484
2487 fdi->
free(decomp_state);
2490 }
2491
2492
2497 fdin.
psz1 = (
CAB(mii).nextname) ?
CAB(mii).nextname : &emptystring;
2498 fdin.
psz2 = (
CAB(mii).nextinfo) ?
CAB(mii).nextinfo : &emptystring;
2499 fdin.
psz3 = pszCabPath;
2500
2503 goto bail_and_fail;
2504 }
2505
2509
2510
2514 goto bail_and_fail;
2515 }
2516
2517 if (
CAB(mii).folder_resv > 0)
2519
2521 if (!fol) {
2522 ERR(
"out of memory!\n");
2524 goto bail_and_fail;
2525 }
2527 if (!
CAB(firstfol))
CAB(firstfol) = fol;
2528
2532
2533 if (linkfol)
2534 linkfol->next = fol;
2535 linkfol = fol;
2536 }
2537
2538
2542 goto bail_and_fail;
2543 }
2544
2547 ERR(
"out of memory!\n");
2549 goto bail_and_fail;
2550 }
2553
2561
2562 if (!
file->filename) {
2564 goto bail_and_fail;
2565 }
2566
2567 if (linkfile)
2568 linkfile->next =
file;
2570 }
2571
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2624 fdin.
psz1 = (
char *)
file->filename;
2625 fdin.
psz2 = (
CAB(mii).prevname) ?
CAB(mii).prevname : &emptystring;
2626 fdin.
psz3 = (
CAB(mii).previnfo) ?
CAB(mii).previnfo : &emptystring;
2627
2630 goto bail_and_fail;
2631 }
2632
2634 }
2635 if (
file->oppressed) {
2636 filehf = 0;
2637 } else {
2640 fdin.
psz1 = (
char *)
file->filename;
2648 filehf = 0;
2649 goto bail_and_fail;
2650 }
2651 }
2652
2653
2654 if (filehf) {
2655 fol =
CAB(firstfol);
2657
2659 } else {
2660 unsigned int i2;
2661
2662 for (i2 = 0; (i2 <
file->index); i2++)
2665 }
2666 }
2667
2668 if (filehf) {
2673
2675
2676
2678 CAB(filehf) = filehf;
2679
2680
2682
2684
2685
2686 switch (ct2) {
2691 }
2692 break;
2697 }
2698 break;
2699 }
2700
2705
2706
2707 switch (ct1) {
2710 break;
2713 break;
2716 err =
QTMfdi_init((comptype >> 8) & 0x1f, (comptype >> 4) & 0xF, decomp_state);
2717 break;
2721 break;
2722 default:
2724 }
2725 }
2726
2728
2731 break;
2734 goto bail_and_fail;
2735 default:
2737 goto bail_and_fail;
2738 }
2739
2741
2742 switch (
fdi_decomp(
file, 0, decomp_state, pszCabPath, pfnfdin, pvUser)) {
2744 break;
2747 goto bail_and_fail;
2750 goto bail_and_fail;
2751 default:
2753 goto bail_and_fail;
2754 }
2756 }
2757
2758
2761
2762
2765 fdin.
psz1 = (
char *)
file->filename;
2773 filehf = 0;
2774
2777 break;
2780 goto bail_and_fail;
2783 goto bail_and_fail;
2784 default:
2786 goto bail_and_fail;
2787 }
2788 }
2789 }
2790
2793
2795
2796 bail_and_fail:
2797
2799
2800 if (filehf) fdi->
close(filehf);
2801
2803
2805}
#define ERROR_NOT_ENOUGH_MEMORY
#define cffoldCOMPTYPE_MSZIP
#define cffileCONTINUED_FROM_PREV
#define cffile_FolderOffset
#define cffile_FolderIndex
#define cffoldCOMPTYPE_LZX
#define cffoldCOMPTYPE_MASK
#define cffoldCOMPTYPE_QUANTUM
#define cffileCONTINUED_TO_NEXT
#define cffile_UncompressedSize
#define cffoldCOMPTYPE_NONE
#define cffold_DataOffset
static char * FDI_read_string(FDI_Int *fdi, INT_PTR hf, long cabsize)
static int LZXfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state)
static FDI_Int * get_fdi_ptr(HFDI hfdi)
static void set_error(FDI_Int *fdi, int oper, int err)
static int NONEfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state)
static BOOL FDI_read_entries(FDI_Int *fdi, INT_PTR hf, PFDICABINETINFO pfdici, PMORE_ISCAB_INFO pmii)
static int QTMfdi_init(int window, int level, fdi_decomp_state *decomp_state)
static void free_decompression_temps(FDI_Int *fdi, const struct fdi_folder *fol, fdi_decomp_state *decomp_state)
static int LZXfdi_init(int window, fdi_decomp_state *decomp_state)
static int ZIPfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state)
static int QTMfdi_decomp(int inlen, int outlen, fdi_decomp_state *decomp_state)
static void free_decompression_mem(FDI_Int *fdi, fdi_decomp_state *decomp_state)
static int fdi_decomp(const struct fdi_file *fi, int savemode, fdi_decomp_state *decomp_state, char *pszCabPath, PFNFDINOTIFY pfnfdin, void *pvUser)
_ACRTIMP size_t __cdecl strlen(const char *)
GLenum GLuint GLenum GLsizei const GLchar * buf
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
struct task_struct * current
#define ERROR_FILE_NOT_FOUND
static IHTMLWindow2 * window