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.

176 lines
7.2 KiB

  1. //=======================================================================
  2. //
  3. // Copyright (c) 1998-1999 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // File: wuv3cdm.h
  6. //
  7. // Owner: YanL
  8. //
  9. // Description:
  10. //
  11. // This file defines the structures, values, macros, and functions
  12. // used by the Version 3 Windows Update Catalog
  13. //
  14. //=======================================================================
  15. #ifndef _WUV3CDM_H
  16. #pragma pack(1)
  17. #ifndef PUID
  18. typedef long PUID; //Windows Update assigned identifier
  19. //that is unique across catalogs.
  20. typedef PUID *PPUID; //Pointer to a PUID type.
  21. #endif
  22. //The WU_VARIABLE_END field is the only required field variable field. It is used to signify
  23. //that there are no more variable fields associated with an inventory record.
  24. #define WU_VARIABLE_END ((short)0)
  25. struct WU_VARIABLE_FIELD
  26. {
  27. WU_VARIABLE_FIELD();
  28. short id; //record type identifier
  29. short len; //length of variable record data
  30. //size we are using a 0 size array place hold we need to disable the
  31. //compiler warning since it will complain about this being non standard
  32. //behavor.
  33. #pragma warning( disable : 4200 )
  34. BYTE pData[]; //variable field record data
  35. #pragma warning( default : 4200 )
  36. //The GetNextItem function returns a pointer to the next variable array item
  37. //if it exists or NULL if it does not.
  38. WU_VARIABLE_FIELD *GetNext(void);
  39. //The FindItem function returns a pointer to the next variable array item
  40. //if the requested item is found or NULL the item is not found.
  41. WU_VARIABLE_FIELD *Find(short id);
  42. //returns the total size of this variable field array.
  43. int GetSize(void);
  44. };
  45. typedef WU_VARIABLE_FIELD * PWU_VARIABLE_FIELD;
  46. //defined variable Description file items.
  47. #define WU_DESCRIPTION_NONE ((short)0) //no other description flags only valid if used with no other flags
  48. #define WU_DESCRIPTION_TITLE ((short)1) //title of item that is to be displayed
  49. #define WU_DESCRIPTION_DESCRIPTION ((short)2) //description text that is displayed with item
  50. #define WU_DESCRIPTION_PACKAGE ((short)3) //?????
  51. #define WU_DESCRIPTION_EURLA_URL ((short)4) //license text url that needs read and accepted before package is installed
  52. #define WU_DESCRIPTION_READTHIS_URL ((short)5) //read this first url
  53. #define WU_DESCRIPTION_PATCH ((short)6) //?????? this is not a patch in the clasic sense need to find out what this is
  54. #define WU_DESCRIPTION_UNINSTALL_KEY ((short)7) //uninstall command
  55. #define WU_DESCRIPTION_INSTALLCABNAME ((short)8) //name of cab file that contains the installation CIF. This cab name is a NULL terminated string and is passed to active setup to install the package.
  56. #define WU_DESCRIPTION_CABFILENAME ((short)9) //cab file name for installation this is one or more and is in the format of an array of NULL terminated strings with the last entry double null terminated. This is known as a multisz string in the langauge of the registry.
  57. #define WU_DESCRIPTION_SERVERROOT ((short)10) //Server root3rd Level - Server root for install cabs. The tools and database will also need to understand that at times a piece of content can be located on a different download server from the main server and the structures need to be able to handle this. This allows us to host a single server site, a split server site like what we have today and a multi headed download server farm. The real goal behind this is to make sure we can host OEM content on the site without having to store the cabs on our servers.
  58. #define WU_USE_DEFAULT_PLATFORM ((short)46)
  59. #define WU_DESC_CRC_ARRAY ((short)61) // An array of CRC hash structs (WUCRC_HASH) for each CAB
  60. typedef struct _WU_DESCRIPTION
  61. {
  62. DWORD flags; //Icon flags to display with description
  63. DWORD size; //compressed total size of package
  64. DWORD downloadTime; //time to download @ 28,800
  65. PUID dependency; //display dependency link
  66. PWU_VARIABLE_FIELD pv; //variable length fields associated with this description file
  67. } WU_DESCRIPTION, *PWU_DESCRIPTION;
  68. #define BITMASK_GLOBAL_INDEX 0 //index of global bitmask
  69. #define BITMASK_OEM_DEFAULT 1 //index of default OEM bitmask
  70. #define BITMASK_ID_OEM ((BYTE)1) //BITMASKID entry is an OEM id
  71. #define BITMASK_ID_LOCALE ((BYTE)2) //BITMASKID entry is a LOCALE id
  72. //The bitmask file is arranged as a series of bit bitmasks in the same order as
  73. //the oem and langauge ids. For example if DELL1 was the second id in the id
  74. //array section of the bitmask file then is bitmask would begin the third bitmask
  75. //in the bitmask section of the file. The reason that it is the third and not
  76. //second is that the first bitmask is always the global bitmask and there is no
  77. //corrisponding id field for the global mask as this mask is always present.
  78. //A bitmask OEM or LOCALE id is a DWORD.
  79. typedef DWORD BITMASKID;
  80. typedef DWORD *PBITMASKID;
  81. typedef struct _BITMASK
  82. {
  83. int iRecordSize; //number of bits in a single bitmask record
  84. int iBitOffset; //offset to bitmap bits in bytes
  85. int iOemCount; //Total number of oem ids in bitmask
  86. int iLocaleCount; //Total number of locale ids in bitmask
  87. int iPlatformCount; //Total number of platforms defined.
  88. #pragma warning( disable : 4200 )
  89. BITMASKID bmID[]; //OEM & LANGAUGE & future types arrays.
  90. #pragma warning( default : 4200 )
  91. //since there are one or more array of OEM & LANGAUGE types this needs to be
  92. //a pointer and will need to be manually set to the correct location when the
  93. //bitmask file is created or read.
  94. PBYTE GetBitsPtr(void) { return ((PBYTE)this+iBitOffset); } //beginning of bitmask bit arrays
  95. PBYTE GetBitMaskPtr(int index) { return GetBitsPtr() + ((iRecordSize+7)/8) * index; }
  96. } BITMASK, *PBITMASK;
  97. //catalog list
  98. #define CATLIST_STANDARD ((DWORD)0x00)
  99. #define CATLIST_CRITICALUPDATE ((DWORD)0x01)
  100. #define CATLIST_DRIVERSPRESENT ((DWORD)0x02)
  101. typedef struct _CATALOGLIST
  102. {
  103. DWORD dwPlatform;
  104. DWORD dwCatPuid;
  105. DWORD dwFlags;
  106. } CATALOGLIST, *PCATALOGLIST;
  107. #pragma pack()
  108. //bitmask helper macros
  109. //returns 1 if bit is set 0 if bit is not set
  110. inline bool GETBIT(PBYTE pbits, int index) { return (pbits[(index/8)] & (0x80 >> (index%8))) != 0; }
  111. //sets requested bit to 1
  112. inline void SETBIT(PBYTE pbits, int index) { pbits[index/8] |= (0x080 >> (index%8)); }
  113. //clears requested bit to 0
  114. inline void CLRBIT(PBYTE pbits, int index) { pbits[index/8] &= (0xff ^ (0x080 >> (index%8))); }
  115. //These values are written into the bitmask.plt file as the platform ids. When additional
  116. //platforms are added we will need to add a new enumeration value here.
  117. //
  118. //IMPORTANT NOTE!!!
  119. // This definition must be consistant with osdet.cpp detection as well as with the database
  120. typedef enum
  121. {
  122. enV3_DefPlat = 0,
  123. enV3_W95IE5 = 1,
  124. enV3_W98IE4 = 2,
  125. enV3_W98IE5 = 3,
  126. enV3_NT4IE5X86 = 4,
  127. enV3_NT4IE5ALPHA = 5,
  128. enV3_NT5IE5X86 = 6,
  129. //enV3_NT5IE5ALPHA = 7,
  130. enV3_NT4IE4ALPHA = 8,
  131. enV3_NT4IE4X86 = 9,
  132. enV3_W95IE4 = 10,
  133. enV3_MILLENNIUMIE5 = 11,
  134. enV3_W98SEIE5 = 12,
  135. //enV3_NEPTUNEIE5 = 13,
  136. enV3_NT4IE5_5X86 = 14,
  137. enV3_W95IE5_5 = 15,
  138. enV3_W98IE5_5 = 16,
  139. enV3_NT5IE5_5X86 = 17,
  140. enV3_Wistler = 18,
  141. enV3_Wistler64 = 19,
  142. enV3_NT5DC = 20,
  143. } enumV3Platform;
  144. #endif