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.

107 lines
3.1 KiB

  1. /////////////////////////////////////////////////////////////////////////
  2. //
  3. // iodesc.h
  4. //
  5. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  6. //
  7. // History: 10/15/97 Sanj Created by Sanj
  8. // 10/17/97 jennymc Moved things a tiny bit
  9. //
  10. /////////////////////////////////////////////////////////////////////////
  11. #ifndef __IODESC_H__
  12. #define __IODESC_H__
  13. // This structure is a munge of 16-bit and 32-bit values that basically combine both
  14. // structures into one with common information (sigh...)
  15. typedef struct _IOWBEM_DES{
  16. DWORD IOD_Count; // number of IO_RANGE structs in IO_RESOURCE
  17. DWORD IOD_Type; // size (in bytes) of IO_RANGE (IOType_Range)
  18. DWORDLONG IOD_Alloc_Base; // base of allocated port range
  19. DWORDLONG IOD_Alloc_End; // end of allocated port range
  20. DWORD IOD_DesFlags; // flags relating to allocated port range
  21. BYTE IOD_Alloc_Alias; // From 16-bit-land
  22. BYTE IOD_Alloc_Decode; // From 16-bit-land
  23. } IOWBEM_DES;
  24. typedef IOWBEM_DES* PIOWBEM_DES;
  25. class
  26. __declspec(uuid("571D3187-D45D-11d2-B35E-00104BC97924"))
  27. CIODescriptor : public CResourceDescriptor
  28. {
  29. public:
  30. // Construction/Destruction
  31. CIODescriptor( PPOORMAN_RESDESC_HDR pResDescHdr, CConfigMgrDevice* pDevice );
  32. CIODescriptor( DWORD dwResourceId, IOWBEM_DES& ioDes, CConfigMgrDevice* pOwnerDevice );
  33. CIODescriptor( const CIODescriptor& io );
  34. ~CIODescriptor();
  35. DWORDLONG GetBaseAddress( void );
  36. DWORDLONG GetEndAddress( void );
  37. DWORD GetFlags( void );
  38. BYTE GetAlias( void );
  39. BYTE GetDecode( void );
  40. // Override of base class functionality
  41. virtual void * GetResource();
  42. };
  43. _COM_SMARTPTR_TYPEDEF(CIODescriptor, __uuidof(CIODescriptor));
  44. inline DWORDLONG CIODescriptor::GetBaseAddress( void )
  45. {
  46. return ( NULL != m_pbResourceDescriptor ? ((PIOWBEM_DES) m_pbResourceDescriptor)->IOD_Alloc_Base : 0 );
  47. }
  48. inline DWORDLONG CIODescriptor::GetEndAddress( void )
  49. {
  50. return ( NULL != m_pbResourceDescriptor ? ((PIOWBEM_DES) m_pbResourceDescriptor)->IOD_Alloc_End : 0 );
  51. }
  52. inline DWORD CIODescriptor::GetFlags( void )
  53. {
  54. return ( NULL != m_pbResourceDescriptor ? ((PIOWBEM_DES) m_pbResourceDescriptor)->IOD_DesFlags : 0 );
  55. }
  56. inline BYTE CIODescriptor::GetAlias( void )
  57. {
  58. return ( NULL != m_pbResourceDescriptor ? ((PIOWBEM_DES) m_pbResourceDescriptor)->IOD_Alloc_Alias : 0 );
  59. }
  60. inline BYTE CIODescriptor::GetDecode( void )
  61. {
  62. return ( NULL != m_pbResourceDescriptor ? ((PIOWBEM_DES) m_pbResourceDescriptor)->IOD_Alloc_Decode : 0 );
  63. }
  64. // A collection of IO Port Descriptors
  65. class CIOCollection : public TRefPtr<CIODescriptor>
  66. {
  67. public:
  68. // Construction/Destruction
  69. CIOCollection();
  70. ~CIOCollection();
  71. // Because we're inheriting, we need to declare this here
  72. // (= operator is not inherited).
  73. const CIOCollection& operator = ( const CIOCollection& srcCollection );
  74. };
  75. inline const CIOCollection& CIOCollection::operator = ( const CIOCollection& srcCollection )
  76. {
  77. // Call into the templated function
  78. Copy( srcCollection );
  79. return *this;
  80. }
  81. #endif