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.

59 lines
1.3 KiB

  1. //=============================================================================
  2. // The CResourceMap class is useful for several data categories. It contains
  3. // a map of the Win32_PnPAllocatedResource class.
  4. //=============================================================================
  5. #pragma once
  6. #include "category.h"
  7. #include "dataset.h"
  8. #include "wmiabstraction.h"
  9. class CResourceMap
  10. {
  11. public:
  12. CResourceMap();
  13. ~CResourceMap();
  14. HRESULT Initialize(CWMIHelper * pWMIHelper);
  15. CStringList * Lookup(const CString & strKey);
  16. DWORD m_dwInitTime;
  17. CMapStringToOb m_map;
  18. HRESULT m_hr;
  19. private:
  20. void Empty();
  21. };
  22. // The container is a nice way to ensure that we only have one resource map around.
  23. // But it's a pain when we're remoting, so we aren't using it now:
  24. /*
  25. class CResourceMapContainer
  26. {
  27. public:
  28. CResourceMapContainer() : m_pMap(NULL) {};
  29. ~CResourceMapContainer() { if (m_pMap) delete m_pMap; };
  30. CResourceMap * GetResourceMap(CWMIHelper * pWMI)
  31. {
  32. if (m_pMap == NULL)
  33. {
  34. m_pMap = new CResourceMap;
  35. if (m_pMap)
  36. m_pMap->Initialize(pWMI);
  37. }
  38. return m_pMap;
  39. };
  40. private:
  41. CResourceMap * m_pMap;
  42. };
  43. */
  44. // If we were using the resource map container - these would be uncommented:
  45. //
  46. // extern CResourceMapContainer gResourceMap;
  47. // CResourceMapContainer gResourceMap;