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.

83 lines
2.7 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1999-2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // ObjectManager.h
  7. //
  8. // Description:
  9. // Data Manager implementation.
  10. //
  11. // Maintained By:
  12. // Galen Barbee (GalenB) 22-NOV-1999
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. #pragma once
  16. class CStandardInfo;
  17. // CObjectManager
  18. class
  19. CObjectManager:
  20. public IObjectManager
  21. {
  22. private:
  23. // IUnknown
  24. LONG m_cRef;
  25. // data
  26. ULONG m_cAllocSize; // Size of the cookie array.
  27. ULONG m_cCurrentUsed; // Current count used in the cookie array.
  28. CStandardInfo ** m_pCookies; // Cookie array (note: zero-th element is not used)
  29. private: // Methods
  30. CObjectManager( void );
  31. ~CObjectManager( void );
  32. STDMETHOD(Init)( void );
  33. HRESULT
  34. HrSearchForExistingCookie( REFCLSID rclsidTypeIn,
  35. OBJECTCOOKIE cookieParentIn,
  36. LPCWSTR pcszNameIn,
  37. OBJECTCOOKIE * pcookieOut
  38. );
  39. HRESULT
  40. HrDeleteCookie( OBJECTCOOKIE cookieIn );
  41. HRESULT
  42. HrDeleteInstanceAndChildren( OBJECTCOOKIE cookieIn );
  43. HRESULT
  44. HrCreateNewCookie( REFCLSID rclsidTypeIn,
  45. OBJECTCOOKIE cookieParentIn,
  46. LPCWSTR pcszNameIn,
  47. OBJECTCOOKIE * pcookieOut
  48. );
  49. public: // Methods
  50. static HRESULT
  51. S_HrCreateInstance( IUnknown ** ppunkOut );
  52. // IUnknown
  53. STDMETHOD( QueryInterface )( REFIID riid, LPVOID *ppv );
  54. STDMETHOD_( ULONG, AddRef )( void );
  55. STDMETHOD_( ULONG, Release )( void );
  56. // IObjectManager
  57. STDMETHOD( FindObject )( REFCLSID rclsidTypeIn,
  58. OBJECTCOOKIE cookieParent,
  59. LPCWSTR pcszNameIn,
  60. REFCLSID rclsidFormatIn,
  61. OBJECTCOOKIE * pcookieOut,
  62. LPUNKNOWN * ppunkOut
  63. );
  64. STDMETHOD( GetObject )( REFCLSID rclsidFormatIn,
  65. OBJECTCOOKIE cookieIn,
  66. LPUNKNOWN * ppunkOut
  67. );
  68. STDMETHOD( RemoveObject )( OBJECTCOOKIE cookieIn );
  69. STDMETHOD( SetObjectStatus )( OBJECTCOOKIE cookieIn,
  70. HRESULT hrIn
  71. );
  72. }; // class CObjectManager