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.

107 lines
2.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996.
  5. //
  6. // registry.hxx
  7. //
  8. //--------------------------------------------------------------------------
  9. #ifndef __REGISTRY_HXX__
  10. #define __REGISTRY_HXX__
  11. #define REGNOTFOUND( Status ) ((ERROR_FILE_NOT_FOUND == Status) || \
  12. (ERROR_BAD_PATHNAME == Status))
  13. #define APP_PATH L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\"
  14. #define APP_PATH_LEN (sizeof( APP_PATH ) - sizeof( WCHAR )) / sizeof( WCHAR )
  15. extern HKEY ghClsidMachine;
  16. extern HKEY ghAppidMachine;
  17. extern BOOL gbEnableRemoteLaunch;
  18. extern BOOL gbEnableRemoteConnect;
  19. #ifdef SERVER_HANDLER
  20. extern BOOL gbDisableEmbeddingServerHandler;
  21. #endif
  22. extern DWORD gdwRemoteBindingHandleCacheMaxSize;
  23. extern DWORD gdwRemoteBindingHandleCacheMaxLifetime;
  24. extern DWORD gdwRemoteBindingHandleCacheIdleTimeout;
  25. extern BOOL gbSAFERROTChecksEnabled;
  26. extern BOOL gbSAFERAAAChecksEnabled;
  27. extern BOOL gbDynamicIPChangesEnabled;
  28. DWORD
  29. ReadStringValue(
  30. IN HKEY hKey,
  31. IN WCHAR * pwszValueName,
  32. OUT WCHAR ** ppwszString
  33. );
  34. DWORD
  35. ReadStringKeyValue(
  36. IN HKEY hKey,
  37. IN WCHAR * pwszKeyName,
  38. OUT WCHAR ** ppwszString
  39. );
  40. DWORD
  41. ReadSecurityDescriptor(
  42. IN HKEY hKey,
  43. IN WCHAR * pwszValue,
  44. OUT CSecDescriptor ** ppSD
  45. );
  46. LONG
  47. OpenClassesRootKeys();
  48. HRESULT
  49. InitSCMRegistry();
  50. void
  51. ReadRemoteActivationKeys();
  52. void
  53. ReadRemoteBindingHandleCacheKeys();
  54. void
  55. ReadSAFERKeys();
  56. void
  57. ReadDynamicIPChangesKeys();
  58. DWORD
  59. GetActivationFailureLoggingLevel();
  60. //
  61. // Class that can be used to set up notification of registry key
  62. // changes.
  63. //
  64. class CRegistryWatcher
  65. {
  66. public:
  67. CRegistryWatcher(HKEY hKeyRoot, const WCHAR *wszSubKey);
  68. ~CRegistryWatcher() { Cleanup(); }
  69. // Returns S_OK if changed, S_FALSE if not, and an error if something failed.
  70. HRESULT Changed();
  71. private:
  72. void Cleanup();
  73. HKEY _hWatchedKey;
  74. BOOL _fValid;
  75. HANDLE _hEvent;
  76. };
  77. #endif // __REGISTRY_HXX__