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.

172 lines
3.7 KiB

  1. //=======================================================================
  2. //
  3. // Copyright (C) Microsoft Corporation, 1998 - 1999 All Rights Reserved.
  4. //
  5. // File: CWUpd.cpp : Implementation of CCWUpdInfo
  6. //
  7. //=======================================================================
  8. #include "stdafx.h"
  9. #include "WUpdInfo.h"
  10. #include "CWUpd.h"
  11. #include "cruntime.h"
  12. #include "sysinfo.h"
  13. #include "shellapi.h"
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CCWUpdInfo
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CCWUpdInfo::GetWinUpdURL
  18. // Get the URL to Windows Update. This could be the local or remote URL.
  19. //
  20. // Parameters:
  21. //
  22. // Comments :
  23. /////////////////////////////////////////////////////////////////////////////
  24. STDMETHODIMP CCWUpdInfo::GetWinUpdURL(/*[out, retval]*/ BSTR *pbstrURL)
  25. {
  26. return E_NOTIMPL;
  27. }
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CCWUpdInfo::IsDisabled
  30. // Indicates whether the administrator has disabled Windows Update.
  31. //
  32. // Parameters:
  33. //
  34. // Comments :
  35. /////////////////////////////////////////////////////////////////////////////
  36. STDMETHODIMP CCWUpdInfo::IsDisabled(BOOL * pfDisabled)
  37. {
  38. *pfDisabled = FWinUpdDisabled() ? TRUE : FALSE;
  39. return S_OK;
  40. }
  41. /////////////////////////////////////////////////////////////////////////////
  42. // FGetOEMURL
  43. // Get the OEM ULR from oeminfo.ini.
  44. //
  45. // Parameters:
  46. //
  47. // Comments :
  48. /////////////////////////////////////////////////////////////////////////////
  49. bool FGetOEMURL(LPTSTR tszKey, LPTSTR tszURL)
  50. {
  51. bool fFound = false;
  52. TCHAR tszLocalFile[MAX_PATH];
  53. TCHAR tszOEMINFOPath[MAX_PATH];
  54. if ( GetSystemDirectory(tszOEMINFOPath,
  55. MAX_PATH) != 0 )
  56. {
  57. lstrcat(tszOEMINFOPath, _T("\\oeminfo.ini"));
  58. DWORD dwGetPrivateProfileString = ::GetPrivateProfileString(
  59. _T("General"),
  60. tszKey,
  61. _T(""),
  62. tszLocalFile,
  63. MAX_PATH,
  64. tszOEMINFOPath);
  65. if ( lstrcmp(tszLocalFile, _T("")) != 0 )
  66. {
  67. lstrcpy(tszURL, tszLocalFile);
  68. fFound = true;
  69. }
  70. }
  71. return fFound;
  72. }
  73. /////////////////////////////////////////////////////////////////////////////
  74. // CCWUpdInfo::GotoMTSURL
  75. // Launch the default browser to display the MTS URL.
  76. //
  77. // Parameters:
  78. //
  79. // Comments :
  80. /////////////////////////////////////////////////////////////////////////////
  81. STDMETHODIMP CCWUpdInfo::GotoMTSURL(BSTR bstrURLArgs) // prd= arg for redir.dll
  82. {
  83. return E_NOTIMPL;
  84. }
  85. /////////////////////////////////////////////////////////////////////////////
  86. // CCWUpdInfo::GotoMTSOEMURL
  87. // Launch the default browser to display the MTS URL.
  88. //
  89. // Parameters:
  90. //
  91. // Comments :
  92. /////////////////////////////////////////////////////////////////////////////
  93. STDMETHODIMP CCWUpdInfo::GotoMTSOEMURL(int * pnRetval)
  94. {
  95. return E_NOTIMPL;
  96. }
  97. STDMETHODIMP CCWUpdInfo::GetMTSURL(BSTR bstrURLArgs,
  98. /*[out, retval]*/ BSTR *pbstrURL)
  99. {
  100. return E_NOTIMPL;
  101. }
  102. STDMETHODIMP CCWUpdInfo::GetMTSOEMURL(/*[out, retval]*/ BSTR *pbstrURL)
  103. {
  104. USES_CONVERSION;
  105. TCHAR tszURL[MAX_PATH];
  106. if ( !FGetOEMURL(_T("SupportURL"), tszURL) )
  107. {
  108. tszURL[0] = _T('\0');
  109. }
  110. *pbstrURL = SysAllocString(T2W(tszURL));
  111. return S_OK;
  112. }
  113. STDMETHODIMP CCWUpdInfo::GetMachineLanguage(BSTR * pbstrMachineLanguage)
  114. {
  115. return E_NOTIMPL;
  116. }
  117. STDMETHODIMP CCWUpdInfo::GetUserLanguage(BSTR * pbstrUserLanguage)
  118. {
  119. return E_NOTIMPL;
  120. }
  121. STDMETHODIMP CCWUpdInfo::GetLanguage(BSTR * pbstrLanguage)
  122. {
  123. return E_NOTIMPL;
  124. }
  125. STDMETHODIMP CCWUpdInfo::GetPlatform(BSTR * pbstrPlatform)
  126. {
  127. return E_NOTIMPL;
  128. }
  129. STDMETHODIMP CCWUpdInfo::IsRegistered(VARIANT_BOOL * pfRegistered)
  130. {
  131. return E_NOTIMPL;
  132. }
  133. STDMETHODIMP CCWUpdInfo::IsConnected(VARIANT_BOOL * pfConnected)
  134. {
  135. return E_NOTIMPL;
  136. }