Source code of Windows XP (NT5)
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.

117 lines
2.7 KiB

  1. /*****************************************************************************\
  2. * MODULE: gencdf.h
  3. *
  4. * This is the main header for the CDF generation module.
  5. *
  6. * Copyright (C) 1996-1997 Microsoft Corporation
  7. * Copyright (C) 1996-1997 Hewlett Packard
  8. *
  9. * History:
  10. * 22-Nov-1996 HWP-Guys Created.
  11. *
  12. \*****************************************************************************/
  13. #define STD_CDF_BUFFER 256
  14. #define MIN_CDF_BUFFER 16
  15. #define CDF_SECTION_BLOCK 4096
  16. #define CDF_SRCFILE_BLOCK 1024
  17. #define CDF_SECTION_LIMIT 8
  18. // Source-Files Structure. This is used to track files
  19. // by section.
  20. //
  21. typedef struct _SRCFILES {
  22. LPTSTR lpszPath;
  23. LPTSTR lpszFiles;
  24. DWORD cbMax;
  25. DWORD cbSize;
  26. struct _SRCFILES *pNext;
  27. } SRCFILES;
  28. typedef SRCFILES *PSRCFILES;
  29. typedef SRCFILES NEAR *NPSRCFILES;
  30. typedef SRCFILES FAR *LPSRCFILES;
  31. // Element-Array idenifiers for FILEITEM
  32. //
  33. #define FI_MAX_ITEMS 2
  34. #define FI_COL_FILENAME 0
  35. #define FI_COL_PATH 1
  36. #define FI_COL_LAST 1
  37. // File-Item Structure.
  38. //
  39. typedef struct _FILEITEM {
  40. LPTSTR aszCols[FI_MAX_ITEMS]; // Filename and Path.
  41. FILETIME ftLastModify; // Filetime stamp.
  42. struct _FILEITEM *pNext; // Pointer to next File-Item.
  43. } FILEITEM;
  44. typedef FILEITEM *PFILEITEM;
  45. typedef FILEITEM NEAR *NPFILEITEM;
  46. typedef FILEITEM FAR *LPFILEITEM;
  47. // CDF Object Structure.
  48. //
  49. typedef struct _CDFINFO {
  50. HANDLE hInf; // Handle to current inf object
  51. DWORD dwError; // Error if CDF processing fails
  52. LPTSTR lpszCdfFile; // Full path-name to cdf-file.
  53. PFILEITEM pTop; // List of files to include in the .cdf
  54. HCATADMIN hCatAdmin; // Context handle for catalog admin APIs
  55. BOOL bSecure;
  56. } CDFINFO;
  57. typedef CDFINFO *PCDFINFO;
  58. typedef CDFINFO NEAR *NPCDFINFO;
  59. typedef CDFINFO FAR *LPCDFINFO;
  60. // Interface Objects to CDF.
  61. //
  62. HANDLE cdfCreate(
  63. HANDLE hinf,
  64. BOOL bSecure);
  65. VOID cdfCleanUpSourceFiles(
  66. HANDLE hInf);
  67. BOOL cdfProcess(
  68. HANDLE hcdf);
  69. BOOL cdfDestroy(
  70. HANDLE hcdf);
  71. LPCTSTR cdfGetName(
  72. HANDLE hcdf);
  73. BOOL cdfGetModTime(
  74. HANDLE hcdf,
  75. LPFILETIME lpftMod);
  76. /***************************************\
  77. * cdfGetError
  78. \***************************************/
  79. __inline DWORD cdfGetError(
  80. HANDLE hsed)
  81. {
  82. return (hsed ? (DWORD)((PCDFINFO)hsed)->dwError : ERROR_SUCCESS);
  83. }
  84. /***************************************\
  85. * cdfSetError
  86. \***************************************/
  87. __inline VOID cdfSetError(
  88. PCDFINFO hsed,
  89. DWORD dwError )
  90. {
  91. hsed->dwError = dwError;
  92. }