42 static char msg[1024];
43 static char long_msg[1100];
48 sprintf(long_msg,
"waveInGetErrorTextA(%x) failed with error %x",
error, rc);
66 trace(
"waveInGetPosition(%s): TIME_BYTES not supported, returned %s\n",
69 ok(returned ==
bytes,
"waveInGetPosition(%s): returned %d bytes, "
77 trace(
"waveInGetPosition(%s): TIME_SAMPLES not supported, "
80 ok(returned ==
bytes,
"waveInGetPosition(%s): returned %d samples, "
89 trace(
"waveInGetPosition(%s): TIME_MS not supported, returned %s\n",
92 ok(returned ==
bytes,
"waveInGetPosition(%s): returned %d ms, "
101 trace(
"waveInGetPosition(%s): TIME_SMPTE not supported, returned %s\n",
104 ok(returned ==
bytes,
"waveInGetPosition(%s): SMPTE test failed\n",
112 trace(
"waveInGetPosition(%s): TIME_MIDI not supported, returned %s\n",
115 ok(returned ==
bytes,
"waveInGetPosition(%s): MIDI test failed\n",
123 trace(
"waveInGetPosition(%s): TIME_TICKS not supported, returned %s\n",
126 ok(returned ==
bytes,
"waveInGetPosition(%s): TICKS test failed\n",
156 "waveInOpen(%s): format=%dx%2dx%d flags=%x(%s) rc=%s\n",
161 trace(
" Reason: The device lists this format as supported in its "
162 "capabilities but opening it failed.\n");
165 trace(
"waveInOpen(%s): format=%dx%2dx%d %s rc=%s failed but format "
180 "got the wrong format: %dx%2dx%d instead of %dx%2dx%d\n",
202 trace(
"Recording for 1 second at %5dx%2dx%d %s %s\n",
222 "frag.dwBytesRecorded=%d, should=%d\n",
257 trace(
"Playing back recorded sound\n");
264 "waveOutOpen(%s) format=%dx%2dx%d flags=CALLBACK_EVENT rc=%s\n",
290 trace(
"Unable to play back the recorded sound\n");
321 "waveInGetDevCapsA(%s): failed to get capabilities: rc=%s\n",
328 "waveInGetDevCapsW(%s): MMSYSERR_NOERROR or MMSYSERR_NOTSUPPORTED "
333 "waveInGetDevCapsA(%s): MMSYSERR_INVALPARAM expected, got %s\n",
338 "waveInGetDevCapsW(%s): MMSYSERR_INVALPARAM or MMSYSERR_NOTSUPPORTED "
346 "waveInGetDevCapsA(%s): MMSYSERR_INVALPARAM expected, got %s\n",
351 "waveInGetDevCapsW(%s): MMSYSERR_INVALPARAM or MMSYSERR_NOTSUPPORTED "
357 "waveInGetDevCapsA(%s): MMSYSERR_NOERROR expected, got %s\n",
363 "waveInGetDevCapsW(%s): unexpected return value %s\n",
371 "waveInMessage(%s): failed to get interface size: rc=%s\n",
380 "got an incorrect size %d\n",
size);
389 strcpy(nameA,
"not supported");
395 trace(
" channels=%d formats=%05x\n",
421 ok(twoPages!=
NULL,
"Failed to allocate 2 pages of memory\n");
425 ok(
res,
"Failed to set memory access on second page\n");
450 format.nSamplesPerSec=8000;
463 trace(
"waveInOpen(%s): WAVE_FORMAT_MULAW not supported\n",
469 format.nSamplesPerSec=22050;
482 trace(
"waveInOpen(%s): WAVE_FORMAT_ADPCM not supported\n",
507 trace(
"waveInOpen(%s): WAVE_FORMAT_EXTENSIBLE not supported\n",
532 trace(
"waveInOpen(%s): 4 channels not supported\n",
557 trace(
"waveInOpen(%s): 6 channels not supported\n",
585 trace(
"waveInOpen(%s): 24 bit samples not supported\n",
611 trace(
"waveInOpen(%s): 32 bit samples not supported\n",
636 trace(
"waveInOpen(%s): 32 bit float samples not supported\n",
651 trace(
"found %d WaveIn devices\n",ndev);
657 rc ==
MMSYSERR_NOERROR,
"waveInMessage(DRVM_MAPPER_PREFERRED_GET) failed: %u\n", rc);
660 ok((ndev == 0 && (preferred == -1 ||
broken(preferred != -1))) ||
661 preferred < ndev,
"Got invalid preferred device: 0x%x\n", preferred);
666 "waveInMessage(DRVM_MAPPER_PREFERRED_GET) failed: %u\n", rc);
671 "waveInMessage(DRVM_MAPPER_PREFERRED_GET) failed: %u\n", rc);
675 "waveInGetDevCapsA(%s): MMSYSERR_BADDEVICEID expected, got %s\n",
684 "waveInGetDevCapsW(%s): MMSYSERR_BADDEVICEID or MMSYSERR_NOTSUPPORTED "
695 format.nSamplesPerSec=44100;
701 "waveInOpen(%s): MMSYSERR_BADDEVICEID expected, got %s\n",
char * strcpy(char *DstString, const char *SrcString)
static unsigned char bytes[4]
static const WCHAR nameW[]
#define WAVE_FORMAT_MULAW
#define WAVE_FORMAT_ADPCM
#define HeapFree(x, y, z)
#define WideCharToMultiByte
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
#define DRV_QUERYDEVICEINTERFACESIZE
#define DRV_QUERYDEVICEINTERFACE
struct _WAVEFORMATEX * LPWAVEFORMATEX
#define DRVM_MAPPER_PREFERRED_GET
#define MMSYSERR_NOTSUPPORTED
#define MMSYSERR_NODRIVER
MMRESULT WINAPI waveInGetErrorTextA(_In_ MMRESULT mmrError, _Out_writes_(cchText) LPSTR pszText, _In_ UINT cchText)
#define MMSYSERR_INVALPARAM
#define MMSYSERR_ALLOCATED
#define MMSYSERR_INVALFLAG
#define MMSYSERR_BADDEVICEID
#define WAVE_FORMAT_DIRECT
#define MMSYSERR_NOTENABLED
#define sprintf(buf, format,...)
static const char * get_format_str(WORD format)
static const unsigned int win_formats[][4]
static const char * wave_in_error(MMRESULT error)
static void wave_in_tests(void)
static void wave_in_test_deviceIn(int device, WAVEFORMATEX *pwfx, DWORD format, DWORD flags, WAVEINCAPSA *pcaps)
static void wave_in_test_device(UINT_PTR device)
static void check_position(int device, HWAVEIN win, DWORD bytes, LPWAVEFORMATEX pwfx)
const char * mmsys_error(MMRESULT error)
const char * dev_name(int device)
const char * wave_time_format(UINT type)
const char * wave_out_error(MMRESULT error)
DWORD time_to_bytes(LPMMTIME mmtime, LPWAVEFORMATEX pwfx)
const char * wave_open_flags(DWORD flags)
DWORD bytes_to_ms(DWORD bytes, LPWAVEFORMATEX pwfx)
unsigned __int3264 UINT_PTR
union WAVEFORMATEXTENSIBLE::@3019 Samples
union mmtime_tag::@3032 u
CHAR szPname[MAXPNAMELEN]
struct wavehdr_tag * lpNext
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
BOOL NTAPI VirtualProtect(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flNewProtect, OUT PDWORD lpflOldProtect)
BOOL NTAPI VirtualFree(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)
UINT WINAPI waveInGetPosition(HWAVEIN hWaveIn, LPMMTIME lpTime, UINT uSize)
UINT WINAPI waveInAddBuffer(HWAVEIN hWaveIn, WAVEHDR *lpWaveInHdr, UINT uSize)
UINT WINAPI waveInPrepareHeader(HWAVEIN hWaveIn, WAVEHDR *lpWaveInHdr, UINT uSize)
UINT WINAPI waveInStop(HWAVEIN hWaveIn)
UINT WINAPI waveInUnprepareHeader(HWAVEIN hWaveIn, WAVEHDR *lpWaveInHdr, UINT uSize)
UINT WINAPI waveOutWrite(HWAVEOUT hWaveOut, LPWAVEHDR lpWaveOutHdr, UINT uSize)
UINT WINAPI waveOutUnprepareHeader(HWAVEOUT hWaveOut, LPWAVEHDR lpWaveOutHdr, UINT uSize)
MMRESULT WINAPI waveOutOpen(LPHWAVEOUT lphWaveOut, UINT uDeviceID, LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
MMRESULT WINAPI waveInOpen(HWAVEIN *lphWaveIn, UINT uDeviceID, LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
UINT WINAPI waveInGetNumDevs(void)
UINT WINAPI waveInClose(HWAVEIN hWaveIn)
UINT WINAPI waveOutPrepareHeader(HWAVEOUT hWaveOut, WAVEHDR *lpWaveOutHdr, UINT uSize)
UINT WINAPI waveInStart(HWAVEIN hWaveIn)
UINT WINAPI waveInGetDevCapsA(UINT_PTR uDeviceID, LPWAVEINCAPSA lpCaps, UINT uSize)
UINT WINAPI waveInMessage(HWAVEIN hWaveIn, UINT uMessage, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
UINT WINAPI waveOutClose(HWAVEOUT hWaveOut)
UINT WINAPI waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSize)