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.7 KiB

  1. //=======================================================================
  2. //
  3. // Copyright (c) 2001 Microsoft Corporation. All Rights Reserved.
  4. //
  5. // File: criticalfixreg.h
  6. //
  7. // Creator: PeterWi
  8. //
  9. // Purpose: AU registry related functions.
  10. //
  11. //=======================================================================
  12. #pragma once
  13. extern const TCHAR AUREGKEY_HKLM_DOMAIN_POLICY[]; // = _T("Software\\Policies\\Microsoft\\Windows\\WindowsUpdate\\AU");
  14. extern const TCHAR AUREGKEY_HKLM_WINDOWSUPDATE_POLICY[]; // = _T("Software\\Policies\\Microsoft\\Windows\\WindowsUpdate");
  15. extern const TCHAR AUREGKEY_HKLM_IUCONTROL_POLICY[]; // = _T("Software\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\IUControl");
  16. extern const TCHAR AUREGKEY_HKLM_SYSTEM_WAS_RESTORED[]; // = _T("Software\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update\\SystemWasRestored");
  17. extern const TCHAR AUREGKEY_HKLM_ADMIN_POLICY[] ; // = _T("Software\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate\\Auto Update");
  18. extern const TCHAR AUREGKEY_HKCU_USER_POLICY[]; // = _T("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\WindowsUpdate");
  19. extern const TCHAR AUREGVALUE_DISABLE_WINDOWS_UPDATE_ACCESS[]; // = _T("DisableWindowsUpdateAccess");
  20. ////////////////////////////////////////////////////////////////////////////
  21. //
  22. // Public Function GetRegStringValue()
  23. // Read the registry value of timestamp for last detection
  24. // Input: Name of value, value, and size of value
  25. // Output: SYSTEMTIME structure contains the time
  26. // Return: HRESULT flag indicating the success of this function
  27. //
  28. ////////////////////////////////////////////////////////////////////////////
  29. HRESULT GetRegStringValue(LPCTSTR lpszValueName, LPTSTR lpszBuffer, int nCharCount, LPCTSTR lpszSubKeyName = AUREGKEY_HKLM_ADMIN_POLICY);
  30. ////////////////////////////////////////////////////////////////////////////
  31. //
  32. // Public Function SetRegStringValue()
  33. // Set the registry value of timestamp as current system local time
  34. // Input: name of the value to set. and value,
  35. //
  36. // Output: None
  37. // Return: HRESULT flag indicating the success of this function
  38. //
  39. ////////////////////////////////////////////////////////////////////////////
  40. HRESULT SetRegStringValue(LPCTSTR lpszValueName, LPCTSTR lpszNewValue, LPCTSTR lpszSubKeyName = AUREGKEY_HKLM_ADMIN_POLICY);
  41. ////////////////////////////////////////////////////////////////////////////
  42. //
  43. // Public Function DeleteRegValue()
  44. // Delete the registry value entry
  45. // Input: name of the value to entry,
  46. // Output: None
  47. // Return: HRESULT flag indicating the success of this function
  48. //
  49. ////////////////////////////////////////////////////////////////////////////
  50. HRESULT DeleteRegValue(LPCTSTR lpszValueName);
  51. ////////////////////////////////////////////////////////////////////////////
  52. //
  53. // Public Function GetRegDWordValue()
  54. // Get a DWORD from specified regustry value name
  55. // Input: name of the value to retrieve value
  56. // Output: pointer to the retrieved value
  57. // Return: HRESULT flag indicating the success of this function
  58. //
  59. ////////////////////////////////////////////////////////////////////////////
  60. HRESULT GetRegDWordValue(LPCTSTR lpszValueName, LPDWORD pdwValue, LPCTSTR lpszSubKeyName = AUREGKEY_HKLM_ADMIN_POLICY);
  61. ////////////////////////////////////////////////////////////////////////////
  62. //
  63. // Public Function SetRegDWordValue()
  64. // Set the registry value as a DWORD
  65. // Input: name of the value to set. value to set
  66. // Output: None
  67. // Return: HRESULT flag indicating the success of this function
  68. //
  69. ////////////////////////////////////////////////////////////////////////////
  70. HRESULT SetRegDWordValue(LPCTSTR lpszValueName, DWORD dwValue, DWORD options = REG_OPTION_NON_VOLATILE, LPCTSTR lpszSubKeyName = AUREGKEY_HKLM_ADMIN_POLICY);