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.

181 lines
5.0 KiB

  1. /****************************************************************************
  2. *
  3. * drvlib.h
  4. *
  5. * Multimedia kernel driver support component (mmdrv)
  6. *
  7. * Copyright (c) 1991-1994 Microsoft Corporation
  8. *
  9. * Local declarations :
  10. *
  11. * -- Debug
  12. * -- Device types
  13. * -- Routine prototypes
  14. *
  15. * History
  16. * 06-Oct-1993 - Robin Speed (RobinSp) wrote it
  17. *
  18. ***************************************************************************/
  19. /****************************************************************************
  20. General includes
  21. ***************************************************************************/
  22. #ifndef RC_INVOKED
  23. #include <string.h>
  24. #include <stdio.h>
  25. #endif /* RC_INVOKED */
  26. #include <windows.h>
  27. #include <mmsystem.h>
  28. #include <devioctl.h>
  29. #include <mmddk.h>
  30. #include <soundcfg.h>
  31. #if DBG
  32. #define STATIC
  33. #else
  34. #define STATIC
  35. #endif
  36. HINSTANCE hInstance;
  37. /***************************************************************************
  38. DEBUGGING SUPPORT
  39. ***************************************************************************/
  40. #if DBG
  41. #define DEBUG_RETAIL
  42. extern int mmdrvDebugLevel;
  43. extern void mmdrvDbgOut(LPSTR lpszFormat, ...);
  44. extern void dDbgAssert(LPSTR exp, LPSTR file, int line);
  45. DWORD __dwEval;
  46. #define dprintf( _x_ ) mmdrvDbgOut _x_
  47. #define dprintf1( _x_ ) if (mmdrvDebugLevel >= 1) mmdrvDbgOut _x_
  48. #define dprintf2( _x_ ) if (mmdrvDebugLevel >= 2) mmdrvDbgOut _x_
  49. #define dprintf3( _x_ ) if (mmdrvDebugLevel >= 3) mmdrvDbgOut _x_
  50. #define dprintf4( _x_ ) if (mmdrvDebugLevel >= 4) mmdrvDbgOut _x_
  51. #define WinAssert(exp) \
  52. ((exp) ? (void)0 : dDbgAssert(#exp, __FILE__, __LINE__))
  53. #define WinEval(exp) \
  54. ((__dwEval=(DWORD)(exp)) ? (void)0 : dDbgAssert(#exp, __FILE__, __LINE__), __dwEval)
  55. #else
  56. #define WinAssert(x) 0
  57. #define WinEval(exp) exp
  58. #define dprintf(x)
  59. #define dprintf1(x)
  60. #define dprintf2(x)
  61. #define dprintf3(x)
  62. #define dprintf4(x)
  63. #endif
  64. #define D1 dprintf1
  65. #define D2 dprintf2
  66. #define D3 dprintf3
  67. /****************************************************************************
  68. Our heap
  69. ****************************************************************************/
  70. HANDLE hHeap;
  71. /****************************************************************************
  72. Our serialization
  73. ****************************************************************************/
  74. CRITICAL_SECTION mmDrvCritSec; // Serialize access to device lists
  75. /****************************************************************************
  76. Local routines
  77. ***************************************************************************/
  78. BOOL DrvLibInit(HINSTANCE hModule, ULONG Reason, PCONTEXT pContext);
  79. DWORD sndTranslateStatus(void);
  80. MMRESULT sndOpenDev(UINT DeviceType, DWORD dwId,
  81. PHANDLE phDev, DWORD Access);
  82. DWORD sndGetNumDevs(UINT DeviceType);
  83. MMRESULT sndSetData(UINT DeviceType, UINT DeviceId, UINT Length, PBYTE Data,
  84. ULONG Ioctl);
  85. MMRESULT sndGetData(UINT DeviceType, UINT DeviceId, UINT Length, PBYTE Data,
  86. ULONG Ioctl);
  87. MMRESULT sndGetHandleData(HANDLE hDev,
  88. DWORD dwSize,
  89. PVOID pData,
  90. ULONG Ioctl,
  91. HANDLE hEvent);
  92. MMRESULT sndSetHandleData(HANDLE hDev,
  93. DWORD dwSize,
  94. PVOID pData,
  95. ULONG Ioctl,
  96. HANDLE hEvent);
  97. BOOL sndFindDeviceInstanceData(DWORD DeviceType,
  98. DWORD dwId,
  99. PVOID *InstanceData);
  100. BOOL sndSetDeviceInstanceData(DWORD DeviceType,
  101. DWORD dwId,
  102. PVOID InstanceData);
  103. PVOID sndLoadDeviceData(DWORD DeviceType,
  104. DWORD dwId,
  105. LPDWORD pSize);
  106. MMRESULT sndFindDevices(VOID);
  107. VOID TerminateWave(VOID);
  108. VOID TerminateMidi(VOID);
  109. DWORD midiGetDevCaps(DWORD id, UINT DeviceType, LPBYTE lpCaps, DWORD dwSize);
  110. void InternalLoadString(UINT StringId, LPTSTR pszString, UINT Length);
  111. /****************************************************************************
  112. Our local driver procs
  113. ****************************************************************************/
  114. DWORD APIENTRY widMessage(DWORD, DWORD, DWORD_PTR, DWORD_PTR, DWORD_PTR);
  115. DWORD APIENTRY wodMessage(DWORD, DWORD, DWORD_PTR, DWORD_PTR, DWORD_PTR);
  116. DWORD APIENTRY midMessage(DWORD, DWORD, DWORD_PTR, DWORD_PTR, DWORD_PTR);
  117. DWORD APIENTRY modMessage(DWORD, DWORD, DWORD_PTR, DWORD_PTR, DWORD_PTR);
  118. DWORD APIENTRY mxdMessage(UINT, UINT, DWORD_PTR, DWORD_PTR, DWORD_PTR);
  119. DWORD APIENTRY auxMessage(UINT, UINT, DWORD_PTR, DWORD_PTR, DWORD_PTR);
  120. /****************************************************************************
  121. Private messages supported by the library
  122. ****************************************************************************/
  123. #define WIDM_LOWPRIORITY 0x4093
  124.