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.

200 lines
9.2 KiB

  1. /*
  2. * WUV3CTL.h - definitions/declarations for Windows Update V3 Catalog infra-structure
  3. *
  4. * Copyright (c) 1998-1999 Microsoft Corporation. All Rights Reserved.
  5. *
  6. * Purpose:
  7. * This file defines the structures, values, macros, and functions
  8. * used by the Version 3 Windows Update Catalog Control
  9. *
  10. */
  11. #ifndef _WUV3CTL_INC
  12. #pragma pack(1)
  13. //GetCatalog lFilters
  14. #define USEWUV3INCLUDES
  15. #include <wuv3.h>
  16. #undef USEWUV3INCLUDES
  17. //filter values for GetCatalog
  18. #define WU_ALL_ITEMS (long)0x00000000 //all items (no hidden items)
  19. #define WU_UPDATE_ITEMS (long)0x10000000 //items that are not currently installed
  20. #define WU_NO_DEVICE_DRIVERS (long)0x00000200 //do not return drivers (can be used with WU_ALL_ITEMS)
  21. #define WU_PERSONALIZE_HIDDEN (long)0x00000800 //items hidden by user (can be used with WU_ALL_ITEMS)
  22. #define WU_HIDDEN_ITEMS (long)0x00000001 //only items marked as hidden.
  23. #define WU_SELECTED_ITEMS (long)0x00000002 //selected items.
  24. #define WU_NOT_SELECTED_ITEMS (long)0x00000004 //items that are not currently selected.
  25. #define WU_NEW_ITEMS (long)0x00000008 //items that are marked as new
  26. #define WU_POWER_ITEMS (long)0x00000010 //items that are marked as power user items
  27. #define WU_REGISTER_ITEMS (long)0x00000020 //items that are marked as needing registration
  28. #define WU_COOL_ITEMS (long)0x00000040 //items that are marked as cool
  29. #define WU_EUAL_ITEMS (long)0x00000080 //items that are marked as having a End user
  30. #define WU_PATCH_ITEMS (long)0x00000100 //items that are marked as a patch.
  31. //used for ProcessCatalog
  32. #define WU_NO_PRUNING (long)0x00000400 //This flag is mainly used for corporate catalog as well as internal
  33. //debugging and testing, it will cause the pruning logic to not be
  34. //applied to the retrieved catalog.
  35. //GetCatalog array status values
  36. #define GETCATALOG_STATUS_HIDDEN (long)0x00000001 //Catalog item hidden.
  37. #define GETCATALOG_STATUS_SELECTED (long)0x00000002 //Catalog item selected for installation.
  38. #define GETCATALOG_STATUS_NEW (long)0x00000004 //Catalog item is a new offering.
  39. #define GETCATALOG_STATUS_POWER (long)0x00000008 //Catalog item is best for power users.
  40. #define GETCATALOG_STATUS_REGISTRATION (long)0x00000010 //Catalog item requires that the client be registered.
  41. #define GETCATALOG_STATUS_COOL (long)0x00000020 //Catalog item is considered an interesting item.
  42. #define GETCATALOG_STATUS_PATCH (long)0x00000040 //Catalog item is a patch so requires special handling.
  43. #define GETCATALOG_STATUS_SECTION (long)0x00000080 //Catalog item is a section header.
  44. #define GETCATALOG_STATUS_SUBSECTION (long)0x00000100 //Catalog item is a sub section header.
  45. #define GETCATALOG_STATUS_SUBSUBSECTION (long)0x00000200 //Catalog item is a sub sub section header.
  46. #define GETCATALOG_STATUS_INSTALL (long)0x00000400 //Catalog item is an install for an item that the client current does not have.
  47. #define GETCATALOG_STATUS_UPDATE (long)0x00000800 //Catalog item is an update for an item that currently exists on the client computer.
  48. #define GETCATALOG_STATUS_CURRENT (long)0x00001000 //Catalog item is currently installed on the client system.
  49. #define GETCATALOG_STATUS_UNKNOWN (long)0x00002000 //Catalog item's status could not be determined.
  50. #define GETCATALOG_STATUS_CRITICALUPDATE (long)0x00004000 //Catalog item is marked as a critical update item.
  51. #define GETCATALOG_STATUS_EXCLUSIVE (long)0x00008000 //Catalog item is exclusive it cannot be selected with other components.
  52. #define GETCATALOG_STATUS_PERSONALIZE_HIDDEN (long)0x00010000 //Catalog item hidden by registry
  53. #define GETCATALOG_STATUS_WARNING_SCARY (long)0x00020000 //Display a scary warning message
  54. //ChangeItemState possible states
  55. #define ITEM_STATE_HIDE_ITEM (long)0x00000001 //Hide Catalog item
  56. #define ITEM_STATE_SHOW_ITEM (long)0x00000002 //Show Catalog item
  57. #define ITEM_STATE_SELECT_ITEM (long)0x00000004 //Select Catalog item
  58. #define ITEM_STATE_UNSELECT_ITEM (long)0x00000008 //Unselect Catalog item
  59. #define ITEM_STATE_PERSONALIZE_HIDE (long)0x00000010 //Hide item using registry hiding
  60. #define ITEM_STATE_INSTALL_ITEM (long)0x00000020 //The item is to be selected for installation.
  61. #define ITEM_STATE_REMOVE_ITEM (long)0x00000040 //The item is to be selected for removal.
  62. #define ITEM_STATE_PERSONALIZE_UNHIDE (long)0x00000080 //Unhide item from registry hiding
  63. //InstallSelectedItems flags
  64. #define WU_NO_SPECIAL_FLAGS (long)0x00000000 //This flag is only valid if used by itself. It is used
  65. #define WU_COPYONLY_NO_INSTALL (long)0x00000001 //This flag is used to indicate that the selected packages
  66. //should be copied to the client machine but not installed.
  67. //The OPERATION_SUCCESS and OPERATION_FAILED equate to
  68. //ITEM_STATUS_SUCCESS and ITEM_STATUS_INSTALLED_ERROR which
  69. //are defined in cstate.h
  70. #define OPERATION_SUCCESS (long)0x0000000 //Log entry operation was successfull.
  71. #define OPERATION_ERROR (long)0x0000001 //Log entry operation had one or more errors.
  72. #define OPERATION_STARTED (long)0x0000002 //Log entry operation was started
  73. #define INSTALL_OPERATION (long)0x0001000 //Log entry is for an Install Operation.
  74. #define REMOVE_OPERATION (long)0x0002000 //Log entry is for an Remove Operation.
  75. //flags for FinalizeInstall
  76. #define FINALIZE_DOREBOOT 0x00000001
  77. #define FINALIZE_NOREBOOTPROMPT 0x00000002
  78. //Install Remove Item History structure.
  79. typedef struct _HISTORYSTRUCT
  80. {
  81. PUID puid; //item's puid.
  82. char szTitle[256]; //items title.
  83. BOOL bInstall; //TRUE if installed, FALSE if removed
  84. DWORD bResult; //OPERATION_SUCCESS, OPERATION_ERROR, OPERATION_STARTED
  85. HRESULT hrError; //specific error code if an error occured.
  86. char szVersion[40]; //formated version or driverver
  87. char szDate[32];
  88. char szTime[32];
  89. BYTE RecType; //record type: driver or activesetup
  90. BOOL bV2; //imported from V2
  91. } HISTORYSTRUCT, *PHISTORYSTRUCT;
  92. //Each catalog item is returned in a structure of this type.
  93. typedef struct _CATALOG32ITEM
  94. {
  95. PUID puid; //Items puid identifier.
  96. PTCHAR pTitle; //localized title display text.
  97. PTCHAR pDescription; //localized description text.
  98. long lStatus; //status of this item.
  99. int iDownloadSize; //download size in bytes.
  100. int iDownloadTime; //download time in minutes.
  101. PSTR pUninstallKey; //uninstall string
  102. } CATALOG32ITEM, *PCATALOG32ITEM;
  103. //Structures used with the C++ Interfaces
  104. typedef struct _CATALOG32
  105. {
  106. int iTotalItems; //Total items in catalog
  107. PCATALOG32ITEM pItems; //Array of catalog item structures.
  108. } CATALOG32, *PCATALOG32;
  109. //Install Results item structure
  110. typedef struct _INSTALLRESULTSTATUS
  111. {
  112. PUID puid; //The identifier for this record.
  113. int iStatus; //This field is one of the following:
  114. //ITEM_STATUS_SUCCESS The package was installed successfully.
  115. //ITEM_STATUS_INSTALLED_ERROR The package was Installed however there were some minor problems that did not prevent installation.
  116. //ITEM_STATUS_FAILED The packages was not installed.
  117. HRESULT hrError; //Error describing the reason that the package did not install if the Status field is not equal to SUCCESS.
  118. } INSTALLRESULTSTATUS, *PINSTALLRESULTSTATUS;
  119. //Install results array returned from GetInstallStatus32().
  120. typedef struct _INSTALLRESULTSARRAY
  121. {
  122. int iTotalItems; //Total items returned in array.
  123. PINSTALLRESULTSTATUS pItems; //Specific install status items.
  124. } INSTALLRESULTSARRAY, *PINSTALLRESULTSARRAY;
  125. //Install Metrics item structure
  126. typedef struct _INSTALLMETRICSITEMS
  127. {
  128. PUID puid; //The identifier for this record.
  129. int iDownloadSize; //download size in bytes.
  130. int iDownloadTime; //download time in minutes.
  131. } INSTALLMETRICSITEMS, *PINSTALLMETRICSITEMS;
  132. //Install results array returned from GetInstallStatus32().
  133. typedef struct _INSTALLMETRICSARRAY
  134. {
  135. int iTotalItems; //Total items returned in array.
  136. PINSTALLMETRICSITEMS pItems; //Specific install status items.
  137. } INSTALLMETRICSARRAY, *PINSTALLMETRICSARRAY;
  138. //Returned install and remove history structure array. This array
  139. //is returned from the GetInstallHistory32() method.
  140. typedef struct _HISTORYARRAY
  141. {
  142. int iTotalItems; //Total returned items.
  143. #pragma warning( disable : 4200 )
  144. HISTORYSTRUCT HistoryItems[]; //Array of history items.
  145. #pragma warning( default : 4200 )
  146. } HISTORYARRAY, *PHISTORYARRAY;
  147. //
  148. // IWUpdateCatalog interface
  149. //
  150. class __declspec(novtable) IWUpdateCatalog : public IUnknown
  151. {
  152. public:
  153. STDMETHOD(WUIsCatalogAvailable)(long puidCatalog, BSTR bstrServerUrl) = 0;
  154. STDMETHOD(WUGetCatalog)(long puidCatalog, BSTR bstrServerUrl, long platformId, BSTR bstrBrowserLangauge, CCatalog** ppCatalogArray) = 0;
  155. STDMETHOD(WUDownloadItems)(CSelections* pSelections, BSTR bstrServer, BSTR bstrTempDir) = 0;
  156. STDMETHOD(WUInstallItems)(CSelections* pSelections, BSTR bstrServer, BSTR bstrTempDir) = 0;
  157. STDMETHOD(WURemoveItems)(CSelections* pSelections) = 0;
  158. STDMETHOD(WUCopyInstallHistory)(HISTORYARRAY** ppHistoryArray) = 0;
  159. STDMETHOD(WUCopyDependencyList)(long puidItem, long** ppDepPuid) = 0;
  160. STDMETHOD(WUProgressDlg)(BOOL bOn) = 0;
  161. };
  162. class __declspec(uuid("1B1FA90D-96CD-11d2-9E16-00C04F79E980")) IWUpdateCatalog;
  163. #include <autoupd.h>
  164. #pragma pack()
  165. #define _WUV3CTL_INC
  166. #endif