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.

74 lines
2.2 KiB

  1. #ifndef __PolData_h__
  2. #define __PolData_h__
  3. ////////////////////////////////////////////////////////////////////////////////////////////////////
  4. #pragma warning( disable : 4786 )
  5. #include <string>
  6. #include <list>
  7. ////////////////////////////////////////////////////////////////////////////////////////////////////
  8. class CPolicyData {
  9. public: // Static Fns
  10. static void FlushCachedInfData( HANDLE hFile );
  11. private:// Static Fns
  12. static std::list< std::string > ms_CachedInfData;
  13. public: // Datatypes
  14. enum eValueType {
  15. ValueType_BinaryAsString,
  16. ValueType_String,
  17. ValueType_DWORD,
  18. ValueType_Delete, // This will delete the value name entry in the registry
  19. ValueType_NotInitialized
  20. };
  21. public:
  22. enum eKeyType { eKeyType_HKEY_CURRENT_USER,
  23. eKeyType_HKEY_LOCAL_MACHINE,
  24. eKeyType_INVALID
  25. };
  26. class OpDelete { ; }; // Symbol class to signify deleting a registry value entry
  27. private: // Data
  28. eKeyType m_KeyType;
  29. char *m_szKeyName;
  30. char *m_szValueName;
  31. eValueType m_ValueType;
  32. union {
  33. char* m_szVal;
  34. DWORD m_dwVal;
  35. };
  36. public: // Construction / destruction
  37. CPolicyData( eKeyType KeyType, const char* szKeyName, const char* szValueName, DWORD dwVal );
  38. CPolicyData( eKeyType KeyType, const char* szKeyName, const char* szValueName, const char* szVal );
  39. CPolicyData( eValueType ValType, eKeyType KeyType, const char* szKeyName, const char* szValueName, const char* szVal );
  40. CPolicyData( eKeyType KeyType, const char* szKeyName, const char* szValueName, const OpDelete& r );
  41. CPolicyData( const CPolicyData& r );
  42. ~CPolicyData( void );
  43. public: // Member Fns
  44. CPolicyData& operator=( const CPolicyData& r );
  45. BOOL SaveToREGFile( HANDLE hFile );
  46. BOOL SaveToINFFile( HANDLE hFile );
  47. private: // Helper Fns
  48. void _KillHeapData( void );
  49. private: // Unused, declared to make sure compiler does not make a default and mess us up...
  50. CPolicyData( void );
  51. };
  52. #endif // __PolData_h__