Leaked source code of windows server 2003
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.

98 lines
2.1 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. #ifdef SERVER_HANDLER
  16. extern BOOL gbDisableEmbeddingServerHandler;
  17. #endif
  18. extern DWORD gdwRemoteBindingHandleCacheMaxSize;
  19. extern DWORD gdwRemoteBindingHandleCacheMaxLifetime;
  20. extern DWORD gdwRemoteBindingHandleCacheIdleTimeout;
  21. extern BOOL gbSAFERROTChecksEnabled;
  22. extern BOOL gbSAFERAAAChecksEnabled;
  23. extern BOOL gbDynamicIPChangesEnabled;
  24. DWORD
  25. ReadStringValue(
  26. IN HKEY hKey,
  27. IN WCHAR * pwszValueName,
  28. OUT WCHAR ** ppwszString
  29. );
  30. DWORD
  31. ReadStringKeyValue(
  32. IN HKEY hKey,
  33. IN WCHAR * pwszKeyName,
  34. OUT WCHAR ** ppwszString
  35. );
  36. DWORD
  37. ReadSecurityDescriptor(
  38. IN HKEY hKey,
  39. IN WCHAR * pwszValue,
  40. OUT CSecDescriptor ** ppSD
  41. );
  42. HRESULT
  43. InitSCMRegistry();
  44. void
  45. ReadRemoteActivationKeys();
  46. void
  47. ReadRemoteBindingHandleCacheKeys();
  48. void
  49. ReadSAFERKeys();
  50. void
  51. ReadDynamicIPChangesKeys();
  52. DWORD
  53. GetActivationFailureLoggingLevel();
  54. //
  55. // Class that can be used to set up notification of registry key
  56. // changes.
  57. //
  58. class CRegistryWatcher
  59. {
  60. public:
  61. CRegistryWatcher(HKEY hKeyRoot, const WCHAR *wszSubKey);
  62. ~CRegistryWatcher() { Cleanup(); }
  63. // Returns S_OK if changed, S_FALSE if not, and an error if something failed.
  64. HRESULT Changed();
  65. private:
  66. void Cleanup();
  67. HKEY _hWatchedKey;
  68. BOOL _fValid;
  69. HANDLE _hEvent;
  70. };
  71. #endif // __REGISTRY_HXX__