46 case 0:
return "0=NOERROR";
47#define X(label) case label: return #label ;
125 static char name[20];
136 trace(
"skipping spurious message %04x\n",
msg->message);
143#define test_notification(hwnd, command, type) test_notification_dbg(hwnd, command, type, __LINE__)
160 ok_(__FILE__,
line)(
msg.hwnd ==
hwnd,
"Didn't get the handle to our test window\n");
202 ok(!
buf[0],
"error buffer %s\n",
buf);
207 ok(!
buf[0],
"open error buffer %s\n",
buf);
231 ok(!
buf[0],
"set error buffer %s\n",
buf);
240 ok(!
buf[0],
"status error buffer %s\n",
buf);
305 if(!
err)
ok(!
strcmp(
buf,
"0"),
"sysinfo digitalvideo quantity returned %s\n",
buf);
310 if(!
err)
ok(!
strcmp(
buf,
"1"),
"sysinfo digitalvideo quantity open returned %s\n",
buf);
319 ok(!
buf[0],
"pause error buffer %s\n",
buf);
385 const char command_open[] =
"open new type waveaudio alias mysound notify";
386 const char command_close_my[] =
"close mysound notify";
387 const char command_close_all[] =
"close all notify";
388 const char command_sysinfo[] =
"sysinfo waveaudio quantity open";
390 DWORD intbuf[3] = { 0xDEADF00D, 99, 0xABADCAFE };
405 if(!
err)
ok(
atoi(
buf)==intbuf[1],
"sysinfo all quantity string and command differ\n");
410 "mciCommand sysinfo with too small buffer returned %s\n",
dbg_mcierr(
err));
420 ok(!
err,
"mciGetDeviceIDA waveaudio returned %u, expected 0\n",
err);
432 ok(!
strcmp(
buf,
"milliseconds"),
"mci status time format: %s\n",
buf);
433 else trace(
"locale-dependent time format: %s (ms)\n",
buf);
489 ok(!
strcmp(
buf,
err ?
"Y" :
"mysound"),
"sysinfo short name returned %s\n",
buf);
509 ok(!
buf[0],
"sysinfo error buffer %s\n",
buf);
576 ok(!
err,
"mci %s (with output buffer) returned %s\n", command_close_all,
dbg_mcierr(
err));
577 ok(
buf[0] == 0,
"mci %s output buffer: %s\n", command_close_all,
buf);
584 ok(
buf[0] ==
'0' &&
buf[1] == 0,
"mci %s, expected output buffer '0', got: '%s'\n", command_sysinfo,
buf);
601 ok(0xDEADF00D==intbuf[0] && 0xABADCAFE==intbuf[2],
"DWORD buffer corruption\n");
604 ok(
err == 1,
"mciGetDeviceIDA waveaudio returned %u, expected 1\n",
err);
646 ok(
err == wDeviceID,
"mciGetDeviceIDA x returned %u, expected %u\n",
err, wDeviceID);
650 ok(!
err,
"mciGetDeviceIDA waveaudio returned %u, expected 0\n",
err);
664 ok(!
buf[0],
"info error buffer %s\n",
buf);
673 if(!
err)
ok(!
strcmp(
buf,
"11025"),
"mci status samplespersec expected 11025, got: %s\n",
buf);
689 err =
mciSendStringA(
"set x bytespersec 22050 alignment 2 samplespersec 11025 channels 1 bitspersample 16",
NULL, 0,
NULL);
718 ok(!ok_pcm || !parm.
caps.
dwReturn,
"No input device accepts PCM!?\n");
723 ok(
err || !ok_pcm,
"can record yet set wave format pcm returned %s\n",
dbg_mcierr(ok_pcm));
728 skip(
"Please install audio driver. Everything is skipped.\n");
773 todo_wine ok(
FALSE,
"Save must not rename the original file; DeleteFileA returned %d\n",
805 skip(
"Cannot open waveaudio!tempfile.wav for playing (%s), skipping\n",
dbg_mcierr(
err));
810 ok(
err == 1,
"mciGetDeviceIDA mysound returned %u, expected 1\n",
err);
813 ok(!
err,
"mciGetDeviceIDA tempfile.wav returned %u, expected 0\n",
err);
816 ok(!
err,
"mciGetDeviceIDA waveaudio returned %u, expected 0\n",
err);
856 ok(!
strcmp(
buf,
"stopped"),
"mci status mode: %s after play from 0 to 0\n",
buf);
948 ok(wDeviceID,
"mci open DeviceID: %d\n", wDeviceID);
952 ok(
err == wDeviceID,
"mciGetDeviceIDA alias returned %u, expected %u\n",
err, wDeviceID);
956 ok(!
err,
"mciGetDeviceIDA tempfile.wav returned %u, expected 0\n",
err);
959 ok(!
err,
"mciGetDeviceIDA waveaudio returned %u, expected 0\n",
err);
982 trace(
"position after Sleep: %sms\n",
buf);
987 todo_wine ok(350 <= p2 && p2 <= 600,
"%ums is not in the expected 350-600ms range\n", p2);
994 ok(350 <= p2 && p2 <= 1000,
"%ums is not even in the expected 350-1000ms range\n", p2);
1008 trace(
"position while paused: %sms\n",
buf);
1010 ok(p1>=p2,
"position not increasing: %u > %u\n", p2, p1);
1030 trace(
"position once stopped: %sms\n",
buf);
1033 ok(p2>=p1 && p2<=p1+16,
"position changed from %ums to %ums\n",p1,p2);
1115 ok(
strcmp(
buf,
"2000"),
"mci resume played to end\n");
1116 trace(
"position after resume: %sms\n",
buf);
1135 DWORD intbuf[3] = { 0xDEADF00D, 99, 0xABADCAFE };
1144 if(!
err)
ok(!
strcmp(
buf,
"0"),
"sysinfo quantity open expected 0, got: %s, some more tests will fail.\n",
buf);
1158 if(!
err)
trace(
"sysinfo dangling open alias: %s\n",
buf);
1176 skip(
"Cannot open tempfile.wav for auto-play, skipping\n");
1181 ok(!
err,
"mci sysinfo waveaudio quantity after auto-open returned %s\n",
dbg_mcierr(
err));
1182 if(!
err)
ok(!
strcmp(
buf,
"1"),
"sysinfo quantity open expected 1, got: %s\n",
buf);
1189 if(!
err)
ok(
atoi(
buf)==intbuf[1],
"sysinfo waveaudio quantity open string and command differ\n");
1192 ok(!
err,
"mci sysinfo waveaudio name after auto-open returned %s\n",
dbg_mcierr(
err));
1198 ok(
err == 1,
"mciGetDeviceIDA tempfile.wav returned %u, expected 1\n",
err);
1206 ok(!
err,
"mci status tempfile.wav mode without buffer returned %s\n",
dbg_mcierr(
err));
1214 if(!
err)
ok(!
strcmp(
buf,
"playing"),
"mci auto-open status mode, got: %s\n",
buf);
1236 trace(
"Wine style MCI auto-close upon notification\n");
1239 ok(!
strcmp(
buf,
"playing"),
"mci auto-open status mode notify, got: %s\n",
buf);
1251 trace(
"MS style MCI auto-open forbids notification\n");
1258 if(!
err)
ok(!
strcmp(
buf,
"paused"),
"mci auto-open status mode, got: %s\n",
buf);
1267 ok(!
err,
"mci sysinfo waveaudio quantity open after close returned %s\n",
dbg_mcierr(
err));
1268 if(!
err)
ok(!
strcmp(
buf,
"0"),
"sysinfo quantity open expected 0 after auto-close, got: %s\n",
buf);
1276 if(!
err)
ok(!
strcmp(
buf,
"stopped"),
"mci re-auto-open status mode, got: %s\n",
buf);
1282 if(!
err)
ok(
atoi(
buf)==ndevs,
"Expected %d audio outputs, got %s\n", ndevs,
buf);
1286 if(!
err)
ok(!
strcmp(
buf,
"waveaudio"),
"mci capability device type response: %s\n",
buf);
1293 ok(0xDEADF00D==intbuf[0] && 0xABADCAFE==intbuf[2],
"DWORD buffer corruption\n");
1308 skip(
"Cannot open tempfile.wav type MPEGVideo for playing (%s), skipping\n",
dbg_mcierr(
err));
1313 ok(wDeviceID == 1,
"mciGetDeviceIDA mysound returned %u, expected 1\n", wDeviceID);
1328 "mciCommand status mode: %u\n", (
DWORD)status_parm.
dwReturn);
1361 ok(!
strcmp(
buf,
"1"),
"mci open deviceId: %s, expected 1\n",
buf);
1363 ok(wDeviceID,
"mci open DeviceID: %d\n", wDeviceID);
1418 ok(mr == 0 || mr ==
ok_saved,
"open gave: 0x%x\n", mr);
1420 skip(
"Cannot open tempfile.wav for playing (%s), skipping\n",
dbg_mcierr(mr));
1433 ok(mr == 0,
"close gave: 0x%x\n", mr);
1459 skip(
"No output devices available, skipping all output tests\n");
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
#define WideCharToMultiByte
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
DWORD WINAPI GetCurrentDirectoryA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
BOOL WINAPI SetCurrentDirectoryA(IN LPCSTR lpPathName)
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
LCID WINAPI GetThreadLocale(void)
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
DWORD WINAPI mciSendCommandA(MCIDEVICEID wDevID, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
DWORD WINAPI mciSendStringA(LPCSTR lpstrCommand, LPSTR lpstrRet, UINT uRetLen, HWND hwndCallback)
DWORD WINAPI mciSendCommandW(MCIDEVICEID wDevID, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
UINT WINAPI mciGetDeviceIDA(LPCSTR lpstrName)
GLuint GLuint GLsizei GLenum type
GLenum GLuint GLenum GLsizei const GLchar * buf
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
#define trace_(file, line,...)
#define MCIERR_DEVICE_LOCKED
#define MCIERR_NOTIFY_ON_AUTO_OPEN
#define MCIERR_WAVE_INPUTSUNSUITABLE
#define MCIERR_WAVE_SETOUTPUTUNSUITABLE
#define MCIERR_FLAGS_NOT_COMPATIBLE
#define MCIERR_UNNAMED_RESOURCE
#define MCI_NOTIFY_SUPERSEDED
#define MCIERR_NEW_REQUIRES_ALIAS
#define MCIERR_INVALID_DEVICE_NAME
#define MCI_WAVE_SET_SAMPLESPERSEC
#define MCI_GETDEVCAPS_HAS_VIDEO
#define MCI_STATUS_POSITION
#define MCIERR_WAVE_SETINPUTUNSUITABLE
#define MCIERR_EXTRA_CHARACTERS
#define MCIERR_SEQ_PORTUNSPECIFIED
#define MMSYSERR_NOTSUPPORTED
#define MCIERR_MISSING_DEVICE_NAME
#define MCI_FORMAT_SAMPLES
#define MCI_FORMAT_MILLISECONDS
#define MCIERR_FILE_NOT_FOUND
#define MCIERR_CANNOT_LOAD_DRIVER
#define MCIERR_WAVE_SETINPUTINUSE
#define MCIERR_DEVICE_TYPE_REQUIRED
#define MCI_GETDEVCAPS_DEVICE_TYPE
#define MCIERR_SEQ_PORT_MISCERROR
#define MCIERR_SEQ_NOMIDIPRESENT
#define MCIERR_ILLEGAL_FOR_AUTO_OPEN
#define MCIERR_NO_CLOSING_QUOTE
#define MCIERR_DEVICE_NOT_READY
#define MCIERR_NO_IDENTITY
#define MCIERR_UNRECOGNIZED_COMMAND
#define MCIERR_DEVICE_ORD_LENGTH
#define MCIERR_SEQ_PORT_MAPNODEVICE
#define MCIERR_DUPLICATE_FLAGS
#define MCI_WAVE_SET_AVGBYTESPERSEC
#define MCIERR_FILENAME_REQUIRED
#define MCIERR_BAD_INTEGER
#define MCI_GETDEVCAPS_USES_FILES
#define MCIERR_EXTENSION_NOT_FOUND
#define MCI_ALL_DEVICE_ID
#define MCI_WAVE_GETDEVCAPS_INPUTS
#define MCIERR_WAVE_SETOUTPUTINUSE
#define MCIERR_FILE_WRITE
#define MCIERR_WAVE_OUTPUTUNSPECIFIED
#define MCIERR_BAD_CONSTANT
#define MCIERR_PARAM_OVERFLOW
#define MCIERR_INVALID_DEVICE_ID
#define MCI_SET_TIME_FORMAT
#define MCIERR_SEQ_PORT_NONEXISTENT
#define MCIERR_INVALID_FILE
#define MCIERR_DEVICE_OPEN
#define MCIERR_MISSING_PARAMETER
#define MCIERR_NULL_PARAMETER_BLOCK
#define MCI_NOTIFY_ABORTED
#define MCIERR_FILE_NOT_SAVED
#define MCIERR_DRIVER_INTERNAL
#define MCIERR_OUTOFRANGE
#define MCI_WAVE_SET_FORMATTAG
#define MCIERR_CREATEWINDOW
#define MCIERR_CANNOT_USE_ALL
#define MCIERR_NO_INTEGER
#define MCIERR_WAVE_INPUTUNSPECIFIED
#define MCIERR_OUT_OF_MEMORY
#define MCIERR_SEQ_PORT_INUSE
#define MCI_WAVE_SET_CHANNELS
#define MCI_GETDEVCAPS_ITEM
#define MCIERR_WAVE_OUTPUTSUNSUITABLE
#define MCI_SYSINFO_INSTALLNAME
#define MCIERR_UNRECOGNIZED_KEYWORD
#define MCI_WAVE_SET_BITSPERSAMPLE
#define MCI_DEVTYPE_WAVEFORM_AUDIO
#define MCIERR_WAVE_INPUTSINUSE
#define MCI_WAVE_SET_BLOCKALIGN
#define MCIERR_DEVICE_NOT_INSTALLED
#define MCIERR_DUPLICATE_ALIAS
#define MCIERR_MUST_USE_SHAREABLE
#define MCIERR_WAVE_OUTPUTSINUSE
#define MCI_NOTIFY_SUCCESSFUL
#define MCIERR_MISSING_COMMAND_STRING
#define MCIERR_PARSER_INTERNAL
#define MCIERR_MISSING_STRING_ARGUMENT
#define MCIERR_SEQ_DIV_INCOMPATIBLE
#define MCIERR_DEVICE_LENGTH
#define MCIERR_BAD_TIME_FORMAT
#define MCIERR_NONAPPLICABLE_FUNCTION
#define MCIERR_UNSUPPORTED_FUNCTION
#define MCIERR_NO_ELEMENT_ALLOWED
#define MCI_STATUS_TIME_FORMAT
#define MCI_SYSINFO_QUANTITY
#define sprintf(buf, format,...)
static const char * strw(LPCWSTR x)
#define todo_wine_if(is_todo)
static void test_recordWAVE(HWND hwnd)
static void test_asyncWAVE(HWND hwnd)
static void test_playWaveTypeMpegvideo(void)
const char * dbg_mcierr(MCIERROR err)
static void test_openCloseWAVE(HWND hwnd)
static void test_asyncWaveTypeMpegvideo(HWND hwnd)
static BOOL spurious_message(LPMSG msg)
static int strcmp_wa(LPCWSTR strw, const char *stra)
static void test_AutoOpenWAVE(HWND hwnd)
static void test_mciParser(HWND hwnd)
static void test_playWAVE(HWND hwnd)
static void test_notification_dbg(HWND hwnd, const char *command, WPARAM type, int line)
static void test_threads(void)
#define test_notification(hwnd, command, type)
static DWORD CALLBACK thread_cb(void *p)
#define LANGIDFROMLCID(l)
static char tmpdir[MAX_PATH]
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
MCI_GETDEVCAPS_PARMS caps
MCI_WAVE_OPEN_PARMSA open
DWORD WINAPI GetLastError(void)
UINT WINAPI waveOutGetNumDevs(void)
UINT WINAPI waveInGetNumDevs(void)
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI DestroyWindow(_In_ HWND)