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.

81 lines
3.6 KiB

  1. #ifndef __SELFUPD_H_
  2. #define __SELFUPD_H_
  3. #include <wincrypt.h>
  4. #include <mscat.h>
  5. #include <wininet.h>
  6. #include <iucommon.h>
  7. #include <urllogging.h>
  8. const DWORD SELFUPDATE_NONE = 0;
  9. const DWORD SELFUPDATE_IN_PROGRESS = 1;
  10. const DWORD SELFUPDATE_COMPLETE_UPDATE_BINARY_REQUIRED = 2;
  11. const TCHAR IU_MUTEX_SELFUPDATE_REGCHECK[] = _T("{14649649-37d9-4cd4-aaaf-f066bc0c0b47}");
  12. const TCHAR IU_EVENT_SELFUPDATE_IN_PROGRESS[] = _T("{a6c7e065-cca9-44e6-a951-ae4327845fe0}");
  13. const TCHAR IU_EVENT_SELFUPDATE_EVENT_SYNC[] = _T("{ed3ce20f-8479-4c1a-85ae-7a58ad6dc83e}");
  14. #if defined(__WUIUTEST)
  15. const TCHAR WU_SERVER_URL[] = _T("http://iudev/");
  16. #else
  17. const TCHAR WU_SERVER_URL[] = _T("http://windowsupdate.microsoft.com/v4/");
  18. #endif
  19. const TCHAR IDENT_VERSION[] = _T("Version");
  20. const TCHAR IDENT_IUSELFUPDATE[] = _T("IUSelfUpdate");
  21. const TCHAR IDENT_IUBETASELFUPDATE[] = _T("IUBetaSelfUpdate");
  22. const TCHAR REGKEY_IDENT_SERV[] = _T("IdentServer");
  23. const TCHAR REGKEY_IUCTL[] = _T("Software\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\IUControl");
  24. const TCHAR REGVAL_SELFUPDATESTATUS[] = _T("SelfUpdateStatus");
  25. const TCHAR REGVAL_SELFUPDATEVERSION[] = _T("SelfUpdateVersion");
  26. const TCHAR REGVAL_BETASELFUPDATE[] = _T("BetaSelfUpdate");
  27. const TCHAR IUCTL[] = _T("iuctl.dll");
  28. const TCHAR ENGINEDLL[] = _T("iuengine.dll");
  29. const TCHAR ENGINENEWDLL[] = _T("iuenginenew.dll");
  30. const TCHAR ENGINECAB[] = _T("iuengine.cab");
  31. const TCHAR RUNDLL32[] = _T("rundll32.exe");
  32. const TCHAR RUNDLLCOMMANDLINE[] = _T(",BeginSelfUpdate");
  33. // MSCAT32 support (CryptCAT API's)
  34. const TCHAR MSCAT32DLL[] = _T("mscat32.dll");
  35. // CryptCat Function Pointer Types
  36. typedef BOOL (*PFN_CryptCATAdminAcquireContext)(OUT HCATADMIN *phCatAdmin,
  37. IN const GUID *pgSubsystem,
  38. IN DWORD dwFlags);
  39. typedef HCATINFO (*PFN_CryptCATAdminAddCatalog)(IN HCATADMIN hCatAdmin,
  40. IN WCHAR *pwszCatalogFile,
  41. IN OPTIONAL WCHAR *pwszSelectBaseName,
  42. IN DWORD dwFlags);
  43. typedef BOOL (*PFN_CryptCATCatalogInfoFromContext)(IN HCATINFO hCatInfo,
  44. IN OUT CATALOG_INFO *psCatInfo,
  45. IN DWORD dwFlags);
  46. typedef BOOL (*PFN_CryptCATAdminReleaseCatalogContext)(IN HCATADMIN hCatAdmin,
  47. IN HCATINFO hCatInfo,
  48. IN DWORD dwFlags);
  49. typedef BOOL (*PFN_CryptCATAdminReleaseContext)(IN HCATADMIN hCatAdmin,
  50. IN DWORD dwFlags);
  51. // Determines if a selfupdate is needed, or is already in process. If a selfupdate is needed it will trigger
  52. // RunDll32 to instantiate a second instance of the control and have it call the BeginSelfUpdate() entrypoint.
  53. class CUpdate;
  54. HRESULT SelfUpdateCheck(BOOL fSynch, BOOL fStartUpdate, HANDLE evtQuit, CUpdate* pUpdateComClass, IUnknown* punkUpdateCompleteListener);
  55. // EntryPointCalled by RunDll32.exe to actually do the selfupdate process.
  56. HRESULT BeginSelfUpdate();
  57. HRESULT PingEngineUpdate(
  58. HMODULE hEngineModule,
  59. PHANDLE phQuitEvents,
  60. UINT nQuitEventCount,
  61. LPCTSTR ptszLiveServerUrl,
  62. LPCTSTR ptszCorpServerUrl,
  63. DWORD dwError,
  64. LPCTSTR ptszClientName = NULL);
  65. // this function wraps up DownloadIUIdent() and CIUUrlAgent::PopulateData(), since we use it
  66. // in both selfupd.cpp and loadengine.cpp.
  67. HRESULT DownloadIUIdent_PopulateData();
  68. #endif //__SELFUPD_H_