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.

102 lines
2.6 KiB

  1. #ifndef _CDL_H_
  2. #define _CDL_H_
  3. // #define USE_BINDHOST 1
  4. // CDL.h
  5. // Code Downloader header file
  6. //
  7. // Read "class descriptions" first for understanding how the
  8. // code downloader works.
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. /*** ERF - Error structure
  13. *
  14. * This structure returns error information from FCI/FDI. The caller should
  15. * not modify this structure.
  16. */
  17. typedef struct {
  18. int erfOper; // FCI/FDI error code -- see FDIERROR_XXX
  19. // and FCIERR_XXX equates for details.
  20. int erfType; // Optional error value filled in by FCI/FDI.
  21. // For FCI, this is usually the C run-time
  22. // *errno* value.
  23. BOOL fError; // TRUE => error present
  24. } ERF; /* erf */
  25. typedef ERF FAR *PERF; /* perf */
  26. // buffer size for downloads in CBSC::m_cbuffer
  27. #define BUFFERMAX 2048
  28. // File Name List
  29. //
  30. // used as pFilesToExtract to track files in the CAB we need extracted
  31. //
  32. // or a pFileList in PSESSION
  33. //
  34. // We keep track of all files that are in a cabinet
  35. // keeping their names in a list and when the download
  36. // is complete we use this list to delete temp files
  37. struct sFNAME {
  38. LPSTR pszFilename;
  39. struct sFNAME *pNextName;
  40. DWORD status; /* out */
  41. };
  42. typedef struct sFNAME FNAME;
  43. typedef FNAME *PFNAME;
  44. // SFNAME.status: success is 0 or non-zero error code in extraction
  45. #define SFNAME_INIT 1
  46. #define SFNAME_EXTRACTED 0
  47. // FILE extentions we know about
  48. typedef enum {
  49. FILEXTN_NONE,
  50. FILEXTN_UNKNOWN,
  51. FILEXTN_CAB,
  52. FILEXTN_DLL,
  53. FILEXTN_OCX,
  54. FILEXTN_INF,
  55. FILEXTN_EXE,
  56. } FILEXTN;
  57. //
  58. // Master State Information for File Extraction: used by extract.c
  59. //
  60. typedef struct {
  61. UINT cbCabSize;
  62. ERF erf;
  63. PFNAME pFileList; // List of Files in CAB
  64. UINT cFiles;
  65. DWORD flags; // flags: see below for list
  66. char achLocation[MAX_PATH]; // Dest Dir
  67. char achFile[MAX_PATH]; // Current File
  68. char achCabPath[MAX_PATH]; // Current Path to cabs
  69. PFNAME pFilesToExtract; // files to extract;null=enumerate only
  70. } SESSION, *PSESSION;
  71. typedef enum {
  72. SESSION_FLAG_NONE = 0x0,
  73. SESSION_FLAG_ENUMERATE = 0x1,
  74. SESSION_FLAG_EXTRACT_ALL = 0x2,
  75. SESSION_FLAG_EXTRACTED_ALL = 0x4
  76. } SESSION_FLAGS;
  77. #ifdef __cplusplus
  78. }
  79. #endif
  80. #endif // _CDL_H_