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.

135 lines
3.5 KiB

  1. //=======================================================================
  2. //
  3. // Copyright (c) 1998-1999 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // File: cdmp.helper
  6. //
  7. // Owner: YanL
  8. //
  9. // Description:
  10. //
  11. // CDM internal header
  12. //
  13. //=======================================================================
  14. #ifndef _CDMP_H
  15. #define SZ_SECURITY_SERVER _T("http://windowsupdate.microsoft.com/v3content")
  16. #define REGKEY_WUV3TEST _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\wuv3test")
  17. #define MAX_INDEX_TO_SEARCH 100 //range to find unique file names for hardware_XXX.xml
  18. typedef enum tagSKU {
  19. SKU_NOT_SPECIFIED = 0,
  20. SKU_PERSONAL = 1,
  21. SKU_PROFESSIONAL = 2,
  22. SKU_SERVER = 3,
  23. SKU_ADVANCED_SERVER = 4,
  24. SKU_DATACENTER_SERVER = 5
  25. } enumSKU;
  26. const LPCTSTR SKU_STRINGS[]={
  27. _T("Unknown"),
  28. _T("Personal"),
  29. _T("Professional"),
  30. _T("Server"),
  31. _T("AdvancedServer"),
  32. _T("DataCenter")
  33. };
  34. //17 is the length of string "DataCenterServer" + 1
  35. const int SKU_STRING_MIN_LENGTH = 17 * sizeof(TCHAR);
  36. const int SKU_STRING_MAX_LENGTH = 100;
  37. struct SHelper
  38. {
  39. CDownload download;
  40. CDiamond diamond;
  41. OSVERSIONINFO OSVersionInfo; // current OSVERSIONINFO from GetVersionEx()
  42. DWORD dwArchitecture; // Specifies the system's processor architecture.
  43. DWORD dwLangID;
  44. enumV3Platform enPlatform;
  45. PUID puid;
  46. PUID puidCatalog;
  47. vector<PUID> apuidExclude;
  48. byte_buffer bufBucket; // we need to keep it to have information in DRIVER_MATCH_INFO valid
  49. DRIVER_MATCH_INFO DriverMatchInfo;
  50. };
  51. #pragma pack()
  52. // called by DownloadIsInternetAvailable()
  53. int GetDUNConnections(void);
  54. bool IsInternetConnectionWizardCompleted(void);
  55. bool IsInternetConnected(void);
  56. // called by DownloadGetUpdatedFiles()
  57. bool FindDevInstID(IN LPCSTR szHardwareID, string& sDevInstID);
  58. // called by RealDownloadGetUpdatedFiles()
  59. bool IsWindowsNT(void);
  60. // called by OpenCDMContext()
  61. bool ProcessIdent(IN CDownload& download, IN CDiamond& diamond,
  62. IN LPCTSTR szSecurityServerCur, OUT LPTSTR szSiteServer, OUT LPTSTR szDownloadServer);
  63. bool DownloadCdmCab(IN CDownload& download, IN CDiamond& diamond, OUT bool& fNeedUpdate);
  64. // called by DownloadUpdatedFiles()
  65. int GetDownloadPath(OUT LPTSTR szPath);
  66. void GetWindowsUpdateDirectory(IN LPTSTR szDir);
  67. HINSTANCE LoadCdmnewDll();
  68. // called by GetPackage()
  69. DWORD PrepareCatalog(IN LPCTSTR pszSiteServer, IN OUT SHelper& helper);
  70. DWORD ProcessOsdet(IN OUT SHelper& helper);
  71. bool BuildExclusionsList(IN SHelper& helper);
  72. bool FindCatalog(IN OUT SHelper& helper);
  73. bool FindUpdate(
  74. IN PDOWNLOADINFO pDownLoadInfo,
  75. IN OUT SHelper& helper,
  76. IN OUT byte_buffer& bufBucket
  77. );
  78. bool DeleteNode(LPCTSTR szDir);
  79. // called by InternalQueryDetectionFiles()
  80. bool DownloadToBuffer(IN SHelper& helper, IN LPCTSTR szPath, OUT byte_buffer& bufOut);
  81. #define URLPING_FAILED _T("DLOAD_FAILURE")
  82. #define URLPING_SUCCESS _T("DLOAD_SUCCESS")
  83. void URLPingReport(IN SHelper& helper, IN LPCTSTR pszStatus);
  84. // called by DllMain
  85. bool UpdateCdmDll();
  86. //called by InternalLogDriverNotFound()
  87. HRESULT GetUniqueFileName(
  88. IN LPTSTR tszDirPath,
  89. IN LPTSTR lpBuffer,
  90. IN DWORD dwSize,
  91. OUT HANDLE &hFile
  92. );
  93. HRESULT GetSKUString(
  94. IN LPTSTR lpSKUBuffer,
  95. IN DWORD dwSize
  96. );
  97. DWORD ProcessOsdetOffline(
  98. IN OUT SHelper& helper
  99. );
  100. HRESULT CdmCanonicalizeUrl(
  101. IN LPCTSTR lpszUrl,
  102. OUT tchar_buffer &tchBuf,
  103. IN DWORD dwLen,
  104. IN DWORD dwFlags
  105. );
  106. #define _CDMP_H
  107. #endif