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.

80 lines
2.2 KiB

  1. /////////////////////////////////////////////////////////////////////////
  2. //
  3. // cfgmgrdevice.h
  4. //
  5. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  6. //
  7. // History: 1/20/98 davwoh Created
  8. //
  9. /////////////////////////////////////////////////////////////////////////
  10. #ifndef __DEVICEDESC_H__
  11. #define __DEVICEDESC_H__
  12. class
  13. __declspec(uuid("571D3188-D45D-11d2-B35E-00104BC97924"))
  14. CDeviceMemoryDescriptor: public CResourceDescriptor
  15. {
  16. public:
  17. // Construction/Destruction
  18. CDeviceMemoryDescriptor( PPOORMAN_RESDESC_HDR pResDescHdr, CConfigMgrDevice* pDevice );
  19. CDeviceMemoryDescriptor( DWORD dwResourceId, MEM_DES& memDes, CConfigMgrDevice* pOwnerDevice );
  20. CDeviceMemoryDescriptor( const CDeviceMemoryDescriptor& mem );
  21. ~CDeviceMemoryDescriptor();
  22. DWORDLONG GetBaseAddress( void );
  23. DWORDLONG GetEndAddress( void );
  24. DWORD GetFlags( void );
  25. // Override of base class functionality
  26. virtual void * GetResource();
  27. };
  28. _COM_SMARTPTR_TYPEDEF(CDeviceMemoryDescriptor, __uuidof(CDeviceMemoryDescriptor));
  29. inline DWORDLONG CDeviceMemoryDescriptor::GetBaseAddress( void )
  30. {
  31. return ( NULL != m_pbResourceDescriptor ? ((PMEM_DES) m_pbResourceDescriptor)->MD_Alloc_Base : 0 );
  32. }
  33. inline DWORDLONG CDeviceMemoryDescriptor::GetEndAddress( void )
  34. {
  35. return ( NULL != m_pbResourceDescriptor ? ((PMEM_DES) m_pbResourceDescriptor)->MD_Alloc_End : 0 );
  36. }
  37. inline DWORD CDeviceMemoryDescriptor::GetFlags( void )
  38. {
  39. return ( NULL != m_pbResourceDescriptor ? ((PMEM_DES) m_pbResourceDescriptor)->MD_Flags : 0 );
  40. }
  41. // A collection of DeviceMemory Port Descriptors
  42. class CDeviceMemoryCollection : public TRefPtr<CDeviceMemoryDescriptor>
  43. {
  44. public:
  45. // Construction/Destruction
  46. CDeviceMemoryCollection();
  47. ~CDeviceMemoryCollection();
  48. // Because we're inheriting, we need to declare this here
  49. // (= operator is not inherited).
  50. const CDeviceMemoryCollection& operator = ( const CDeviceMemoryCollection& srcCollection );
  51. };
  52. inline const CDeviceMemoryCollection& CDeviceMemoryCollection::operator = ( const CDeviceMemoryCollection& srcCollection )
  53. {
  54. // Call into the templated function
  55. Copy( srcCollection );
  56. return *this;
  57. }
  58. #endif