Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
2.9 KiB

  1. /* cab_dll.h -- CABINET.DLL high-level APIs */
  2. #ifndef _CAB_DLL_H_INCLUDED
  3. #define _CAB_DLL_H_INCLUDED
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. // File Name List
  8. //
  9. // used as pFilesToExtract to track files in the CAB we need extracted
  10. //
  11. // or a pFileList in PSESSION
  12. //
  13. // We keep track of all files that are in a cabinet
  14. // keeping their names in a list and when the download
  15. // is complete we use this list to delete temp files
  16. struct sFNAME {
  17. LPSTR pszFilename;
  18. struct sFNAME *pNextName;
  19. DWORD status; /* out */
  20. };
  21. typedef struct sFNAME FNAME;
  22. typedef FNAME *PFNAME;
  23. // SFNAME.status: success is 0 or non-zero error code in extraction
  24. #define SFNAME_INIT 1
  25. #define SFNAME_EXTRACTED 0
  26. /*** ERRF - Error structure
  27. *
  28. * This structure returns error information from FCI/FDI. The caller should
  29. * not modify this structure.
  30. *
  31. * Identical to an FCI/FDI ERF, but renamed to avoid collision.
  32. */
  33. typedef struct {
  34. int erfOper; // FCI/FDI error code -- see FDIERROR_XXX
  35. // and FCIERR_XXX equates for details.
  36. int erfType; // Optional error value filled in by FCI/FDI.
  37. // For FCI, this is usually the C run-time
  38. // *errno* value.
  39. BOOL fError; // TRUE => error present
  40. } ERRF;
  41. //
  42. // Master State Information for File Extraction: used by extract.c
  43. //
  44. typedef struct {
  45. UINT cbCabSize;
  46. ERRF erf;
  47. PFNAME pFileList; // List of Files in CAB
  48. UINT cFiles;
  49. DWORD flags; // flags: see below for list
  50. char achLocation[MAX_PATH]; // Dest Dir
  51. char achFile[MAX_PATH]; // Current File
  52. char achCabPath[MAX_PATH]; // Current Path to cabs
  53. PFNAME pFilesToExtract; // files to extract;null=enumerate only
  54. } SESSION, *PSESSION;
  55. typedef enum {
  56. SESSION_FLAG_NONE = 0x0,
  57. SESSION_FLAG_ENUMERATE = 0x1,
  58. SESSION_FLAG_EXTRACT_ALL = 0x2,
  59. SESSION_FLAG_EXTRACTED_ALL = 0x4
  60. } SESSION_FLAGS;
  61. typedef struct
  62. {
  63. DWORD cbStruct;
  64. DWORD dwReserved1;
  65. DWORD dwReserved2;
  66. DWORD dwFileVersionMS;
  67. DWORD dwFileVersionLS;
  68. } CABINETDLLVERSIONINFO, *PCABINETDLLVERSIONINFO;
  69. /* export definitions */
  70. typedef LPCSTR WINAPI FN_GETDLLVERSION(VOID);
  71. typedef FN_GETDLLVERSION *PFN_GETDLLVERSION;
  72. typedef VOID WINAPI FN_DLLGETVERSION(PCABINETDLLVERSIONINFO);
  73. typedef FN_DLLGETVERSION *PFN_DLLGETVERSION;
  74. typedef HRESULT WINAPI FN_EXTRACT(PSESSION,LPCSTR);
  75. typedef FN_EXTRACT *PFN_EXTRACT;
  76. typedef VOID WINAPI FN_DELETEEXTRACTEDFILES(PSESSION);
  77. typedef FN_DELETEEXTRACTEDFILES *PFN_DELETEEXTRACTEDFILES;
  78. #ifdef __cplusplus
  79. }
  80. #endif
  81. #endif // _CAB_DLL_H_INCLUDED