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.

125 lines
3.5 KiB

  1. /****************************************************************************
  2. *
  3. * waveout.c
  4. *
  5. * WDM Audio support for Wave Output devices
  6. *
  7. * Copyright (C) Microsoft Corporation, 1997 - 1998 All Rights Reserved.
  8. *
  9. * History
  10. * 3-17-98 - Mike McLaughlin (mikem)
  11. *
  12. ***************************************************************************/
  13. #include "wdmdrv.h"
  14. //--------------------------------------------------------------------------
  15. //
  16. // DWORD auxMessage
  17. //
  18. // Description:
  19. // This function conforms to the standard auxilary driver
  20. // message procedure.
  21. //
  22. // Parameters:
  23. // UINT uDevId
  24. //
  25. // WORD msg
  26. //
  27. // DWORD dwUser
  28. //
  29. // DWORD dwParam1
  30. //
  31. // DWORD dwParam2
  32. //
  33. // Return (DWORD):
  34. // Message specific
  35. //
  36. //@@BEGIN_MSINTERNAL
  37. // History: Date Author Comment
  38. // 5/20/93 BryanW Added this comment block.
  39. //@@END_MSINTERNAL
  40. //
  41. //--------------------------------------------------------------------------
  42. DWORD FAR PASCAL _loadds auxMessage
  43. (
  44. UINT uDevId,
  45. WORD msg,
  46. DWORD_PTR dwUser,
  47. DWORD_PTR dwParam1,
  48. DWORD_PTR dwParam2
  49. )
  50. {
  51. LPDEVICEINFO DeviceInfo;
  52. MMRESULT mmr;
  53. switch (msg) {
  54. case AUXM_INIT:
  55. DPF(DL_TRACE|FA_AUX, ("AUXDM_INIT") ) ;
  56. return(wdmaudAddRemoveDevNode(AuxDevice, (LPCWSTR)(ULONG_PTR)dwParam2, TRUE));
  57. case DRVM_EXIT:
  58. DPF(DL_TRACE|FA_AUX, ("AUXM_EXIT") ) ;
  59. return(wdmaudAddRemoveDevNode(AuxDevice, (LPCWSTR)(ULONG_PTR)dwParam2, FALSE));
  60. case AUXDM_GETNUMDEVS:
  61. DPF(DL_TRACE|FA_AUX, ("AUXDM_GETNUMDEVS") ) ;
  62. return wdmaudGetNumDevs(AuxDevice, (LPWSTR)(ULONG_PTR)dwParam1);
  63. case AUXDM_GETDEVCAPS:
  64. DPF(DL_TRACE|FA_AUX, ("AUXDM_GETDEVCAPS") ) ;
  65. if (DeviceInfo = GlobalAllocDeviceInfo((LPWSTR)(ULONG_PTR)dwParam2)) {
  66. DeviceInfo->DeviceType = AuxDevice;
  67. DeviceInfo->DeviceNumber = uDevId;
  68. mmr = wdmaudGetDevCaps(DeviceInfo, (MDEVICECAPSEX FAR*)(ULONG_PTR)dwParam1);
  69. GlobalFreeDeviceInfo(DeviceInfo);
  70. return mmr;
  71. } else {
  72. MMRRETURN( MMSYSERR_NOMEM );
  73. }
  74. case AUXDM_GETVOLUME:
  75. DPF(DL_TRACE|FA_AUX, ("AUXDM_GETVOLUME") ) ;
  76. if (DeviceInfo = GlobalAllocDeviceInfo((LPWSTR)(ULONG_PTR)dwParam2)) {
  77. DeviceInfo->DeviceType = AuxDevice;
  78. DeviceInfo->DeviceNumber = uDevId;
  79. PRESETERROR(DeviceInfo);
  80. mmr = wdmaudIoControl(DeviceInfo,
  81. sizeof(DWORD),
  82. (LPBYTE)(ULONG_PTR)dwParam1,
  83. IOCTL_WDMAUD_GET_VOLUME);
  84. POSTEXTRACTERROR(mmr,DeviceInfo);
  85. GlobalFreeDeviceInfo(DeviceInfo);
  86. MMRRETURN( mmr );
  87. } else {
  88. MMRRETURN( MMSYSERR_NOMEM );
  89. }
  90. case AUXDM_SETVOLUME:
  91. DPF(DL_TRACE|FA_AUX, ("AUXDM_SETVOLUME") ) ;
  92. if (DeviceInfo = GlobalAllocDeviceInfo((LPWSTR)(ULONG_PTR)dwParam2)) {
  93. DeviceInfo->DeviceType = AuxDevice;
  94. DeviceInfo->DeviceNumber = uDevId;
  95. PRESETERROR(DeviceInfo);
  96. mmr = wdmaudIoControl(DeviceInfo,
  97. sizeof(DWORD),
  98. (LPBYTE)&dwParam1,
  99. IOCTL_WDMAUD_SET_VOLUME);
  100. POSTEXTRACTERROR(mmr,DeviceInfo);
  101. GlobalFreeDeviceInfo(DeviceInfo);
  102. MMRRETURN( mmr );
  103. } else {
  104. MMRRETURN( MMSYSERR_NOMEM );
  105. }
  106. }
  107. MMRRETURN( MMSYSERR_NOTSUPPORTED );
  108. } // auxMessage()
  109. //---------------------------------------------------------------------------
  110. // End of File: auxd.c
  111. //---------------------------------------------------------------------------