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.

50 lines
1.8 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: ThemeSection.h
  3. //
  4. // Copyright (c) 2000, Microsoft Corporation
  5. //
  6. // Class that wraps CUxThemeFile. CUxThemeFile automatically closes the section
  7. // member variable handle. This makes usage of the class difficult because
  8. // it doesn't duplicate the handle but it takes ownership. It does declare
  9. // the handle as a PUBLIC member variable so we capitalize on this poor
  10. // design. This class wraps CUxThemeFile to make the life of users of this
  11. // class easier by not having them worry about closing the handles or not.
  12. // When you use this class the handle is NOT closed.
  13. //
  14. // History: 2000-11-22 vtan created
  15. // --------------------------------------------------------------------------
  16. #ifndef _ThemeSection_
  17. #define _ThemeSection_
  18. #include "ThemeFile.h"
  19. // --------------------------------------------------------------------------
  20. // CThemeSection
  21. //
  22. // Purpose: Class that wraps CUxThemeFile and doesn't release the handle on
  23. // closure.
  24. //
  25. // History: 2000-11-22 vtan created
  26. // --------------------------------------------------------------------------
  27. class CThemeSection
  28. {
  29. public:
  30. CThemeSection (void);
  31. ~CThemeSection (void);
  32. operator CUxThemeFile* (void);
  33. HRESULT Open (HANDLE hSection, DWORD dwViewAccess = FILE_MAP_READ);
  34. HRESULT ValidateData (bool fFullCheck);
  35. HRESULT CreateFromSection (HANDLE hSection);
  36. HANDLE Get (void) const;
  37. PVOID GetData(void);
  38. private:
  39. CUxThemeFile _themeFile;
  40. };
  41. #endif /* _ThemeSection_ */