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.

89 lines
2.3 KiB

  1. #ifndef __IRQDESC_H__
  2. #define __IRQDESC_H__
  3. /////////////////////////////////////////////////////////////////////////
  4. //
  5. // cfgmgrdevice.h
  6. //
  7. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  8. //
  9. // History: 10/15/97 Sanj Created by Sanj
  10. // 10/17/97 jennymc Moved things a tiny bit
  11. //
  12. /////////////////////////////////////////////////////////////////////////
  13. class
  14. __declspec(uuid("CB0E0537-D375-11d2-B35E-00104BC97924"))
  15. CIRQDescriptor : public CResourceDescriptor
  16. {
  17. public:
  18. // Construction/Destruction
  19. CIRQDescriptor( PPOORMAN_RESDESC_HDR pResDescHdr, CConfigMgrDevice* pDevice );
  20. CIRQDescriptor( DWORD dwResourceId, IRQ_DES& irqDes, CConfigMgrDevice* pOwnerDevice );
  21. CIRQDescriptor( const CIRQDescriptor& irq );
  22. ~CIRQDescriptor();
  23. // Accessors
  24. DWORD GetFlags( void );
  25. BOOL IsShareable( void );
  26. ULONG GetInterrupt( void );
  27. ULONG GetAffinity( void );
  28. // Override of base class functionality
  29. virtual void * GetResource();
  30. };
  31. _COM_SMARTPTR_TYPEDEF(CIRQDescriptor, __uuidof(CIRQDescriptor));
  32. inline DWORD CIRQDescriptor::GetFlags( void )
  33. {
  34. return ( NULL != m_pbResourceDescriptor ? ((PIRQ_DES) m_pbResourceDescriptor)->IRQD_Flags : 0 );
  35. }
  36. inline BOOL CIRQDescriptor::IsShareable( void )
  37. {
  38. return ( NULL != m_pbResourceDescriptor ? ((PIRQ_DES) m_pbResourceDescriptor)->IRQD_Flags & fIRQD_Share : FALSE );
  39. }
  40. inline DWORD CIRQDescriptor::GetInterrupt( void )
  41. {
  42. return ( NULL != m_pbResourceDescriptor ? ((PIRQ_DES) m_pbResourceDescriptor)->IRQD_Alloc_Num : 0 );
  43. }
  44. inline DWORD CIRQDescriptor::GetAffinity( void )
  45. {
  46. return ( NULL != m_pbResourceDescriptor ? ((PIRQ_DES) m_pbResourceDescriptor)->IRQD_Affinity : 0 );
  47. }
  48. // A collection of IRQ Descriptors
  49. class CIRQCollection : public TRefPtr<CIRQDescriptor>
  50. {
  51. public:
  52. // Construction/Destruction
  53. CIRQCollection();
  54. ~CIRQCollection();
  55. // Because we're inheriting, we need to declare this here
  56. // (= operator is not inherited).
  57. const CIRQCollection& operator = ( const CIRQCollection& srcCollection );
  58. };
  59. inline const CIRQCollection& CIRQCollection::operator = ( const CIRQCollection& srcCollection )
  60. {
  61. // Call into the templated function
  62. Copy( srcCollection );
  63. return *this;
  64. }
  65. #endif