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.

114 lines
3.0 KiB

  1. /*****************************************************************************
  2. * porttbl.c - WDM port class driver port table
  3. *****************************************************************************
  4. * Copyright (c) 1996-2000 Microsoft Corporation. All rights reserved.
  5. *
  6. * 11/19/96 Dale Sather
  7. *
  8. */
  9. #define PUT_GUIDS_HERE
  10. #include "private.h"
  11. extern NTSTATUS CreateMiniportMidiUart(PUNKNOWN *Unknown, REFCLSID ClassID,
  12. PUNKNOWN UnknownOuter OPTIONAL, POOL_TYPE PoolType);
  13. extern NTSTATUS CreateMiniportDMusUART(PUNKNOWN *Unknown, REFCLSID ClassID,
  14. PUNKNOWN UnknownOuter OPTIONAL, POOL_TYPE PoolType);
  15. extern NTSTATUS CreateMiniportMidiFM( PUNKNOWN *Unknown, REFCLSID ClassID,
  16. PUNKNOWN UnknownOuter OPTIONAL, POOL_TYPE PoolType);
  17. // ==============================================================================
  18. // MiniportDrivers
  19. // Structures which map the miniport class ID to the create functions.
  20. // ==============================================================================
  21. PORT_DRIVER
  22. MiniportDriverUart =
  23. {
  24. &CLSID_MiniportDriverUart,
  25. CreateMiniportMidiUart
  26. };
  27. PORT_DRIVER
  28. MiniportDriverDMusUART =
  29. {
  30. &CLSID_MiniportDriverDMusUART,
  31. CreateMiniportDMusUART
  32. };
  33. PORT_DRIVER
  34. MiniportDriverFmSynth =
  35. {
  36. &CLSID_MiniportDriverFmSynth,
  37. CreateMiniportMidiFM
  38. };
  39. PORT_DRIVER
  40. MiniportDriverFmSynthWithVol =
  41. // Same as above, but for miniport that also features volume node.
  42. // Sausage McMuffin With Egg.
  43. {
  44. &CLSID_MiniportDriverFmSynthWithVol,
  45. CreateMiniportMidiFM
  46. };
  47. extern PORT_DRIVER PortDriverWaveCyclic;
  48. extern PORT_DRIVER PortDriverWavePci;
  49. extern PORT_DRIVER PortDriverTopology;
  50. extern PORT_DRIVER PortDriverMidi;
  51. extern PORT_DRIVER PortDriverDMus;
  52. PPORT_DRIVER PortDriverTable[] =
  53. {
  54. &PortDriverWaveCyclic,
  55. &PortDriverWavePci,
  56. &PortDriverTopology,
  57. &PortDriverMidi,
  58. &PortDriverDMus,
  59. &MiniportDriverUart,
  60. &MiniportDriverFmSynth,
  61. &MiniportDriverFmSynthWithVol,
  62. &MiniportDriverDMusUART
  63. };
  64. #pragma code_seg("PAGE")
  65. /*****************************************************************************
  66. * GetClassInfo()
  67. *****************************************************************************
  68. * Get information regarding a class.
  69. * TODO: Eliminate this in favor of object servers.
  70. */
  71. NTSTATUS
  72. GetClassInfo
  73. (
  74. IN REFCLSID ClassId,
  75. OUT PFNCREATEINSTANCE * Create
  76. )
  77. {
  78. PAGED_CODE();
  79. ASSERT(Create);
  80. PPORT_DRIVER * portDriver = PortDriverTable;
  81. for
  82. (
  83. ULONG count = SIZEOF_ARRAY(PortDriverTable);
  84. count--;
  85. portDriver++
  86. )
  87. {
  88. if (IsEqualGUIDAligned(ClassId,*(*portDriver)->ClassId))
  89. {
  90. *Create = (*portDriver)->Create;
  91. return STATUS_SUCCESS;
  92. }
  93. }
  94. return STATUS_NOT_FOUND;
  95. }
  96. #pragma code_seg()