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.

97 lines
3.4 KiB

  1. // ResourceObject.h: interface for the CResourceObject class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #pragma once
  5. class CResourceObject :
  6. public IDispatchEx
  7. {
  8. private:
  9. LONG m_cRef;
  10. RESOURCE_HANDLE m_hResource;
  11. PLOG_EVENT_ROUTINE m_pler;
  12. HKEY m_hkey;
  13. LPCWSTR m_pszName; // DON'T FREE
  14. private:
  15. STDMETHOD(LogInformation)( BSTR bstrIn );
  16. STDMETHOD(ReadPrivateProperty)( DISPID idIn, VARIANT * pvarResOut );
  17. STDMETHOD(WritePrivateProperty)( DISPID idIn, DISPPARAMS * pdpIn );
  18. STDMETHOD(AddPrivateProperty)( DISPPARAMS * pdpIn );
  19. STDMETHOD(RemovePrivateProperty)( DISPPARAMS * pdpIn );
  20. STDMETHOD(LogError)( HRESULT hrIn );
  21. public:
  22. explicit CResourceObject( RESOURCE_HANDLE hResourceIn,
  23. PLOG_EVENT_ROUTINE plerIn,
  24. HKEY hkeyIn,
  25. LPCWSTR pszNameIn
  26. );
  27. virtual ~CResourceObject();
  28. // IUnknown
  29. STDMETHOD( QueryInterface )(
  30. REFIID riid,
  31. void ** ppUnk );
  32. STDMETHOD_(ULONG, AddRef )( );
  33. STDMETHOD_(ULONG, Release )( );
  34. // IDispatch
  35. STDMETHOD( GetTypeInfoCount )(
  36. /* [out] */ UINT __RPC_FAR *pctinfo );
  37. STDMETHOD( GetTypeInfo )(
  38. /* [in] */ UINT iTInfo,
  39. /* [in] */ LCID lcid,
  40. /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo );
  41. STDMETHOD( GetIDsOfNames )(
  42. /* [in] */ REFIID riid,
  43. /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
  44. /* [in] */ UINT cNames,
  45. /* [in] */ LCID lcid,
  46. /* [size_is][out] */ DISPID __RPC_FAR *rgDispId );
  47. STDMETHOD( Invoke )(
  48. /* [in] */ DISPID dispIdMember,
  49. /* [in] */ REFIID riid,
  50. /* [in] */ LCID lcid,
  51. /* [in] */ WORD wFlags,
  52. /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
  53. /* [out] */ VARIANT __RPC_FAR *pVarResult,
  54. /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
  55. /* [out] */ UINT __RPC_FAR *puArgErr );
  56. // IDispatchEx
  57. STDMETHOD( GetDispID )(
  58. /* [in] */ BSTR bstrName,
  59. /* [in] */ DWORD grfdex,
  60. /* [out] */ DISPID __RPC_FAR *pid );
  61. STDMETHOD( InvokeEx )(
  62. /* [in] */ DISPID id,
  63. /* [in] */ LCID lcid,
  64. /* [in] */ WORD wFlags,
  65. /* [in] */ DISPPARAMS __RPC_FAR *pdp,
  66. /* [out] */ VARIANT __RPC_FAR *pvarRes,
  67. /* [out] */ EXCEPINFO __RPC_FAR *pei,
  68. /* [unique][in] */ IServiceProvider __RPC_FAR *pspCaller );
  69. STDMETHOD( DeleteMemberByName )(
  70. /* [in] */ BSTR bstr,
  71. /* [in] */ DWORD grfdex );
  72. STDMETHOD( DeleteMemberByDispID )(
  73. /* [in] */ DISPID id );
  74. STDMETHOD( GetMemberProperties )(
  75. /* [in] */ DISPID id,
  76. /* [in] */ DWORD grfdexFetch,
  77. /* [out] */ DWORD __RPC_FAR *pgrfdex );
  78. STDMETHOD( GetMemberName )(
  79. /* [in] */ DISPID id,
  80. /* [out] */ BSTR __RPC_FAR *pbstrName );
  81. STDMETHOD( GetNextDispID )(
  82. /* [in] */ DWORD grfdex,
  83. /* [in] */ DISPID id,
  84. /* [out] */ DISPID __RPC_FAR *pid );
  85. STDMETHOD( GetNameSpaceParent )(
  86. /* [out] */ IUnknown __RPC_FAR *__RPC_FAR *ppunk );
  87. };