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.

87 lines
2.8 KiB

  1. //+-------------------------------------------------------------------------
  2. // Microsoft OLE
  3. // Copyright (C) Microsoft Corporation, 1994 - 1995.
  4. //
  5. // File: creghelp.hxx
  6. //
  7. // Contents: Declaration & macros for the CRegistryHelp class.
  8. //
  9. // Classes: CRegistryHelp
  10. //
  11. // History: 20-Oct-93 XimingZ Created
  12. // 23-Nov-94 DeanE Modified for more general use.
  13. //--------------------------------------------------------------------------
  14. #ifndef __CREGHELP_HXX__
  15. #define __CREGHELP_HXX__
  16. //+-------------------------------------------------------------------
  17. // Class: CRegistryHelp
  18. //
  19. // Purpose: Registry access wrapper. Designed to be used with a
  20. // "known" registry key structure. It could be modified
  21. // to deal with enumerating subkeys or values and using
  22. // them, too.
  23. //
  24. // History: 20-Oct-93 XimingZ Created
  25. //--------------------------------------------------------------------
  26. class CRegistryHelp
  27. {
  28. public:
  29. CRegistryHelp(HKEY hKey,
  30. LPTSTR pszSubKey,
  31. DWORD fOptions,
  32. REGSAM samKey,
  33. HRESULT *phr);
  34. ~CRegistryHelp(VOID);
  35. HRESULT GetValue(LPTSTR pszSubKey,
  36. LPTSTR pszValue,
  37. LPBYTE pbBuffer,
  38. LPDWORD pcbBuffer,
  39. LPDWORD pdwType);
  40. HRESULT GetValueDword(LPTSTR pszSubKey,
  41. LPTSTR pszValue,
  42. LPDWORD pdwData,
  43. DWORD fExpectedType);
  44. HRESULT GetValueString(LPTSTR pszSubKey,
  45. LPTSTR pszValue,
  46. LPTSTR pszData,
  47. LPDWORD pcbData,
  48. DWORD fExpectedType);
  49. HRESULT SetValue(LPTSTR pszSubKey,
  50. LPTSTR pszValue,
  51. LPBYTE pbData,
  52. DWORD cbData,
  53. DWORD fType);
  54. HRESULT SetValueDword(LPTSTR pszSubKey,
  55. LPTSTR pszValue,
  56. DWORD dwData,
  57. DWORD fType);
  58. HRESULT SetValueString(LPTSTR pszSubKey,
  59. LPTSTR pszValue,
  60. LPTSTR pszData,
  61. DWORD cbData,
  62. DWORD fType);
  63. HRESULT DeleteValue(LPTSTR pszSubKey, LPTSTR pszValue);
  64. HRESULT DeleteSubKey(LPTSTR pszSubKey);
  65. protected:
  66. LPTSTR _pszSubKey; // Subkey name
  67. private:
  68. HKEY _hKey; // Handle to root key
  69. HKEY _hSubKey; // Handle to subkey
  70. BOOL _fOptions; // Special key options
  71. };
  72. #endif // __CREGHELP_HXX__
  73.