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.

101 lines
2.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1998.
  5. //
  6. // File: cidbprop.hxx
  7. //
  8. // Contents: IDBProperties implementation
  9. //
  10. // History: 1-09-97 srikants Created
  11. //
  12. //----------------------------------------------------------------------------
  13. #pragma once
  14. #include <dbcmdtre.hxx>
  15. class CDbProperties : public IDBProperties
  16. {
  17. public:
  18. CDbProperties( IUnknown * pUnkOuter = 0 )
  19. :_refCount(0),
  20. _pUnkOuter(pUnkOuter)
  21. {
  22. AddRef();
  23. }
  24. //
  25. // IUnknown methods.
  26. //
  27. STDMETHOD(QueryInterface) (THIS_ REFIID riid,LPVOID *ppiuk );
  28. STDMETHOD_(ULONG, AddRef) (THIS);
  29. STDMETHOD_(ULONG, Release) (THIS);
  30. //
  31. // IDBProperties methods.
  32. //
  33. STDMETHOD(GetProperties) (
  34. ULONG cPropertyIDSets,
  35. const DBPROPIDSET rgPropertyIDSets[],
  36. ULONG *pcPropertySets,
  37. DBPROPSET ** prgPropertySets);
  38. STDMETHOD(GetPropertyInfo) (
  39. ULONG cPropertyIDSets,
  40. const DBPROPIDSET rgPropertyIDSets[],
  41. ULONG *pcPropertyInfoSets,
  42. DBPROPINFOSET * *prgPropertyInfoSets,
  43. OLECHAR * *ppDescBuffer);
  44. STDMETHOD(SetProperties) (
  45. ULONG cPropertySets,
  46. DBPROPSET rgPropertySets[]);
  47. //
  48. // Non-Interface methods.
  49. //
  50. void Marshall( PSerStream & stm ) const;
  51. void Marshall( PSerStream & stm, ULONG cGuid, GUID const * pGuid ) const;
  52. BOOL UnMarshall( PDeSerStream & stm );
  53. //
  54. // Memory allocation
  55. //
  56. void * operator new( size_t size )
  57. {
  58. return (void *) CoTaskMemAlloc( size );
  59. }
  60. inline void * operator new( size_t size, void * p )
  61. {
  62. return( p );
  63. }
  64. void operator delete( void * p )
  65. {
  66. CoTaskMemFree( p );
  67. }
  68. ULONG Count() const { return _aPropSet.Count(); }
  69. CDbPropSet & GetPropSet( ULONG i ) { return _aPropSet[i]; }
  70. private:
  71. unsigned CreateReturnPropset( DBPROPIDSET const & PropIDSet,
  72. CDbPropSet & Props );
  73. void CopyProp( CDbProp & dst, CDbPropSet const & src,
  74. DBPROPID dwPropId );
  75. long _refCount;
  76. IUnknown * _pUnkOuter;
  77. XArrayOLEInPlace<CDbPropSet> _aPropSet;
  78. };