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.

179 lines
4.0 KiB

  1. /////////////////////////////////////////////////////////////////////
  2. //
  3. // Module: tssnd.h
  4. //
  5. // Copyright(C) Microsoft Corporation 2000
  6. //
  7. // History: 4-10-2000 vladimis [created]
  8. //
  9. /////////////////////////////////////////////////////////////////////
  10. #ifndef _TSSND_H
  11. #define _TSSND_H
  12. //
  13. // Includes
  14. //
  15. #include <nt.h>
  16. #include <ntrtl.h>
  17. #include <nturtl.h>
  18. #include <windows.h>
  19. #include <mmsystem.h>
  20. #include <mmreg.h>
  21. #include <mmddk.h>
  22. #include <winsock.h>
  23. #include "rdpstrm.h"
  24. //
  25. // Defines
  26. //
  27. #undef ASSERT
  28. #ifdef DBG
  29. #define TRC _DebugMessage
  30. #define ASSERT(_x_) if (!(_x_)) \
  31. { TRC(FATAL, "ASSERT failed, line %d, file %s\n", \
  32. __LINE__, __FILE__); DebugBreak(); }
  33. #else // !DBG
  34. #define TRC
  35. #define ASSERT
  36. #endif // !DBG
  37. #define TSHEAPINIT {g_hHeap = HeapCreate(0, 800, 0);}
  38. #define TSISHEAPOK (NULL != g_hHeap)
  39. #define TSMALLOC(_x_) HeapAlloc(g_hHeap, 0, _x_)
  40. #define TSREALLOC(_p_, _x_) \
  41. HeapReAlloc(g_hHeap, 0, _p_, _x_);
  42. #define TSFREE(_p_) HeapFree(g_hHeap, 0, _p_)
  43. #define TSHEAPDESTROY { HeapDestroy(g_hHeap); g_hHeap = 0; }
  44. #define TSSND_DRIVER_VERSION 1
  45. #define IDS_DRIVER_NAME 101
  46. #define IDS_VOLUME_NAME 102
  47. //
  48. // Constants
  49. //
  50. extern const CHAR *ALV;
  51. extern const CHAR *INF;
  52. extern const CHAR *WRN;
  53. extern const CHAR *ERR;
  54. extern const CHAR *FATAL;
  55. //
  56. // Structures
  57. //
  58. typedef struct _WAVEOUTCTX {
  59. HANDLE hWave; // handle passed by the user
  60. DWORD_PTR dwOpenFlags; //
  61. DWORD_PTR dwCallback; // callback parmeter
  62. DWORD_PTR dwInstance; // user's instance
  63. DWORD dwSamples; // samples played
  64. DWORD dwBytesPerSample; //
  65. DWORD dwXlateRate; //
  66. BOOL bPaused; // is the stream paused
  67. BOOL bDelayed;
  68. VOID (*lpfnPlace)(PVOID, PVOID, DWORD); // mixer fn
  69. BYTE cLastStreamPosition; // last position in the stream
  70. DWORD dwLastStreamOffset; //
  71. DWORD dwLastHeaderOffset; //
  72. DWORD Format_nBlockAlign; // current format params
  73. DWORD Format_nAvgBytesPerSec;
  74. DWORD Format_nChannels;
  75. HANDLE hNoDataEvent; // signaled when all blocks are done
  76. LONG lNumberOfBlocksPlaying; // number of blocks in the queue
  77. PWAVEHDR pFirstWaveHdr; // block list
  78. PWAVEHDR pFirstReadyHdr; // list of done blocks
  79. PWAVEHDR pLastReadyHdr;
  80. struct _WAVEOUTCTX *lpNext;
  81. } WAVEOUTCTX, *PWAVEOUTCTX;
  82. //
  83. // mixer context
  84. //
  85. typedef struct _MIXERCTX {
  86. PVOID pReserved;
  87. } MIXERCTX, *PMIXERCTX;
  88. //
  89. // Internal function definitions
  90. //
  91. //
  92. // Trace
  93. //
  94. VOID
  95. _cdecl
  96. _DebugMessage(
  97. LPCSTR szLevel,
  98. LPCSTR szFormat,
  99. ...
  100. );
  101. //
  102. // Threads
  103. //
  104. DWORD
  105. WINAPI
  106. waveMixerThread(
  107. PVOID pParam
  108. );
  109. LRESULT
  110. drvEnable(
  111. VOID
  112. );
  113. LRESULT
  114. drvDisable(
  115. VOID
  116. );
  117. BOOL
  118. _waveCheckSoundAlive(
  119. VOID
  120. );
  121. BOOL
  122. _waveAcquireStream(
  123. VOID
  124. );
  125. HANDLE
  126. _CreateInitEvent(
  127. VOID
  128. );
  129. BOOL
  130. _EnableMixerThread(
  131. VOID
  132. );
  133. BOOL
  134. AudioRedirDisabled(
  135. VOID
  136. );
  137. //
  138. // Globals
  139. //
  140. extern HANDLE g_hHeap; // private heap
  141. extern HINSTANCE g_hDllInst;
  142. extern CRITICAL_SECTION g_cs;
  143. extern HANDLE g_hMixerEvent;
  144. extern HANDLE g_hMixerThread;
  145. extern HANDLE g_hWaitToInitialize;
  146. extern HANDLE g_hDataReadyEvent;
  147. extern HANDLE g_hStreamIsEmptyEvent;
  148. extern HANDLE g_hStreamMutex;
  149. extern HANDLE g_hStream;
  150. extern PSNDSTREAM g_Stream;
  151. extern BOOL g_bMixerRunning;
  152. extern BOOL g_bPersonalTS;
  153. #endif // !_TSSND_H