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.

59 lines
2.2 KiB

  1. //---------------------------------------------------------------------------
  2. // RenderList.h - manages list of CRemderObj objects
  3. //---------------------------------------------------------------------------
  4. #pragma once
  5. //---------------------------------------------------------------------------
  6. #include "Render.h"
  7. //---------------------------------------------------------------------------
  8. class CUxThemeFile; // forward
  9. //---------------------------------------------------------------------------
  10. #define MAX_RETADDRS 10
  11. //---------------------------------------------------------------------------
  12. struct RENDER_OBJ_ENTRY
  13. {
  14. CRenderObj *pRenderObj;
  15. DWORD dwRecycleNum; // sequential number to validate handle against current obj
  16. //---- these control use/freeing of object ----
  17. int iRefCount; // number of HTHEME handles returned for this obj
  18. int iInUseCount; // number of active wrapper API calls for this obj
  19. int iLoadId; // load ID of associated theme file
  20. BOOL fClosing; // TRUE when we are forcing this object closed
  21. //---- for tracking foreign windows & debugging leaks ----
  22. HWND hwnd;
  23. };
  24. //---------------------------------------------------------------------------
  25. class CRenderList
  26. {
  27. //---- methods ----
  28. public:
  29. CRenderList();
  30. ~CRenderList();
  31. HRESULT OpenRenderObject(CUxThemeFile *pThemeFile, int iThemeOffset,
  32. int iClassNameOffset, CDrawBase *pDrawBase, CTextDraw *pTextObj, HWND hwnd,
  33. DWORD dwOtdFlags, HTHEME *phTheme);
  34. HRESULT CloseRenderObject(HTHEME hTheme);
  35. HRESULT OpenThemeHandle(HTHEME hTheme, CRenderObj **ppRenderObj, int *piSlotNum);
  36. void CloseThemeHandle(int iSlotNum);
  37. void FreeRenderObjects(int iThemeFileLoadId);
  38. #ifdef DEBUG
  39. void DumpFileHolders();
  40. #endif
  41. protected:
  42. //---- helper methods ----
  43. BOOL DeleteCheck(RENDER_OBJ_ENTRY *pEntry);
  44. //---- data ----
  45. protected:
  46. __int64 _iNextUniqueId;
  47. CSimpleArray<RENDER_OBJ_ENTRY> _RenderEntries;
  48. //---- lock for all methods of this object ----
  49. CRITICAL_SECTION _csListLock;
  50. };
  51. //---------------------------------------------------------------------------