⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ztvuncabtypes.pas

📁 ziptv为delphi控件
💻 PAS
📖 第 1 页 / 共 3 页
字号:

   TFNREAD_dummy = Function(hf: Integer; pv: PVoid; cb: TUINT): TUINT; CDECL;
   pfnread = TFNREAD_dummy;

   TFNWRITE_dummy = Function(hf: Integer; pv: PVoid; cb: TUINT): TUINT; CDECL;
   pfnwrite = TFNWRITE_dummy;

   TFNCLOSE_dummy = Function(hf: Integer): Integer; CDECL;
   pfnclose = TFNCLOSE_dummy;

   TFNSEEK_dummy = Function(hf: Integer; dist: longint; SeekType: Integer): longint; CDECL;
   pfnseek = TFNSEEK_dummy;

   (*    PFNFDIDECRYPT - FDI Decryption callback
    *
    *  If this function is passed on the FDICopy() call, then FDI calls it
    *  at various times to update the decryption state and to decrypt FCDATA
    *  blocks.
    *
    *  Common Entry Conditions:
    *      pfdid->fdidt  - Command type
    *      pfdid->pvUser - pvUser value from FDICopy() call
    *
    *  fdidtNEW_CABINET:   //** Notification of a new cabinet
    *      Entry:
    *        pfdid->cabinet.
    *          pHeaderReserve  - RESERVE section from CFHEADER
    *          cbHeaderReserve - Size of pHeaderReserve
    *          setID           - Cabinet set ID
    *          iCabinet        - Cabinet number in set (0 based)
    *      Exit-Success:
    *          returns anything but -1;
    *      Exit-Failure:
    *          returns -1; FDICopy() is aborted.
    *      Notes:
    *      (1) This call allows the decryption code to pick out any information
    *          from the cabinet header reserved area (placed there by DIACRYPT)
    *          needed to perform decryption.  If there is no such information,
    *          this call would presumably be ignored.
    *      (2) This call is made very soon after fdintCABINET_INFO.
    *
    *  fdidtNEW_FOLDER:    //** Notification of a new folder
    *      Entry:
    *        pfdid->folder.
    *          pFolderReserve  - RESERVE section from CFFOLDER
    *          cbFolderReserve - Size of pFolderReserve
    *          iFolder         - Folder number in cabinet (0 based)
    *      Exit-Success:
    *          returns anything but -1;
    *      Exit-Failure:
    *          returns -1; FDICopy() is aborted.
    *      Notes:
    *          This call allows the decryption code to pick out any information
    *          from the folder reserved area (placed there by DIACRYPT) needed
    *          to perform decryption.  If there is no such information, this
    *          call would presumably be ignored.
    *
    *  fdidtDECRYPT:       //** Decrypt a data buffer
    *      Entry:
    *        pfdid->folder.
    *          pDataReserve  - RESERVE section for this CFDATA block
    *          cbDataReserve - Size of pDataReserve
    *          pbData        - Data buffer
    *          cbData        - Size of data buffer
    *          fSplit        - True if this is a split data block
    *          cbPartial     - 0 if this is not a split block, or the first
    *                              piece of a split block; Greater than 0 if
    *                              this is the second piece of a split block.
    *      Exit-Success:
    *          returns True;
    *      Exit-Failure:
    *          returns False; error during decrypt
    *          returns -1; FDICopy() is aborted.
    *      Notes:
    *          FCI will split CFDATA blocks across cabinet boundaries if
    *          necessary.  To provide maximum flexibility, FDI will call the
    *          fdidtDECRYPT function twice on such split blocks, once when
    *          the first portion is read, and again when the second portion
    *          is read.  And, of course, most data blocks will not be split.
    *          So, there are three cases:
    *
    *           1) fSplit == False
    *              You have the entire data block, so decrypt it.
    *
    *           2) fSplit == True, cbPartial == 0
    *              This is the first portion of a split data block, so cbData
    *              is the size of this portion.  You can either choose to decrypt
    *              this piece, or ignore this call and decrypt the full CFDATA
    *              block on the next (second) fdidtDECRYPT call.
    *
    *           3) fSplit == True, cbPartial > 0
    *              This is the second portion of a split data block (indeed,
    *              cbPartial will have the same value as cbData did on the
    *              immediately preceeding fdidtDECRYPT call!).  If you decrypted
    *              the first portion on the first call, then you can decrypt the
    *              second portion now.  If you ignored the first call, then you
    *              can decrypt the entire buffer.
    *              NOTE: pbData points to the second portion of the split data
    *                    block in this case, *not* the entire data block.  If
    *                    you want to wait until the second piece to decrypt the
    *                    *entire* block, pbData-cbPartial is the address of the
    *                    start of the whole block, and cbData+cbPartial is its
    *                    size.
    *)

   TFNFDIDECRYPT_dummy = Function(pfdid: PFDIDECRYPT): Integer; CDECL;
   PFNFDIDECRYPT = TFNFDIDECRYPT_dummy;

   (* FDICABINETINFO - Information about a cabinet *)
   TFDICABINETINFO = Packed Record
      cbCabinet: longint;               (* 4  Total length of cabinet file	  *)
      cFolders: TUUSHORT;               (* 6  Count of folders in cabinet         *)
      cFiles: TUUSHORT;                 (* 8  Count of files in cabinet           *)
      setID: TUUSHORT;                  (* 10 Cabinet set ID                      *)
      iCabinet: TUUSHORT;               (* 12 Cabinet number in set (0 based)     *)
      fReserve: LongBool;               (* 16 True => RESERVE present in cabinet  *)
      hasprev: LongBool;                (* 20 True => Cabinet is chained prev     *)
      hasnext: LongBool;                (* 24 True => Cabinet is chained next     *)
   End;
   TPFDICABINETINFO = ^TFDICABINETINFO;

// functions

   (*************************************************************
    *  FDICreate - Create an FDI context
    *
    *  Entry:
    *      pfnalloc
    *      pfnfree
    *      pfnopen
    *      pfnread
    *      pfnwrite
    *      pfnclose
    *      pfnlseek
    *      cpuType  - Select CPU type (auto-detect, 286, or 386+)
    *                 NOTE: For the 32-bit FDI.LIB, this parameter is ignored!
    *      perf
    *
    *  Exit-Success:
    *      Returns non-NULL FDI context handle.
    *
    *  Exit-Failure:
    *      Returns NULL; perf filled in with error code
    *
    *************************************************************)
   (* CAUTION: If DYNLOADUNCABDLL is "not" defined, the CABINET.DLL
      must be found.  If not found, Delphi will be unable to load
      the cmplib32.dcl library the next time Delphi is run. *)

  (*
  *  HFDI - Handle to an FDI context
  *
  *  FDICreate() creates this, and it must be passed to all other FDI
  *  functions.
  *)

  HFDI = PVoid;

  PERF = ^TERF;
  TERF = Packed Record
    erfOper: Integer;                 (* FCI/FDI error code -- see FDIERROR_XXX    *)
                                      (*  and FCIERR_XXX equates for details.      *)
    erfType: Integer;                 (* Optional error value filled in by FCI/FDI *)
                                      (* For FCI, this is usually the C run-time   *)
                                      (* *errno* value.                            *)
    fError: LongBool;                 (* True => error present *)
  End;

  TFDICreate = Function(PFNALLOC: PFNALLOC; PFNFREE: PFNFREE; pfnopen: pfnopen;
    pfnread: pfnread; pfnwrite: pfnwrite; pfnclose: pfnclose;
    pfnseek: pfnseek; CpuType: Integer; PERF: PERF): HFDI; CDECL;

(*************************************************************
 *    FDIIsCabinet - Determines if file is a cabinet, returns info if it is
 *
 *  Entry:
 *      hfdi   - Handle to FDI context (created by FDICreate())
 *      hf     - File handle suitable for PFNREAD/PFNSEEK, positioned
 *               at offset 0 in the file to test.
 *      pfdici - Buffer to receive info about cabinet if it is one.
 *
 *  Exit-Success:
 *      Returns True; file is a cabinet, pfdici (variable CabInfo) filled in.
 *
 *  Exit-Failure:
 *      Returns False, file is not a cabinet;  If an error occurred,
 *          perf (passed on FDICreate call!) filled in with error.
 *************************************************************)

  TFDIIsCabinet = Function(HFDI: HFDI; hf: Integer; pfdici: TPFDICABINETINFO): Boolean; CDECL;

(*************************************************************
 *    FDICopy - extracts files from a cabinet
 *
 *  Entry:
 *      hfdi        - handle to FDI context (created by FDICreate())
 *      pszCabinet  - main name of cabinet file
 *      pszCabPath  - Path to cabinet file(s)
 *      flags       - Flags to modify behavior
 *      pfnfdin     - Notification function
 *      pfnfdid     - Decryption function (pass NULL if not used)
 *      pvUser      - User specified value to pass to notification function
 *
 *  Exit-Success:
 *      Returns True;
 *
 *  Exit-Failure:
 *      Returns False, perf (passed on FDICreate call!) filled in with
 *          error.
 *
 *  Notes:
 *  (1) If FDICopy() fails while a target file is being written out, then
 *      FDI will use the PFNCLOSE function to close the file handle for that
 *      target file that was returned from the fdintCOPY_FILE notification.
 *      The client application is then free to delete the target file, since
 *      it will not be in a valid state (since there was an error while
 *      writing it out).
 *
 *************************************************************)

  TFDICopy = Function(HFDI: HFDI; pszCabinet: PChar; pszCabPath: PChar;
    flags: Integer; pfnfdin: PFNFDINOTIFY; pfnfdid: PFNFDIDECRYPT;
    pvUser: PVoid): Boolean; CDECL;

(*************************************************************
 *    FDIDestroy - Destroy an FDI context
 *
 *  Entry:
 *      hfdi - handle to FDI context (created by FDICreate())
 *
 *  Exit-Success:
 *      Returns True;
 *
 *  Exit-Failure:
 *      Returns False;
 *************************************************************)

  TFDIDestroy = Function(HFDI: HFDI): Boolean; CDECL;

Implementation

End.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -