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.

71 lines
1.7 KiB

  1. //=================================================================
  2. //
  3. // dmadesc.h
  4. //
  5. // Copyright (c) 1999-2001 Microsoft Corporation, All Rights Reserved
  6. //
  7. //=================================================================
  8. #ifndef __DMADESC_H__
  9. #define __DMADESC_H__
  10. class
  11. __declspec(uuid("571D3186-D45D-11d2-B35E-00104BC97924"))
  12. CDMADescriptor : public CResourceDescriptor
  13. {
  14. public:
  15. // Construction/Destruction
  16. CDMADescriptor( PPOORMAN_RESDESC_HDR pResDescHdr, CConfigMgrDevice* pDevice );
  17. CDMADescriptor( DWORD dwResourceId, DMA_DES& dmaDes, CConfigMgrDevice* pOwnerDevice );
  18. CDMADescriptor( const CDMADescriptor& dma );
  19. ~CDMADescriptor();
  20. DWORD GetFlags( void );
  21. ULONG GetChannel( void );
  22. // Override of base class functionality
  23. virtual void * GetResource();
  24. };
  25. _COM_SMARTPTR_TYPEDEF(CDMADescriptor, __uuidof(CDMADescriptor));
  26. inline DWORD CDMADescriptor::GetFlags( void )
  27. {
  28. return ( NULL != m_pbResourceDescriptor ? ((PDMA_DES) m_pbResourceDescriptor)->DD_Flags : 0 );
  29. }
  30. inline DWORD CDMADescriptor::GetChannel( void )
  31. {
  32. return ( NULL != m_pbResourceDescriptor ? ((PDMA_DES) m_pbResourceDescriptor)->DD_Alloc_Chan : 0 );
  33. }
  34. // A collection of DMA Descriptors
  35. class CDMACollection : public TRefPtr<CDMADescriptor>
  36. {
  37. public:
  38. // Construction/Destruction
  39. CDMACollection();
  40. ~CDMACollection();
  41. // Because we're inheriting, we need to declare this here
  42. // (= operator is not inherited).
  43. const CDMACollection& operator = ( const CDMACollection& srcCollection );
  44. };
  45. inline const CDMACollection& CDMACollection::operator = ( const CDMACollection& srcCollection )
  46. {
  47. // Call into the templated function
  48. Copy( srcCollection );
  49. return *this;
  50. }
  51. #endif