18#define MAX_WAVE_BUFFER_SIZE 65536
26 DPRINT(
"Queueing wave buffer\n");
33 if ( ! wave_header->
lpData )
41 DPRINT(
"I was given a header which hasn't been prepared yet!\n");
48 DPRINT(
"I was given a header for a buffer which is already playing\n");
56 wave_header->
dwFlags &= ~WHDR_DONE;
68 previous_node = queue_node;
69 queue_node = queue_node->
lpNext;
73 queue_node = previous_node;
76 queue_node->
lpNext = wave_header;
81 if ( ! session_info->next_buffer )
84 session_info->next_buffer = wave_header;
106 header->dwFlags &= ~WHDR_INQUEUE;
116 DPRINT(
"Notifying client that buffer 0x%p is done\n",
header);
226 DPRINT(
"Thread was asked if OK to close device\n");
238 DPRINT(
"Terminating thread...\n");
245 DPRINT(
"INVALID FUNCTION\n");
275 DPRINT(
"Wave processing thread setting ready state\n");
290 DPRINT(
"Wave processing thread woken up\n");
296 DPRINT(
"Processing thread request\n");
303 DPRINT(
"Performing wave I/O\n");
307 DPRINT(
"Wave processing thread sleeping\n");
353 DWORD bytes_returned;
358 DPRINT(
"SetWaveFormat\n");
375 DWORD wave_header_size)
BOOL GetDeviceData(LPD3D9_DEVICEDATA pDeviceData)
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
MMRESULT SetDeviceData(HANDLE device_handle, DWORD ioctl, PBYTE input_buffer, DWORD buffer_size)
#define WODM_SETPLAYBACKRATE
#define WODM_GETPLAYBACKRATE
MMRESULT QueueWaveBuffer(SessionInfo *session_info, LPWAVEHDR wave_header)
DWORD GetWaveFormatExSize(PWAVEFORMATEX format)
DWORD ProcessSessionThreadRequest(SessionInfo *session_info)
BOOL SetWaveFormat(HANDLE device_handle, PWAVEFORMATEX format)
VOID ReturnCompletedBuffers(SessionInfo *session_info)
DWORD QueryWaveFormat(DeviceType device_type, PVOID lpFormat)
DWORD WriteWaveBuffer(DWORD_PTR private_handle, PWAVEHDR wave_header, DWORD wave_header_size)
DWORD WaveThread(LPVOID parameter)
void MSVCRT() terminate()
#define IOCTL_WAVE_SET_FORMAT
#define IOCTL_WAVE_SET_PLAYBACK_RATE
#define IOCTL_WAVE_GET_PITCH
#define IOCTL_WAVE_GET_VOLUME
#define IOCTL_WAVE_SET_PITCH
#define IOCTL_WAVE_GET_PLAYBACK_RATE
MMRESULT CallSessionThread(SessionInfo *session_info, ThreadFunction function, PVOID thread_parameter)
VOID PerformWaveIO(SessionInfo *session_info)
BOOL NotifyClient(SessionInfo *session_info, DWORD message, DWORD_PTR parameter1, DWORD_PTR parameter2)
#define WAVERR_STILLPLAYING
struct pcmwaveformat_tag PCMWAVEFORMAT
#define MMSYSERR_INVALPARAM
#define WAVERR_UNPREPARED
HANDLE kernel_device_handle
struct wavehdr_tag * lpNext
DWORD WINAPI WaitForSingleObjectEx(IN HANDLE hHandle, IN DWORD dwMilliseconds, IN BOOL bAlertable)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
HANDLE WINAPI GetCurrentThread(void)
#define WAIT_IO_COMPLETION
#define THREAD_PRIORITY_TIME_CRITICAL