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.

161 lines
4.3 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: mixer.h
  3. *
  4. * Internal header file for mixer.c
  5. *
  6. *
  7. * Created: 27-10-93
  8. * Author: Stephen Estrop [StephenE]
  9. *
  10. * Copyright (c) 1993-2001 Microsoft Corporation
  11. \**************************************************************************/
  12. #define UNICODE
  13. #ifndef WIN32
  14. #define WIN32
  15. #endif
  16. #include <stdlib.h>
  17. #include <windows.h>
  18. #include "mmsystem.h" // pick up the internal one
  19. #include "mmsysp.h" // pick up the internal one
  20. #include "mmddk.h"
  21. #define NONEWWAVE
  22. #include <mmreg.h>
  23. #undef NONEWWAVE
  24. //
  25. // Avoid including msacm.h - in any case this define should be in mmreg.h
  26. //
  27. #ifndef DRVM_MAPPER_STATUS
  28. #define DRVM_MAPPER_STATUS (0x2000)
  29. #endif
  30. #ifndef WIDM_MAPPER_STATUS
  31. #define WIDM_MAPPER_STATUS (DRVM_MAPPER_STATUS + 0)
  32. #define WAVEIN_MAPPER_STATUS_DEVICE 0
  33. #define WAVEIN_MAPPER_STATUS_MAPPED 1
  34. #endif
  35. #ifndef WODM_MAPPER_STATUS
  36. #define WODM_MAPPER_STATUS (DRVM_MAPPER_STATUS + 0)
  37. #define WAVEOUT_MAPPER_STATUS_DEVICE 0
  38. #define WAVEOUT_MAPPER_STATUS_MAPPED 1
  39. #endif
  40. #define MMDDKINC
  41. #include "winmmi.h"
  42. #define MIXMGR_ENTER EnterCriticalSection(&HandleListCritSec)
  43. #define MIXMGR_LEAVE LeaveCriticalSection(&HandleListCritSec)
  44. //typedef struct
  45. //{
  46. // HDRVR hdrvr; // handle to the module
  47. // DRIVERMSGPROC drvMessage; // pointer to entry point
  48. // BYTE bNumDevs; // number of devices supported
  49. // BYTE bUsage; // usage count (number of handles open)
  50. // DWORD cookie; // cookie used for WDM devices.
  51. // CRITICAL_SECTION MixerCritSec; // Serialize use of mixer
  52. // WCHAR wszDrvEntry[64]; // driver filename
  53. //} MIXERDRV, *PMIXERDRV;
  54. typedef struct tMIXERDEV
  55. {
  56. UINT uHandleType; // for parameter validation
  57. struct tMIXERDEV *pmxdevNext; /* How quaint, a linked list... */
  58. PMIXERDRV pmxdrv;
  59. UINT wDevice;
  60. DWORD_PTR dwDrvUser;
  61. UINT uDeviceID;
  62. DWORD fdwSupport; // from the driver's mixercaps
  63. DWORD cDestinations; // from the driver's mixercaps
  64. DWORD_PTR dwCallback; // client's callback and inst data
  65. DWORD_PTR dwInstance;
  66. DWORD fdwOpen; /* The open flags the caller used */
  67. DWORD fdwHandle;
  68. } MIXERDEV, *PMIXERDEV;
  69. /* -------------------------------------------------------------------------
  70. ** internal function prototypes
  71. ** -------------------------------------------------------------------------
  72. */
  73. BOOL CALLBACK MixerCallbackFunc(
  74. HMIXER hmx,
  75. UINT uMsg,
  76. DWORD_PTR dwInstance,
  77. DWORD_PTR dwParam1,
  78. DWORD_PTR dwParam2
  79. );
  80. MMRESULT mixerReferenceDriverById(
  81. IN UINT uId,
  82. OUT PMIXERDRV *ppdrv OPTIONAL,
  83. OUT UINT *pport OPTIONAL
  84. );
  85. DWORD NEAR PASCAL IMixerMessageHandle(
  86. HMIXER hmx,
  87. UINT uMsg,
  88. DWORD_PTR dwP1,
  89. DWORD_PTR dwP2
  90. );
  91. DWORD NEAR PASCAL IMixerMessageId(
  92. UINT uDeviceID,
  93. UINT uMsg,
  94. DWORD_PTR dwParam1,
  95. DWORD_PTR dwParam2
  96. );
  97. void
  98. ConvertMIXERLINEWToMIXERLINEA(
  99. PMIXERLINEA pmxlA,
  100. PMIXERLINEW pmxlW
  101. );
  102. MMRESULT IMixerGetID(
  103. HMIXEROBJ hmxobj,
  104. PUINT puMxId,
  105. LPMIXERLINE pmxl,
  106. DWORD fdwId
  107. );
  108. /* -------------------------------------------------------------------------
  109. ** Loading and initialization functions
  110. ** -------------------------------------------------------------------------
  111. */
  112. BOOL mmDrvInstallMixer(
  113. HDRVR hdrvr,
  114. DRIVERMSGPROC drvMessage,
  115. UINT wFlags,
  116. LPCTSTR tszDrvEntry
  117. );
  118. BOOL IMixerUnloadDrivers(
  119. HDRVR hdrvrSelf
  120. );
  121. HDRVR mmDrvOpenMixer(
  122. LPTSTR szAlias
  123. );
  124. BOOL IMixerLoadDrivers(
  125. void
  126. );
  127. /* -------------------------------------------------------------------------
  128. ** Make sizeof return the number of chars when applied to a character array
  129. ** which may be unicoded.
  130. ** -------------------------------------------------------------------------
  131. */
  132. #ifdef UNICODE
  133. #define SIZEOF(x) (sizeof(x)/sizeof(WCHAR))
  134. #else
  135. #define SIZEOF(x) sizeof(x)
  136. #endif