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.

82 lines
2.1 KiB

  1. /////////////////////////////////////////////////////////////////////////////////////
  2. // ATSCComponentTypeimpl.h : implementation helper template for component type interface
  3. // Copyright (c) Microsoft Corporation 1999.
  4. #ifndef ATSCCOMPONENTTYPEIMPL_H
  5. #define ATSCCOMPONENTTYPEIMPL_H
  6. #include "componenttypeimpl.h"
  7. namespace BDATuningModel {
  8. template<class T,
  9. class MostDerived = IATSCComponentType,
  10. LPCGUID iid = &__uuidof(MostDerived),
  11. LPCGUID LibID = &LIBID_TunerLib,
  12. WORD wMajor = 1,
  13. WORD wMinor = 0,
  14. class tihclass = CComTypeInfoHolder
  15. > class ATL_NO_VTABLE IATSCComponentTypeImpl :
  16. public IMPEG2ComponentTypeImpl<T, MostDerived, iid, LibID, wMajor, wMinor, tihclass>
  17. {
  18. // IATSCComponentType
  19. public:
  20. DWORD m_dwFlags;
  21. IATSCComponentTypeImpl() : m_dwFlags(0) {}
  22. virtual ~IATSCComponentTypeImpl() {}
  23. // typedef IATSCComponentTypeImpl<T, MostDerived, iid, LibID, wMajor, wMinor, tihclass> thistype;
  24. typedef IMPEG2ComponentTypeImpl<T, MostDerived, iid, LibID, wMajor, wMinor, tihclass> basetype;
  25. BEGIN_PROP_MAP(IATSCComponentTypeImpl)
  26. CHAIN_PROP_MAP(basetype)
  27. PROP_DATA_ENTRY("Flags", m_dwFlags, VT_UI4)
  28. END_PROP_MAP()
  29. STDMETHOD(get_Flags)(long *pVal)
  30. {
  31. try {
  32. if (!pVal) {
  33. return E_POINTER;
  34. }
  35. ATL_LOCKT();
  36. *pVal = m_dwFlags;
  37. } catch (...) {
  38. return E_POINTER;
  39. }
  40. return NOERROR;
  41. }
  42. STDMETHOD(put_Flags)(long newVal)
  43. {
  44. ATL_LOCKT();
  45. m_dwFlags = newVal;
  46. MARK_DIRTY(T);
  47. return NOERROR;
  48. }
  49. STDMETHOD(Clone) (IComponentType **ppCT) {
  50. try {
  51. if (!ppCT) {
  52. return E_POINTER;
  53. }
  54. ATL_LOCKT();
  55. HRESULT hr = basetype::Clone(ppCT);
  56. if (FAILED(hr)) {
  57. return hr;
  58. }
  59. T* pt = static_cast<T*>(*ppCT);
  60. pt->m_dwFlags = m_dwFlags;
  61. return NOERROR;
  62. } catch (HRESULT h) {
  63. return h;
  64. } catch (...) {
  65. return E_POINTER;
  66. }
  67. }
  68. };
  69. }; // namespace
  70. #endif // ATSCCOMPONENTTYPEIMPL_H
  71. // end of file -- ATSCcomponenttypeimpl.h