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.

213 lines
6.6 KiB

  1. // base IU header
  2. #ifndef __IU_H_
  3. #define __IU_H_
  4. #include <setupapi.h>
  5. #include <advpub.h>
  6. #include <windows.h>
  7. #include <wtypes.h>
  8. #include <urllogging.h>
  9. //
  10. // cdm.h is checked in as //depot/Lab04_N/enduser/published/inc/cdm.w and
  11. // published to $(BASEDIR)\public\internal\enduser\inc
  12. //
  13. #include <cdm.h>
  14. /////////////////////////////////////////////////////////////////////////////
  15. // Engine typedefs
  16. //
  17. // used to delegate calls to engine (IUEngine.dll) from stub (IUCtl.dll)
  18. // and used to support other WU clients (AU/DU)
  19. /////////////////////////////////////////////////////////////////////////////
  20. //
  21. // Declare a type-safe handle to use with iuengine exports
  22. //
  23. DECLARE_HANDLE (HIUENGINE);
  24. typedef HRESULT (WINAPI * PFN_GetSystemSpec)(HIUENGINE hIUEngine,
  25. BSTR bstrXmlClasses,
  26. DWORD dwFlags,
  27. BSTR* pbstrXmlDetectionResult);
  28. typedef HRESULT (WINAPI * PFN_GetManifest) (HIUENGINE hIUEngine,
  29. BSTR bstrXmlClientInfo,
  30. BSTR bstrXmlSystemSpec,
  31. BSTR bstrXmlQuery,
  32. DWORD dwFlags,
  33. BSTR* pbstrXmlCatalog);
  34. typedef HRESULT (WINAPI * PFN_Detect) (HIUENGINE hIUEngine,
  35. BSTR bstrXmlCatalog,
  36. DWORD dwFlags,
  37. BSTR* pbstrXmlItems);
  38. typedef HRESULT (WINAPI * PFN_Download) (HIUENGINE hIUEngine,
  39. BSTR bstrXmlClientInfo,
  40. BSTR bstrXmlCatalog,
  41. BSTR bstrDestinationFolder,
  42. LONG lMode,
  43. IUnknown* punkProgressListener,
  44. HWND hWnd,
  45. BSTR* pbstrXmlItems);
  46. typedef HRESULT (WINAPI * PFN_DownloadAsync)(HIUENGINE hIUEngine,
  47. BSTR bstrXmlClientInfo,
  48. BSTR bstrXmlCatalog,
  49. BSTR bstrDestinationFolder,
  50. LONG lMode,
  51. IUnknown* punkProgressListener,
  52. HWND hWnd,
  53. BSTR bstrUuidOperation,
  54. BSTR* pbstrUuidOperation);
  55. typedef HRESULT (WINAPI * PFN_Install) (HIUENGINE hIUEngine,
  56. BSTR bstrXmlClientInfo,
  57. BSTR bstrXmlCatalog,
  58. BSTR bstrXmlDownloadedItems,
  59. LONG lMode,
  60. IUnknown* punkProgressListener,
  61. HWND hWnd,
  62. BSTR* pbstrXmlItems);
  63. typedef HRESULT (WINAPI * PFN_InstallAsync) (HIUENGINE hIUEngine,
  64. BSTR bstrXmlClientInfo,
  65. BSTR bstrXmlCatalog,
  66. BSTR bstrXmlDownloadedItems,
  67. LONG lMode,
  68. IUnknown* punkProgressListener,
  69. HWND hWnd,
  70. BSTR bstrUuidOperation,
  71. BSTR* pbstrUuidOperation);
  72. typedef HRESULT (WINAPI * PFN_SetOperationMode)(HIUENGINE hIUEngine,
  73. BSTR bstrUuidOperation,
  74. LONG lMode);
  75. typedef HRESULT (WINAPI * PFN_GetOperationMode)(HIUENGINE hIUEngine,
  76. BSTR bstrUuidOperation,
  77. LONG* plMode);
  78. typedef HRESULT (WINAPI * PFN_GetHistory)(HIUENGINE hIUEngine,
  79. BSTR bstrDateTimeFrom,
  80. BSTR bstrDateTimeTo,
  81. BSTR bstrClient,
  82. BSTR bstrPath,
  83. BSTR* pbstrLog);
  84. typedef HRESULT (WINAPI * PFN_BrowseForFolder)( HIUENGINE hIUEngine,
  85. BSTR bstrStartFolder,
  86. LONG flag,
  87. BSTR* pbstrFolder);
  88. typedef HRESULT (WINAPI * PFN_RebootMachine)(HIUENGINE hIUEngine);
  89. typedef void (WINAPI * PFN_ShutdownThreads) (void);
  90. typedef void (WINAPI * PFN_ShutdownGlobalThreads) (void);
  91. typedef HRESULT (WINAPI * PFN_CompleteSelfUpdateProcess)();
  92. typedef HIUENGINE (WINAPI * PFN_CreateEngUpdateInstance)();
  93. typedef void (WINAPI * PFN_DeleteEngUpdateInstance)(HIUENGINE hIUEngine);
  94. typedef HRESULT (WINAPI * PFN_PingIUEngineUpdateStatus)(
  95. PHANDLE phQuitEvents, // ptr to handles for cancelling the operation
  96. UINT nQuitEventCount, // number of handles
  97. LPCTSTR ptszLiveServerUrl,
  98. LPCTSTR ptszCorpServerUrl,
  99. DWORD dwError, // error code
  100. LPCTSTR ptszClientName); // client name string
  101. /////////////////////////////////////////////////////////////////////////////
  102. //
  103. // CDM typedefs
  104. //
  105. // used to delegate calls to engine (IUEngine.dll) from stub ([IU]cdm.dll)
  106. /////////////////////////////////////////////////////////////////////////////
  107. // DetFilesDownloaded
  108. typedef void (WINAPI * PFN_InternalDetFilesDownloaded)(
  109. IN HANDLE hConnection
  110. );
  111. // DownloadGetUpdatedFiles
  112. typedef BOOL (WINAPI * PFN_InternalDownloadGetUpdatedFiles)(
  113. IN PDOWNLOADINFOWIN98 pDownloadInfoWin98,
  114. IN OUT LPTSTR lpDownloadPath,
  115. IN UINT uSize
  116. );
  117. // DownloadUpdatedFiles
  118. typedef BOOL (WINAPI * PFN_InternalDownloadUpdatedFiles)(
  119. IN HANDLE hConnection,
  120. IN HWND hwnd,
  121. IN PDOWNLOADINFO pDownloadInfo,
  122. OUT LPWSTR lpDownloadPath,
  123. IN UINT uSize,
  124. OUT PUINT puRequiredSize
  125. );
  126. // FindMatchingDriver
  127. typedef BOOL (WINAPI * PFN_InternalFindMatchingDriver)(
  128. IN HANDLE hConnection,
  129. IN PDOWNLOADINFO pDownloadInfo,
  130. OUT PWUDRIVERINFO pWuDriverInfo
  131. );
  132. // LogDriverNotFound
  133. typedef void (WINAPI * PFN_InternalLogDriverNotFound)(
  134. IN HANDLE hConnection,
  135. IN LPCWSTR lpDeviceInstanceID,
  136. IN DWORD dwFlags
  137. );
  138. // QueryDetectionFiles
  139. typedef int (WINAPI * PFN_InternalQueryDetectionFiles)(
  140. IN HANDLE hConnection,
  141. IN void* pCallbackParam,
  142. IN PFN_QueryDetectionFilesCallback pCallback
  143. );
  144. // InternalSetGlobalOfflineFlag
  145. typedef void (WINAPI * PFN_InternalSetGlobalOfflineFlag)(
  146. IN BOOL fOfflineMode
  147. );
  148. /////////////////////////////////////////////////////////////////////////////
  149. //
  150. // Misc. typedefs
  151. //
  152. /////////////////////////////////////////////////////////////////////////////
  153. // DeleteExpiredDownloadFolders
  154. typedef void (WINAPI * PFN_AsyncExtraWorkUponEngineLoad)();
  155. /////////////////////////////////////////////////////////////////////////////
  156. // custom message ID defintions
  157. /////////////////////////////////////////////////////////////////////////////
  158. #define UM_EVENT_ITEMSTART WM_USER + 1001
  159. #define UM_EVENT_PROGRESS WM_USER + 1002
  160. #define UM_EVENT_COMPLETE WM_USER + 1003
  161. #define UM_EVENT_SELFUPDATE_COMPLETE WM_USER + 1004
  162. /////////////////////////////////////////////////////////////////////////////
  163. // event data structure definition
  164. /////////////////////////////////////////////////////////////////////////////
  165. typedef struct _EventData
  166. {
  167. BSTR bstrUuidOperation;
  168. VARIANT_BOOL fItemCompleted;
  169. BSTR bstrProgress;
  170. LONG lCommandRequest;
  171. BSTR bstrXmlData;
  172. HANDLE hevDoneWithMessage;
  173. } EventData, *pEventData;
  174. BOOL WUPostEventAndBlock(HWND hwnd, UINT Msg, EventData *pevtData);
  175. #endif //__IU_H_