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

📄 ztvuncabtypes.pas

📁 ziptv为delphi控件
💻 PAS
📖 第 1 页 / 共 3 页
字号:
*          Returns True
*      Exit-Failure:
*          Returns False, or -1 to abort;
*
*              IMPORTANT NOTE IMPORTANT:
*                  pfdin->cb is overloaded to no longer be the size of
*                  the file but to be a binary indicated run or not
*
*              IMPORTANT NOTE:
*                  FDI assumes that the target file was closed, even if this
*                  callback returns failure.  FDI will NOT attempt to use
*                  the PFNCLOSE function supplied on FDICreate() to close
*                  the file!
*
*  fdintPARTIAL_FILE:
*        Called for files at the front of the cabinet that are CONTINUED
*        from a previous cabinet.  This callback occurs only when FDICopy is
*        started on second or subsequent cabinet in a series that has files
*        continued from a previous cabinet.
*      Entry:
*          pfdin->psz1 = file name of file CONTINUED from a PREVIOUS cabinet
*          pfdin->psz2 = name of cabinet where file starts
*          pfdin->psz3 = name of disk where file starts
*      Exit-Success:
*          Return anything other than -1; enumeration continues
*      Exit-Failure:
*          Returns -1 => Abort FDICopy() call
*
*  fdintENUMERATE:
*        Called once after a call to FDICopy() starts scanning a CAB's
*        CFFILE entries, and again when there are no more CFFILE entries.
*        If CAB spanning occurs, an additional call will occur after the
*        first spanned file is completed.  If the pfdin->iFolder value is
*        changed from zero, additional calls will occur next time it reaches
*        zero.  If iFolder is changed to zero, FDICopy will terminate, as if
*        there were no more CFFILE entries.  Primarily intended to allow an
*        application with it's own file list to help FDI advance quickly to
*        a CFFILE entry of interest.  Can also be used to allow an
*        application to determine the cb values for each file in the CAB.
*      Entry:
*        pfdin->cb        = current CFFILE position
*        pfdin->iFolder   = number of files remaining
*        pfdin->setID     = current CAB's setID value
*      Exit-Don't Care:
*        Don't change anything.
*        Return anything but -1.
*      Exit-Forcing a skip:
*        pfdin->cb        = desired CFFILE position
*        pfdin->iFolder   = desired # of files remaining
*        Return anything but -1.
*      Exit-Stop:
*        pfdin->iFolder    = set to 0
*        Return anything but -1.
*      Exit-Failure:
*        Return -1 => Abort FDICopy call ("user aborted".)
*      Notes:
*        This call can be ignored by applications which want normal file
*        searching.  The application can adjust the supplied values to
*        force FDICopy() to continue it's search at another location, or
*        to force FDICopy() to terminate the search, by setting iFolder to 0.
*        (FDICopy() will report no error when terminated this way.)
*        FDI has no means to verify the supplied cb or iFolder values.
*        Arbitrary values are likely to cause undesirable results.  An
*        application should cross-check pfdin->setID to be certain the
*        external database is in sync with the CAB.  Reverse-skips are OK
*        (but may be inefficient) unless fdintNEXT_CABINET has been called.
*
*  fdintNEXT_CABINET:
*        This function is *only* called when fdintCOPY_FILE was told to copy
*        a file in the current cabinet that is continued to a subsequent
*        cabinet file.  It is important that the cabinet path name (psz3)
*        be validated before returning!  This function should ensure that
*        the cabinet exists and is readable before returning.  So, this
*        is the function that should, for example, issue a disk change
*        prompt and make sure the cabinet file exists.
*
*        When this function returns to FDI, FDI will check that the setID
*        and iCabinet match the expected values for the next cabinet.
*        If not, FDI will continue to call this function until the correct
*        cabinet file is specified, or until this function returns -1 to
*        abort the FDICopy() function.  pfdin->fdie is set to
*        FDIERROR_WRONG_CABINET to indicate this case.
*
*        If you *haven't* ensured that the cabinet file is present and
*        readable, or the cabinet file has been damaged, pfdin->fdie will
*        receive other appropriate error codes:
*
*              FDIERROR_CABINET_NOT_FOUND
*              FDIERROR_NOT_A_CABINET
*              FDIERROR_UNKNOWN_CABINET_VERSION
*              FDIERROR_CORRUPT_CABINET
*              FDIERROR_BAD_COMPR_TYPE
*              FDIERROR_RESERVE_MISMATCH
*              FDIERROR_WRONG_CABINET
*
*      Entry:
*          pfdin->psz1 = name of next cabinet where current file is continued
*          pfdin->psz2 = name of next disk where current file is continued
*          pfdin->psz3 = cabinet path name; FDI concatenates psz3 with psz1
*                          to produce the fully-qualified path for the cabinet
*                          file.  The 256-byte buffer pointed at by psz3 may
*                          be modified, but psz1 may not!
*          pfdin->fdie = FDIERROR_WRONG_CABINET if the previous call to
*                        fdintNEXT_CABINET specified a cabinet file that
*                        did not match the setID/iCabinet that was expected.
*      Exit-Success:
*          Return anything but -1
*      Exit-Failure:
*          Returns -1 => Abort FDICopy() call
*      Notes:
*          This call is almost always made when a target file is open and
*          being written to, and the next cabinet is needed to get more
*          data for the file.
*)

   TFDINOTIFICATIONTYPE = (
      fdintCABINET_INFO,                (* General information about cabinet	*)
      fdintPARTIAL_FILE,                (* First file in cabinet is continuation*)
      fdintCOPY_FILE,                   (* File to be copied			*)
      fdintCLOSE_FILE_INFO,             (* close the file, set relevant info    *)
      fdintNEXT_CABINET,                (* File continued to next cabinet       *)
      fdintENUMERATE                    (* Enumeration status                   *)
      );
   TFNFDINOTIFY_dummy = Function(fdint: TFDINOTIFICATIONTYPE;
      pfdin: PFDINOTIFICATION): Integer; CDECL;
   PFNFDINOTIFY = TFNFDINOTIFY_dummy;

   (* cpuType values for FDICreate()
    *
    *  (Ignored by 32-bit FDI.)
    *)

   //Const
   //  cpuUNKNOWN = (-1);
   //  cpu80286 = (0);
   //  cpu80386 = (1);

   (* FDIDECRYPTTYPE - PFNFDIDECRYPT command types *)

   TFDIDECRYPTTYPE = (
      fdidtNEW_CABINET,                 (* New cabinet *)
      fdidtNEW_FOLDER,                  (* New folder	*)
      fdidtDECRYPT                      (* Decrypt a data block *)
      );                                (* fdidt *)

   (* FDIDECRYPT - Data for PFNFDIDECRYPT function *)
   TFDIDECRYPT = Packed Record
      fdidt: TFDIDECRYPTTYPE;           (* Command type (selects union below) 	*)
      pvUser: PVoid;                    (* Decryption context			*)
      _noname1: Packed Record
         Case Integer Of
            1: (
               cabinet:
               Packed Record            (* fdidtNEW_CABINET *)
                  pHeaderReserve: PVoid; (* RESERVE section from CFHEADER *)
                  cbHeaderReserve: TUUSHORT; (* Size of pHeaderReserve 	   *)
                  setID: TUUSHORT;      (* Cabinet set ID		   *)
                  iCabinet: Integer;    (* Cabinet number in set (0 based) *)
               End;
               );
            2: (
               folder:
               Packed Record            // fdidtNEW_FOLDER
                  pFolderReserve: PVoid; (* RESERVE section from CFFOLDER *)
                  cbFolderReserve: TUUSHORT; (* Size of pFolderReserve    *)
                  iFolder: TUUSHORT;    (* Folder number in cabinet (0 based) *)
               End;
               );
            3: (
               decrypt:
               Packed Record            // fdidtDECRYPT
                  pDataReserve: PVoid;  (* RESERVE section from CFDATA	       *)
                  cbDataReserve: TUUSHORT; (* Size of pDataReserve             *)
                  pbData: PVoid;        (* Data buffer                         *)
                  cbData: TUUSHORT;     (* Size of data buffer                 *)
                  fSplit: Boolean;      (* True if this is a split data block  *)
                  cbPartial: TUUSHORT;  (* 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.     *)
               End;
               );
      End;
   End;
   PFDIDECRYPT = ^TFDIDECRYPT;

   (*    FNALLOC - Memory Allocation
    *      FNFREE  - Memory Free
    *
    *  These are modeled after the C run-time routines malloc() and free()
    *  FDI expects error handling to be identical to these C run-time routines.
    *
    *  As long as you faithfully copy the semantics of malloc() and free(),
    *  you can supply any functions you like!
    *
    *  WARNING: You should never assume anything about the sequence of
    *           PFNALLOC and PFNFREE calls -- incremental releases of
    *           FDI may have radically different numbers of
    *           PFNALLOC calls and allocation sizes!
    *)

   (* Memory functions for FDI *)

   TFNALLOC_dummy = Function(cb: TULONG): PVoid; CDECL;
   PFNALLOC = TFNALLOC_dummy;

   TFNFREE_dummy = Function(pv: PVoid): Pointer; CDECL;
   PFNFREE = TFNFREE_dummy;

   (*      PFNOPEN  - File I/O callbacks for FDI
    *      PFNREAD
    *      PFNWRITE
    *      PFNCLOSE
    *      PFNSEEK
    *
    *  These are modeled after the C run-time routines _open, _read,
    *  _write, _close, and _lseek.  The values for the PFNOPEN oflag
    *  and pmode calls are those defined for _open.  FDI expects error
    *  handling to be identical to these C run-time routines.
    *
    *  As long as you faithfully copy these aspects, you can supply
    *  any functions you like!
    *
    *  WARNING: You should never assume you know what file is being
    *           opened at any one point in time!  FDI will usually
    *           stick to opening cabinet files, but it is possible
    *           that in a future implementation it may open temporary
    *           files or open cabinet files in a different order.
    *
    *  Notes for Memory Mapped File fans:
    *      You can write wrapper routines to allow FDI to work on memory
    *      mapped files.  You'll have to create your own "handle" type so that
    *      you can store the base memory address of the file and the current
    *      seek position, and then you'll allocate and fill in one of these
    *      structures and return a pointer to it in response to the PFNOPEN
    *      call and the fdintCOPY_FILE call.  Your PFNREAD and PFNWRITE
    *      functions will do memcopy(), and update the seek position in your
    *      "handle" structure.  PFNSEEK will just change the seek position
    *      in your "handle" structure.
    *)

   (* File I/O functions for FDI *)

   TFNOPEN_dummy = Function(pszFile: PChar; oflag: Integer; pmode: Integer): Integer; CDECL;
   pfnopen = TFNOPEN_dummy;

⌨️ 快捷键说明

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