winmm/tests: Call CoInitialize() to enable tests to run on Win 10.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2016-09-08 11:48:20 +01:00 committed by Alexandre Julliard
parent 6d3e5f8441
commit 5b622cfd84
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,5 @@
TESTDLL = winmm.dll TESTDLL = winmm.dll
IMPORTS = winmm user32 advapi32 IMPORTS = winmm ole32 user32 advapi32
C_SRCS = \ C_SRCS = \
capture.c \ capture.c \

View File

@ -22,6 +22,7 @@
#include <stddef.h> #include <stddef.h>
#include "windows.h" #include "windows.h"
#include "mmsystem.h" #include "mmsystem.h"
#include "objbase.h"
#include "wine/test.h" #include "wine/test.h"
extern const char* mmsys_error(MMRESULT error); /* from wave.c */ extern const char* mmsys_error(MMRESULT error); /* from wave.c */
@ -835,10 +836,15 @@ static void test_midi_outfns(HWND hwnd)
START_TEST(midi) START_TEST(midi)
{ {
HWND hwnd = 0; HWND hwnd = 0;
CoInitialize(NULL); /* Needed for Win 10 */
if (1) /* select 1 for CALLBACK_WINDOW or 0 for CALLBACK_FUNCTION */ if (1) /* select 1 for CALLBACK_WINDOW or 0 for CALLBACK_FUNCTION */
hwnd = CreateWindowExA(0, "static", "winmm midi test", WS_POPUP, 0,0,100,100, hwnd = CreateWindowExA(0, "static", "winmm midi test", WS_POPUP, 0,0,100,100,
0, 0, 0, NULL); 0, 0, 0, NULL);
test_midi_infns(hwnd); test_midi_infns(hwnd);
test_midi_outfns(hwnd); test_midi_outfns(hwnd);
if (hwnd) DestroyWindow(hwnd); if (hwnd) DestroyWindow(hwnd);
CoUninitialize();
} }