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.

110 lines
2.4 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1999 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // RegistryValueName.h
  7. //
  8. // Implementation File:
  9. // RegistryValueName.cpp
  10. //
  11. // Description:
  12. // Definition of the CRegistryValueName class.
  13. //
  14. // Author:
  15. // Vijayendra Vasu (vvasu) February 5, 1999
  16. //
  17. // Revision History:
  18. // None.
  19. //
  20. /////////////////////////////////////////////////////////////////////////////
  21. #ifndef __REGISTRYVALUENAME_H__
  22. #define __REGISTRYVALUENAME_H__
  23. /////////////////////////////////////////////////////////////////////////////
  24. //++
  25. //
  26. // Class CRegistryValueName
  27. //
  28. // When initialized, this class takes as input the Name and KeyName
  29. // fields of a property table item. It then initializes its member
  30. // variables m_pszName and m_pszKeyName as follows.
  31. //
  32. // m_pszName contains all the characters of Name after the last backslash
  33. // character.
  34. // To m_pszKeyName is appended all the characters of Name upto (but not
  35. // including) the last backslash character.
  36. //
  37. // For example: If Name is "Groups\AdminExtensions" and KeyName is NULL,
  38. // m_pszKeyName will be "Groups" and m_pszName will be "AdminExtensions"
  39. //
  40. // The allocated memory is automatically freed during the destruction of
  41. // the CRegistryValueName object.
  42. //
  43. //--
  44. /////////////////////////////////////////////////////////////////////////////
  45. class CRegistryValueName
  46. {
  47. private:
  48. LPCWSTR m_pszName;
  49. LPCWSTR m_pszKeyName;
  50. DWORD m_cbNameBufferSize;
  51. DWORD m_cbKeyNameBufferSize;
  52. // Disallow copying.
  53. const CRegistryValueName & operator =( const CRegistryValueName & rhs );
  54. CRegistryValueName( const CRegistryValueName & source );
  55. public:
  56. //
  57. // Construction.
  58. //
  59. // Default constructor
  60. CRegistryValueName( void )
  61. : m_pszName( NULL )
  62. , m_pszKeyName( NULL )
  63. , m_cbNameBufferSize( 0 )
  64. , m_cbKeyNameBufferSize( 0 )
  65. {
  66. } //*** CRegistryValueName()
  67. // Destructor
  68. ~CRegistryValueName( void )
  69. {
  70. FreeBuffers();
  71. } //*** ~CRegistryValueName()
  72. //
  73. // Initialization and deinitialization routines.
  74. //
  75. // Initialize the object
  76. DWORD ScInit( LPCWSTR pszOldName, LPCWSTR pszOldKeyName );
  77. // Deallocate buffers
  78. void FreeBuffers( void );
  79. public:
  80. //
  81. // Access methods.
  82. //
  83. LPCWSTR PszName( void ) const
  84. {
  85. return m_pszName;
  86. } //*** PszName()
  87. LPCWSTR PszKeyName( void ) const
  88. {
  89. return m_pszKeyName;
  90. } //*** PszKeyName()
  91. }; //*** class CRegistryValueName
  92. #endif // __REGISTRYVALUENAME_H__