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.

173 lines
3.9 KiB

  1. //=================================================================
  2. //
  3. // DmaDesc.cpp
  4. //
  5. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  6. //
  7. //=================================================================
  8. #include "precomp.h"
  9. #include <assertbreak.h>
  10. #include "refptr.h"
  11. #include "poormansresource.h"
  12. #include "resourcedesc.h"
  13. #include "dmadesc.h"
  14. ////////////////////////////////////////////////////////////////////////
  15. //
  16. // Function: CDMADescriptor::CDMADescriptor
  17. //
  18. // Class Constructor.
  19. //
  20. // Inputs: PPOORMAN_RESDESC_HDR pResDescHdr - Resource Descriptor
  21. // header used to get resource info
  22. // plus the raw bytes following.
  23. // CConfigMgrDevice* pOwnerDevice - Pointer to the
  24. // owner config manager device.
  25. //
  26. // Outputs: None.
  27. //
  28. // Return: None.
  29. //
  30. // Comments: None.
  31. //
  32. ////////////////////////////////////////////////////////////////////////
  33. CDMADescriptor::CDMADescriptor( PPOORMAN_RESDESC_HDR pResDescHdr,
  34. CConfigMgrDevice* pOwnerDevice )
  35. : CResourceDescriptor( pResDescHdr, pOwnerDevice )
  36. {
  37. }
  38. ////////////////////////////////////////////////////////////////////////
  39. //
  40. // Function: CDMADescriptor::CDMADescriptor
  41. //
  42. // Class Constructor.
  43. //
  44. // Inputs: DWORD dwResourceId - Resource Id with flags
  45. // DMA_DES dmaDes - DMA Descriptor.
  46. // CConfigMgrDevice* pOwnerDevice - Pointer to the
  47. // owner config manager device.
  48. //
  49. // Outputs: None.
  50. //
  51. // Return: None.
  52. //
  53. // Comments: None.
  54. //
  55. ////////////////////////////////////////////////////////////////////////
  56. CDMADescriptor::CDMADescriptor( DWORD dwResourceId,
  57. DMA_DES& dmaDes,
  58. CConfigMgrDevice* pOwnerDevice )
  59. : CResourceDescriptor( dwResourceId, &dmaDes, sizeof(DMA_DES), pOwnerDevice )
  60. {
  61. ASSERT_BREAK( ResType_DMA == GetResourceType() );
  62. }
  63. // Copy Constructor
  64. CDMADescriptor::CDMADescriptor( const CDMADescriptor& dma )
  65. : CResourceDescriptor( dma )
  66. {
  67. }
  68. ////////////////////////////////////////////////////////////////////////
  69. //
  70. // Function: CDMADescriptor::~CDMADescriptor
  71. //
  72. // Class Destructor.
  73. //
  74. // Inputs: None.
  75. //
  76. // Outputs: None.
  77. //
  78. // Return: None.
  79. //
  80. // Comments: None.
  81. //
  82. ////////////////////////////////////////////////////////////////////////
  83. CDMADescriptor::~CDMADescriptor( void )
  84. {
  85. }
  86. ////////////////////////////////////////////////////////////////////////
  87. //
  88. // Function: CDMADescriptor::GetResource
  89. //
  90. // Returns a string representation of the associated Device Memory
  91. // Address.
  92. //
  93. // Inputs: None.
  94. //
  95. // Outputs: CString& str - Storage for string.
  96. //
  97. // Return: TRUE/FALSE Function successful or not.
  98. //
  99. // Comments: Do NOT call down to the base class.
  100. //
  101. ////////////////////////////////////////////////////////////////////////
  102. void *CDMADescriptor::GetResource()
  103. {
  104. if ( NULL != m_pbResourceDescriptor ){
  105. // Cast to a DMA Descriptor, and place it's channel value in the
  106. // string
  107. PDMA_DES pDMA = (PDMA_DES) m_pbResourceDescriptor;
  108. return pDMA;
  109. }
  110. return NULL;
  111. }
  112. //
  113. // Constructor and Destructor for the DMA Descriptor Collection
  114. // object.
  115. //
  116. ////////////////////////////////////////////////////////////////////////
  117. //
  118. // Function: CDMACollection::CDMACollection
  119. //
  120. // Class Constructor.
  121. //
  122. // Inputs: None.
  123. //
  124. // Outputs: None.
  125. //
  126. // Return: None.
  127. //
  128. // Comments: None.
  129. //
  130. ////////////////////////////////////////////////////////////////////////
  131. CDMACollection::CDMACollection( void )
  132. {
  133. }
  134. ////////////////////////////////////////////////////////////////////////
  135. //
  136. // Function: CDMACollection::~CDMACollection
  137. //
  138. // Class Destructor.
  139. //
  140. // Inputs: None.
  141. //
  142. // Outputs: None.
  143. //
  144. // Return: None.
  145. //
  146. // Comments: None.
  147. //
  148. ////////////////////////////////////////////////////////////////////////
  149. CDMACollection::~CDMACollection( void )
  150. {
  151. }