Source code of Windows XP (NT5)
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.

94 lines
2.6 KiB

  1. /****************************************************************************
  2. *
  3. * auxdd.c
  4. *
  5. * Multimedia kernel driver support component (mmdrv)
  6. *
  7. * Copyright (c) 1991-1996 Microsoft Corporation
  8. *
  9. * Driver for wave input and output devices
  10. *
  11. * -- Aux driver entry point(auxMessage)
  12. *
  13. * History
  14. * 25-Aug-1992 - Robin Speed (RobinSp) wrote it
  15. *
  16. ***************************************************************************/
  17. #include <drvlib.h>
  18. #include <ntddaux.h>
  19. /****************************************************************************
  20. This function conforms to the standard Aux driver message proc
  21. (auxMessage), which is documented in the DDK.
  22. ****************************************************************************/
  23. DWORD APIENTRY auxMessage(UINT uDevice,
  24. UINT uMsg,
  25. DWORD_PTR dwUser,
  26. DWORD_PTR dwParam1,
  27. DWORD_PTR dwParam2)
  28. {
  29. MMRESULT mRet;
  30. AUX_DD_VOLUME Volume;
  31. switch (uMsg) {
  32. case AUXDM_GETDEVCAPS:
  33. dprintf2(("AUXDM_GETDEVCAPS"));
  34. {
  35. MMRESULT mrc;
  36. AUXCAPSW ac;
  37. mrc = sndGetData(AUX_DEVICE, uDevice, sizeof(ac), (LPBYTE)&ac,
  38. IOCTL_AUX_GET_CAPABILITIES);
  39. if (mrc != MMSYSERR_NOERROR) {
  40. return mrc;
  41. }
  42. InternalLoadString((UINT)*(LPDWORD)ac.szPname, ac.szPname,
  43. sizeof(ac.szPname) / sizeof(WCHAR));
  44. CopyMemory((LPVOID)dwParam1, &ac, min(sizeof(ac), dwParam2));
  45. return MMSYSERR_NOERROR;
  46. }
  47. case AUXDM_GETNUMDEVS:
  48. dprintf2(("AUXDM_GETNUMDEVS"));
  49. return sndGetNumDevs(AUX_DEVICE);
  50. case AUXDM_GETVOLUME:
  51. dprintf2(("AUXDM_GETVOLUME"));
  52. mRet = sndGetData(AUX_DEVICE, uDevice, sizeof(Volume),
  53. (PBYTE)&Volume, IOCTL_AUX_GET_VOLUME);
  54. if (mRet == MMSYSERR_NOERROR) {
  55. *(LPDWORD)dwParam1 =
  56. (DWORD)MAKELONG(HIWORD(Volume.Left),
  57. HIWORD(Volume.Right));
  58. }
  59. return mRet;
  60. case AUXDM_SETVOLUME:
  61. dprintf2(("AUXDM_SETVOLUME"));
  62. Volume.Left = LOWORD(dwParam1) << 16;
  63. Volume.Right = HIWORD(dwParam1) << 16;
  64. return sndSetData(AUX_DEVICE, uDevice, sizeof(Volume),
  65. (PBYTE)&Volume, IOCTL_AUX_SET_VOLUME);
  66. default:
  67. return MMSYSERR_NOTSUPPORTED;
  68. }
  69. //
  70. // Should not get here
  71. //
  72. WinAssert(0);
  73. return MMSYSERR_NOTSUPPORTED;
  74. }
  75.