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.

96 lines
2.7 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2001 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // CIndexedDisk.h
  7. //
  8. // Implementation Files:
  9. // CIndexedDisk.cpp
  10. //
  11. // Description:
  12. // This file contains the declaration of the CIndexedDisk structure.
  13. //
  14. // This is a helper for CEnumPhysicalDisks, but has its own file
  15. // due to the one-class-per-file restriction.
  16. //
  17. // Maintained By:
  18. // John Franco (jfranco) 1-JUN-2001
  19. //
  20. //////////////////////////////////////////////////////////////////////////////
  21. // Make sure that this file is included only once per compile path.
  22. #pragma once
  23. //////////////////////////////////////////////////////////////////////////////
  24. // Include Files
  25. //////////////////////////////////////////////////////////////////////////////
  26. //////////////////////////////////////////////////////////////////////////////
  27. // Constant Declarations
  28. //////////////////////////////////////////////////////////////////////////////
  29. //////////////////////////////////////////////////////////////////////////////
  30. //++
  31. //
  32. // struct CIndexedDisk
  33. //
  34. // Description:
  35. // The CIndexedDisk structure associates a pointer to a disk object with
  36. // the disk object's Index property.
  37. //
  38. //--
  39. //////////////////////////////////////////////////////////////////////////////
  40. struct CIndexedDisk
  41. {
  42. CIndexedDisk( void );
  43. // accept default destructor, copy constructor, and assignment operator
  44. DWORD idxDisk;
  45. IUnknown * punkDisk;
  46. HRESULT HrInit( IUnknown * punkDiskIn );
  47. }; //*** struct CIndexedDisk
  48. inline CIndexedDisk::CIndexedDisk( void )
  49. : idxDisk( 0 )
  50. , punkDisk( NULL )
  51. {
  52. TraceFunc( "" );
  53. TraceFuncExit();
  54. } //*** CIndexedDisk::CIndexedDisk
  55. //////////////////////////////////////////////////////////////////////////////
  56. //++
  57. //
  58. // struct CIndexedDiskLessThan
  59. //
  60. // Description:
  61. // The CIndexedDiskLessThan function object provides a comparison
  62. // operation to arrange CIndexedDisk objects in ascending order when used
  63. // with generic sort algorithms or sorted containers.
  64. //
  65. // Although a simple function pointer would work, making it a function
  66. // object allows the compiler to inline the comparison operation.
  67. //
  68. //--
  69. //////////////////////////////////////////////////////////////////////////////
  70. struct CIndexedDiskLessThan
  71. {
  72. bool operator()( const CIndexedDisk & rLeftIn, const CIndexedDisk & rRightIn ) const
  73. {
  74. return ( rLeftIn.idxDisk < rRightIn.idxDisk );
  75. }
  76. }; //*** struct CIndexedDiskLessThan