ReactOS  0.4.14-dev-52-g6116262
mixer.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "mmsystem.h"
#include "winmm_test.h"
Include dependency graph for mixer.c:

Go to the source code of this file.

Macros

#define TYPE_TO_STR(x)   case x: return #x
 
#define TYPE_TO_STR(x)   case x: return #x
 
#define TYPE_TO_STR(x)   case x: return #x
 

Functions

static const charline_flags (DWORD fdwLine)
 
static const charcomponent_type (DWORD dwComponentType)
 
static const chartarget_type (DWORD dwType)
 
static const charcontrol_type (DWORD dwControlType)
 
static const charcontrol_flags (DWORD fdwControl)
 
static void test_mixerClose (HMIXER mix)
 
static void mixer_test_controlA (HMIXEROBJ mix, MIXERCONTROLA *control)
 
static void mixer_test_deviceA (int device)
 
static void mixer_test_controlW (HMIXEROBJ mix, MIXERCONTROLW *control)
 
static void mixer_test_deviceW (int device)
 
static void mixer_testsA (void)
 
static void mixer_testsW (void)
 
static void test_mixerOpen (void)
 
 START_TEST (mixer)
 

Macro Definition Documentation

◆ TYPE_TO_STR [1/3]

#define TYPE_TO_STR (   x)    case x: return #x

◆ TYPE_TO_STR [2/3]

#define TYPE_TO_STR (   x)    case x: return #x

◆ TYPE_TO_STR [3/3]

#define TYPE_TO_STR (   x)    case x: return #x

Function Documentation

◆ component_type()

static const char* component_type ( DWORD  dwComponentType)
static

Definition at line 66 of file mixer.c.

67 {
68 #define TYPE_TO_STR(x) case x: return #x
69  switch (dwComponentType) {
90  }
91 #undef TYPE_TO_STR
92  return "UNKNOWN";
93 }
#define MIXERLINE_COMPONENTTYPE_SRC_LINE
Definition: mmsystem.h:328
#define MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE
Definition: mmsystem.h:329
#define MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER
Definition: mmsystem.h:330
#define MIXERLINE_COMPONENTTYPE_SRC_ANALOG
Definition: mmsystem.h:336
#define MIXERLINE_COMPONENTTYPE_DST_MONITOR
Definition: mmsystem.h:318
#define MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY
Definition: mmsystem.h:335
#define MIXERLINE_COMPONENTTYPE_DST_UNDEFINED
Definition: mmsystem.h:315
#define MIXERLINE_COMPONENTTYPE_DST_DIGITAL
Definition: mmsystem.h:316
#define MIXERLINE_COMPONENTTYPE_SRC_DIGITAL
Definition: mmsystem.h:327
#define MIXERLINE_COMPONENTTYPE_DST_HEADPHONES
Definition: mmsystem.h:320
#define MIXERLINE_COMPONENTTYPE_DST_VOICEIN
Definition: mmsystem.h:323
#define MIXERLINE_COMPONENTTYPE_DST_TELEPHONE
Definition: mmsystem.h:321
#define MIXERLINE_COMPONENTTYPE_DST_SPEAKERS
Definition: mmsystem.h:319
#define MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED
Definition: mmsystem.h:326
#define MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT
Definition: mmsystem.h:334
#define MIXERLINE_COMPONENTTYPE_DST_WAVEIN
Definition: mmsystem.h:322
#define MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER
Definition: mmsystem.h:333
#define TYPE_TO_STR(x)
#define MIXERLINE_COMPONENTTYPE_SRC_TELEPHONE
Definition: mmsystem.h:332
#define MIXERLINE_COMPONENTTYPE_DST_LINE
Definition: mmsystem.h:317
#define MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC
Definition: mmsystem.h:331

Referenced by mixer_test_deviceA(), and mixer_test_deviceW().

◆ control_flags()

static const char* control_flags ( DWORD  fdwControl)
static

Definition at line 150 of file mixer.c.

151 {
152  static char flags[100];
153  BOOL first=TRUE;
154  flags[0]=0;
155  if (fdwControl&MIXERCONTROL_CONTROLF_UNIFORM) {
156  strcat(flags,"MIXERCONTROL_CONTROLF_UNIFORM");
157  first=FALSE;
158  }
159  if (fdwControl&MIXERCONTROL_CONTROLF_MULTIPLE) {
160  if (!first)
161  strcat(flags, "|");
162 
163  strcat(flags,"MIXERCONTROL_CONTROLF_MULTIPLE");
164  first=FALSE;
165  }
166 
167  if (fdwControl&MIXERCONTROL_CONTROLF_DISABLED) {
168  if (!first)
169  strcat(flags, "|");
170 
171  strcat(flags,"MIXERCONTROL_CONTROLF_DISABLED");
172  }
173 
174  return flags;
175 }
#define TRUE
Definition: types.h:120
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
const GLint * first
Definition: glext.h:5794
#define MIXERCONTROL_CONTROLF_UNIFORM
Definition: mmsystem.h:350
unsigned int BOOL
Definition: ntddk_ex.h:94
#define MIXERCONTROL_CONTROLF_DISABLED
Definition: mmsystem.h:352
GLbitfield flags
Definition: glext.h:7161
#define MIXERCONTROL_CONTROLF_MULTIPLE
Definition: mmsystem.h:351

Referenced by mixer_test_deviceA(), and mixer_test_deviceW().

◆ control_type()

static const char* control_type ( DWORD  dwControlType)
static

Definition at line 110 of file mixer.c.

111 {
112 #define TYPE_TO_STR(x) case x: return #x
113  switch (dwControlType) {
145  }
146 #undef TYPE_TO_STR
147  return "UNKNOWN";
148 }
#define MIXERCONTROL_CONTROLTYPE_MUX
Definition: mmsystem.h:403
#define MIXERCONTROL_CONTROLTYPE_QSOUNDPAN
Definition: mmsystem.h:396
#define MIXERCONTROL_CONTROLTYPE_SIGNEDMETER
Definition: mmsystem.h:379
#define MIXERCONTROL_CONTROLTYPE_BASS_BOOST
Definition: mmsystem.h:388
#define MIXERCONTROL_CONTROLTYPE_SINGLESELECT
Definition: mmsystem.h:402
#define MIXERCONTROL_CONTROLTYPE_STEREOENH
Definition: mmsystem.h:387
#define MIXERCONTROL_CONTROLTYPE_SIGNED
Definition: mmsystem.h:391
#define MIXERCONTROL_CONTROLTYPE_UNSIGNED
Definition: mmsystem.h:392
#define MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT
Definition: mmsystem.h:404
#define MIXERCONTROL_CONTROLTYPE_PERCENT
Definition: mmsystem.h:393
#define MIXERCONTROL_CONTROLTYPE_BASS
Definition: mmsystem.h:399
#define MIXERCONTROL_CONTROLTYPE_BOOLEANMETER
Definition: mmsystem.h:378
#define MIXERCONTROL_CONTROLTYPE_BOOLEAN
Definition: mmsystem.h:382
#define MIXERCONTROL_CONTROLTYPE_MONO
Definition: mmsystem.h:385
#define MIXERCONTROL_CONTROLTYPE_PAN
Definition: mmsystem.h:395
#define MIXERCONTROL_CONTROLTYPE_LOUDNESS
Definition: mmsystem.h:386
#define MIXERCONTROL_CONTROLTYPE_SLIDER
Definition: mmsystem.h:394
#define MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER
Definition: mmsystem.h:381
#define MIXERCONTROL_CONTROLTYPE_VOLUME
Definition: mmsystem.h:398
#define MIXERCONTROL_CONTROLTYPE_FADER
Definition: mmsystem.h:397
#define MIXERCONTROL_CONTROLTYPE_MUTE
Definition: mmsystem.h:384
#define MIXERCONTROL_CONTROLTYPE_CUSTOM
Definition: mmsystem.h:377
#define MIXERCONTROL_CONTROLTYPE_DECIBELS
Definition: mmsystem.h:390
#define MIXERCONTROL_CONTROLTYPE_ONOFF
Definition: mmsystem.h:383
#define TYPE_TO_STR(x)
#define MIXERCONTROL_CONTROLTYPE_TREBLE
Definition: mmsystem.h:400
#define MIXERCONTROL_CONTROLTYPE_MICROTIME
Definition: mmsystem.h:406
#define MIXERCONTROL_CONTROLTYPE_MILLITIME
Definition: mmsystem.h:407
#define MIXERCONTROL_CONTROLTYPE_MIXER
Definition: mmsystem.h:405
#define MIXERCONTROL_CONTROLTYPE_EQUALIZER
Definition: mmsystem.h:401
#define MIXERCONTROL_CONTROLTYPE_PEAKMETER
Definition: mmsystem.h:380
#define MIXERCONTROL_CONTROLTYPE_BUTTON
Definition: mmsystem.h:389

Referenced by mixer_test_deviceA(), mixer_test_deviceW(), msi_dialog_add_control(), and msi_dialog_create_controls().

◆ line_flags()

static const char* line_flags ( DWORD  fdwLine)
static

Definition at line 39 of file mixer.c.

40 {
41  static char flags[100];
42  BOOL first=TRUE;
43  flags[0]=0;
44  if (fdwLine&MIXERLINE_LINEF_ACTIVE) {
45  strcat(flags,"MIXERLINE_LINEF_ACTIVE");
46  first=FALSE;
47  }
48  if (fdwLine&MIXERLINE_LINEF_DISCONNECTED) {
49  if (!first)
50  strcat(flags, "|");
51 
52  strcat(flags,"MIXERLINE_LINEF_DISCONNECTED");
53  first=FALSE;
54  }
55 
56  if (fdwLine&MIXERLINE_LINEF_SOURCE) {
57  if (!first)
58  strcat(flags, "|");
59 
60  strcat(flags,"MIXERLINE_LINEF_SOURCE");
61  }
62 
63  return flags;
64 }
#define TRUE
Definition: types.h:120
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
const GLint * first
Definition: glext.h:5794
#define MIXERLINE_LINEF_SOURCE
Definition: mmsystem.h:313
unsigned int BOOL
Definition: ntddk_ex.h:94
#define MIXERLINE_LINEF_ACTIVE
Definition: mmsystem.h:311
#define MIXERLINE_LINEF_DISCONNECTED
Definition: mmsystem.h:312
GLbitfield flags
Definition: glext.h:7161

Referenced by mixer_test_deviceA(), and mixer_test_deviceW().

◆ mixer_test_controlA()

static void mixer_test_controlA ( HMIXEROBJ  mix,
MIXERCONTROLA control 
)
static

Definition at line 187 of file mixer.c.

188 {
189  MMRESULT rc;
190 
195 
196  details.cbStruct = sizeof(MIXERCONTROLDETAILS);
197  details.dwControlID = control->dwControlID;
198  details.cChannels = 1;
199  U(details).cMultipleItems = 0;
200  details.cbDetails = sizeof(value);
201 
202  /* test NULL paDetails */
203  details.paDetails = NULL;
206  "mixerGetDevCapsA: MMSYSERR_INVALPARAM expected, got %s\n",
207  mmsys_error(rc));
208 
209  /* read the current control value */
210  details.paDetails = &value;
212  ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
213  "MMSYSERR_NOERROR expected, got %s\n",
214  mmsys_error(rc));
216  MIXERCONTROLDETAILS new_details;
218 
219  trace(" Value=%d\n",value.dwValue);
220 
221  if (value.dwValue + control->Metrics.cSteps < S1(control->Bounds).dwMaximum)
222  new_value.dwValue = value.dwValue + control->Metrics.cSteps;
223  else
224  new_value.dwValue = value.dwValue - control->Metrics.cSteps;
225 
226  new_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
227  new_details.dwControlID = control->dwControlID;
228  new_details.cChannels = 1;
229  U(new_details).cMultipleItems = 0;
230  new_details.paDetails = &new_value;
231  new_details.cbDetails = sizeof(new_value);
232 
233  /* change the control value by one step */
235  ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
236  "MMSYSERR_NOERROR expected, got %s\n",
237  mmsys_error(rc));
238  if (rc==MMSYSERR_NOERROR) {
239  MIXERCONTROLDETAILS ret_details;
241 
242  ret_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
243  ret_details.dwControlID = control->dwControlID;
244  ret_details.cChannels = 1;
245  U(ret_details).cMultipleItems = 0;
246  ret_details.paDetails = &ret_value;
247  ret_details.cbDetails = sizeof(ret_value);
248 
249  /* read back the new control value */
251  ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
252  "MMSYSERR_NOERROR expected, got %s\n",
253  mmsys_error(rc));
254  if (rc==MMSYSERR_NOERROR) {
255  /* result may not match exactly because of rounding */
256  ok(abs(ret_value.dwValue-new_value.dwValue)<=1,
257  "Couldn't change value from %d to %d, returned %d\n",
258  value.dwValue,new_value.dwValue,ret_value.dwValue);
259 
260  if (abs(ret_value.dwValue-new_value.dwValue)<=1) {
261  details.cbStruct = sizeof(MIXERCONTROLDETAILS);
262  details.dwControlID = control->dwControlID;
263  details.cChannels = 1;
264  U(details).cMultipleItems = 0;
265  details.paDetails = &value;
266  details.cbDetails = sizeof(value);
267 
268  /* restore original value */
270  ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
271  "MMSYSERR_NOERROR expected, got %s\n",
272  mmsys_error(rc));
273  }
274  }
275  }
276  }
277  } else if ((control->dwControlType == MIXERCONTROL_CONTROLTYPE_MUTE) ||
282 
283  details.cbStruct = sizeof(MIXERCONTROLDETAILS);
284  details.dwControlID = control->dwControlID;
285  details.cChannels = 1;
286  U(details).cMultipleItems = 0;
287  details.paDetails = &value;
288  details.cbDetails = sizeof(value);
289 
291  ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
292  "MMSYSERR_NOERROR expected, got %s\n",
293  mmsys_error(rc));
295  MIXERCONTROLDETAILS new_details;
296  MIXERCONTROLDETAILS_BOOLEAN new_value;
297 
298  trace(" Value=%d\n",value.fValue);
299 
300  if (value.fValue == FALSE)
301  new_value.fValue = TRUE;
302  else
303  new_value.fValue = FALSE;
304 
305  new_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
306  new_details.dwControlID = control->dwControlID;
307  new_details.cChannels = 1;
308  U(new_details).cMultipleItems = 0;
309  new_details.paDetails = &new_value;
310  new_details.cbDetails = sizeof(new_value);
311 
312  /* change the control value by one step */
314  ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
315  "MMSYSERR_NOERROR expected, got %s\n",
316  mmsys_error(rc));
317  if (rc==MMSYSERR_NOERROR) {
318  MIXERCONTROLDETAILS ret_details;
319  MIXERCONTROLDETAILS_BOOLEAN ret_value;
320 
321  ret_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
322  ret_details.dwControlID = control->dwControlID;
323  ret_details.cChannels = 1;
324  U(ret_details).cMultipleItems = 0;
325  ret_details.paDetails = &ret_value;
326  ret_details.cbDetails = sizeof(ret_value);
327 
328  /* read back the new control value */
330  ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
331  "MMSYSERR_NOERROR expected, got %s\n",
332  mmsys_error(rc));
333  if (rc==MMSYSERR_NOERROR) {
334  /* result may not match exactly because of rounding */
335  ok(ret_value.fValue==new_value.fValue,
336  "Couldn't change value from %d to %d, returned %d\n",
337  value.fValue,new_value.fValue,ret_value.fValue);
338 
339  if (ret_value.fValue==new_value.fValue) {
340  details.cbStruct = sizeof(MIXERCONTROLDETAILS);
341  details.dwControlID = control->dwControlID;
342  details.cChannels = 1;
343  U(details).cMultipleItems = 0;
344  details.paDetails = &value;
345  details.cbDetails = sizeof(value);
346 
347  /* restore original value */
349  ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
350  "MMSYSERR_NOERROR expected, got %s\n",
351  mmsys_error(rc));
352  }
353  }
354  }
355  }
356  } else {
357  /* FIXME */
358  }
359 }
#define abs(i)
Definition: fconv.c:206
UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd, DWORD fdwDetails)
Definition: winmm.c:684
#define MIXER_GETCONTROLDETAILSF_VALUE
Definition: mmsystem.h:412
#define TRUE
Definition: types.h:120
UINT WINAPI mixerGetControlDetailsA(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdA, DWORD fdwDetails)
Definition: winmm.c:447
#define U(x)
Definition: wordpad.c:44
UINT MMRESULT
Definition: mmsystem.h:962
int winetest_interactive
union tagMIXERCONTROLA::@2916 Metrics
#define MIXERCONTROL_CONTROLTYPE_UNSIGNED
Definition: mmsystem.h:392
DWORD dwControlType
Definition: mmsystem.h:1280
#define MIXER_SETCONTROLDETAILSF_VALUE
Definition: mmsystem.h:415
smooth NULL
Definition: ftsmooth.c:416
#define MIXERCONTROL_CONTROLTYPE_BOOLEAN
Definition: mmsystem.h:382
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define trace
Definition: atltest.h:70
const char * mmsys_error(MMRESULT error)
Definition: wave.c:220
GLsizei const GLfloat * value
Definition: glext.h:6069
#define MIXERCONTROL_CONTROLTYPE_VOLUME
Definition: mmsystem.h:398
#define MIXERCONTROL_CONTROLTYPE_MUTE
Definition: mmsystem.h:384
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define ok(value,...)
Definition: atltest.h:57
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
Definition: winddi.h:3591
struct tMIXERCONTROLDETAILS MIXERCONTROLDETAILS
union tagMIXERCONTROLA::@2915 Bounds
int details
Definition: msacm.c:1353
#define MIXERCONTROL_CONTROLTYPE_BUTTON
Definition: mmsystem.h:389

Referenced by mixer_test_deviceA().

◆ mixer_test_controlW()

static void mixer_test_controlW ( HMIXEROBJ  mix,
MIXERCONTROLW control 
)
static

Definition at line 573 of file mixer.c.

574 {
575  MMRESULT rc;
576 
581 
582  details.cbStruct = sizeof(MIXERCONTROLDETAILS);
583  details.dwControlID = control->dwControlID;
584  details.cChannels = 1;
585  U(details).cMultipleItems = 0;
586  details.paDetails = &value;
587  details.cbDetails = sizeof(value);
588 
589  /* read the current control value */
591  ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
592  "MMSYSERR_NOERROR expected, got %s\n",
593  mmsys_error(rc));
595  MIXERCONTROLDETAILS new_details;
597 
598  trace(" Value=%d\n",value.dwValue);
599 
600  if (value.dwValue + control->Metrics.cSteps < S1(control->Bounds).dwMaximum)
601  new_value.dwValue = value.dwValue + control->Metrics.cSteps;
602  else
603  new_value.dwValue = value.dwValue - control->Metrics.cSteps;
604 
605  new_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
606  new_details.dwControlID = control->dwControlID;
607  new_details.cChannels = 1;
608  U(new_details).cMultipleItems = 0;
609  new_details.paDetails = &new_value;
610  new_details.cbDetails = sizeof(new_value);
611 
612  /* change the control value by one step */
614  ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
615  "MMSYSERR_NOERROR expected, got %s\n",
616  mmsys_error(rc));
617  if (rc==MMSYSERR_NOERROR) {
618  MIXERCONTROLDETAILS ret_details;
620 
621  ret_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
622  ret_details.dwControlID = control->dwControlID;
623  ret_details.cChannels = 1;
624  U(ret_details).cMultipleItems = 0;
625  ret_details.paDetails = &ret_value;
626  ret_details.cbDetails = sizeof(ret_value);
627 
628  /* read back the new control value */
630  ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
631  "MMSYSERR_NOERROR expected, got %s\n",
632  mmsys_error(rc));
633  if (rc==MMSYSERR_NOERROR) {
634  /* result may not match exactly because of rounding */
635  ok(abs(ret_value.dwValue-new_value.dwValue)<=1,
636  "Couldn't change value from %d to %d, returned %d\n",
637  value.dwValue,new_value.dwValue,ret_value.dwValue);
638 
639  if (abs(ret_value.dwValue-new_value.dwValue)<=1) {
640  details.cbStruct = sizeof(MIXERCONTROLDETAILS);
641  details.dwControlID = control->dwControlID;
642  details.cChannels = 1;
643  U(details).cMultipleItems = 0;
644  details.paDetails = &value;
645  details.cbDetails = sizeof(value);
646 
647  /* restore original value */
649  ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
650  "MMSYSERR_NOERROR expected, got %s\n",
651  mmsys_error(rc));
652  }
653  }
654  }
655  }
656  } else if ((control->dwControlType == MIXERCONTROL_CONTROLTYPE_MUTE) ||
661 
662  details.cbStruct = sizeof(MIXERCONTROLDETAILS);
663  details.dwControlID = control->dwControlID;
664  details.cChannels = 1;
665  U(details).cMultipleItems = 0;
666  details.paDetails = &value;
667  details.cbDetails = sizeof(value);
668 
670  ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
671  "MMSYSERR_NOERROR expected, got %s\n",
672  mmsys_error(rc));
674  MIXERCONTROLDETAILS new_details;
675  MIXERCONTROLDETAILS_BOOLEAN new_value;
676 
677  trace(" Value=%d\n",value.fValue);
678 
679  if (value.fValue == FALSE)
680  new_value.fValue = TRUE;
681  else
682  new_value.fValue = FALSE;
683 
684  new_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
685  new_details.dwControlID = control->dwControlID;
686  new_details.cChannels = 1;
687  U(new_details).cMultipleItems = 0;
688  new_details.paDetails = &new_value;
689  new_details.cbDetails = sizeof(new_value);
690 
691  /* change the control value by one step */
693  ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
694  "MMSYSERR_NOERROR expected, got %s\n",
695  mmsys_error(rc));
696  if (rc==MMSYSERR_NOERROR) {
697  MIXERCONTROLDETAILS ret_details;
698  MIXERCONTROLDETAILS_BOOLEAN ret_value;
699 
700  ret_details.cbStruct = sizeof(MIXERCONTROLDETAILS);
701  ret_details.dwControlID = control->dwControlID;
702  ret_details.cChannels = 1;
703  U(ret_details).cMultipleItems = 0;
704  ret_details.paDetails = &ret_value;
705  ret_details.cbDetails = sizeof(ret_value);
706 
707  /* read back the new control value */
709  ok(rc==MMSYSERR_NOERROR,"mixerGetControlDetails(MIXER_GETCONTROLDETAILSF_VALUE): "
710  "MMSYSERR_NOERROR expected, got %s\n",
711  mmsys_error(rc));
712  if (rc==MMSYSERR_NOERROR) {
713  /* result may not match exactly because of rounding */
714  ok(ret_value.fValue==new_value.fValue,
715  "Couldn't change value from %d to %d, returned %d\n",
716  value.fValue,new_value.fValue,ret_value.fValue);
717 
718  if (ret_value.fValue==new_value.fValue) {
719  details.cbStruct = sizeof(MIXERCONTROLDETAILS);
720  details.dwControlID = control->dwControlID;
721  details.cChannels = 1;
722  U(details).cMultipleItems = 0;
723  details.paDetails = &value;
724  details.cbDetails = sizeof(value);
725 
726  /* restore original value */
728  ok(rc==MMSYSERR_NOERROR,"mixerSetControlDetails(MIXER_SETCONTROLDETAILSF_VALUE): "
729  "MMSYSERR_NOERROR expected, got %s\n",
730  mmsys_error(rc));
731  }
732  }
733  }
734  }
735  } else {
736  /* FIXME */
737  }
738 }
#define abs(i)
Definition: fconv.c:206
UINT WINAPI mixerSetControlDetails(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd, DWORD fdwDetails)
Definition: winmm.c:684
#define MIXER_GETCONTROLDETAILSF_VALUE
Definition: mmsystem.h:412
#define TRUE
Definition: types.h:120
UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdW, DWORD fdwDetails)
Definition: winmm.c:426
DWORD dwControlType
Definition: mmsystem.h:1306
#define U(x)
Definition: wordpad.c:44
UINT MMRESULT
Definition: mmsystem.h:962
int winetest_interactive
#define MIXERCONTROL_CONTROLTYPE_UNSIGNED
Definition: mmsystem.h:392
union tagMIXERCONTROLW::@2920 Metrics
#define MIXER_SETCONTROLDETAILSF_VALUE
Definition: mmsystem.h:415
#define MIXERCONTROL_CONTROLTYPE_BOOLEAN
Definition: mmsystem.h:382
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define trace
Definition: atltest.h:70
const char * mmsys_error(MMRESULT error)
Definition: wave.c:220
GLsizei const GLfloat * value
Definition: glext.h:6069
union tagMIXERCONTROLW::@2919 Bounds
#define MIXERCONTROL_CONTROLTYPE_VOLUME
Definition: mmsystem.h:398
#define MIXERCONTROL_CONTROLTYPE_MUTE
Definition: mmsystem.h:384
#define ok(value,...)
Definition: atltest.h:57
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
Definition: winddi.h:3591
struct tMIXERCONTROLDETAILS MIXERCONTROLDETAILS
int details
Definition: msacm.c:1353
#define MIXERCONTROL_CONTROLTYPE_BUTTON
Definition: mmsystem.h:389

Referenced by mixer_test_deviceW().

◆ mixer_test_deviceA()

static void mixer_test_deviceA ( int  device)
static

Definition at line 361 of file mixer.c.

362 {
363  MIXERCAPSA capsA;
364  HMIXEROBJ mix;
365  MMRESULT rc;
366  DWORD d,s,ns,nc;
367 
368  rc=mixerGetDevCapsA(device,0,sizeof(capsA));
370  "mixerGetDevCapsA: MMSYSERR_INVALPARAM expected, got %s\n",
371  mmsys_error(rc));
372 
373  rc=mixerGetDevCapsA(device,&capsA,4);
374  ok(rc==MMSYSERR_NOERROR,
375  "mixerGetDevCapsA: MMSYSERR_NOERROR expected, got %s\n",
376  mmsys_error(rc));
377 
378  rc=mixerGetDevCapsA(device,&capsA,sizeof(capsA));
379  ok(rc==MMSYSERR_NOERROR,
380  "mixerGetDevCapsA: MMSYSERR_NOERROR expected, got %s\n",
381  mmsys_error(rc));
382 
383  if (winetest_interactive) {
384  trace(" %d: \"%s\" %d.%d (%d:%d) destinations=%d\n", device,
385  capsA.szPname, capsA.vDriverVersion >> 8,
386  capsA.vDriverVersion & 0xff,capsA.wMid,capsA.wPid,
387  capsA.cDestinations);
388  } else {
389  trace(" %d: \"%s\" %d.%d (%d:%d)\n", device,
390  capsA.szPname, capsA.vDriverVersion >> 8,
391  capsA.vDriverVersion & 0xff,capsA.wMid,capsA.wPid);
392  }
393 
394  rc = mixerOpen((HMIXER*)&mix, device, 0, 0, 0);
395  ok(rc==MMSYSERR_NOERROR,
396  "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",mmsys_error(rc));
397  if (rc==MMSYSERR_NOERROR) {
398  MIXERCAPSA capsA2;
399 
400  rc=mixerGetDevCapsA((UINT_PTR)mix,&capsA2,sizeof(capsA2));
401  ok(rc==MMSYSERR_NOERROR,
402  "mixerGetDevCapsA: MMSYSERR_NOERROR expected, got %s\n",
403  mmsys_error(rc));
404  ok(!strcmp(capsA2.szPname, capsA.szPname), "Got wrong device caps\n");
405 
406  for (d=0;d<capsA.cDestinations;d++) {
407  MIXERLINEA mixerlineA;
408  mixerlineA.cbStruct = 0;
409  mixerlineA.dwDestination=d;
412  "mixerGetLineInfoA(MIXER_GETLINEINFOF_DESTINATION): "
413  "MMSYSERR_INVALPARAM expected, got %s\n",
414  mmsys_error(rc));
415 
416  mixerlineA.cbStruct = sizeof(mixerlineA);
417  mixerlineA.dwDestination=capsA.cDestinations;
420  "mixerGetLineInfoA(MIXER_GETLINEINFOF_DESTINATION): "
421  "MMSYSERR_INVALPARAM or MIXERR_INVALLINE expected, got %s\n",
422  mmsys_error(rc));
423 
424  mixerlineA.cbStruct = sizeof(mixerlineA);
425  mixerlineA.dwDestination=d;
428  "mixerGetLineInfoA(MIXER_GETLINEINFOF_DESTINATION): "
429  "MMSYSERR_INVALPARAM expected, got %s\n",
430  mmsys_error(rc));
431 
432  mixerlineA.cbStruct = sizeof(mixerlineA);
433  mixerlineA.dwDestination=d;
434  rc = mixerGetLineInfoA(mix, &mixerlineA, -1);
436  "mixerGetLineInfoA(-1): MMSYSERR_INVALFLAG expected, got %s\n",
437  mmsys_error(rc));
438 
439  mixerlineA.cbStruct = sizeof(mixerlineA);
440  mixerlineA.dwDestination=d;
441  mixerlineA.dwUser = (ULONG_PTR)0xdeadbeef;
444  "mixerGetLineInfoA(MIXER_GETLINEINFOF_DESTINATION): "
445  "MMSYSERR_NOERROR expected, got %s\n",
446  mmsys_error(rc));
447  ok(mixerlineA.dwUser == 0, "dwUser was not reset\n");
448  if (rc==MMSYSERR_NODRIVER)
449  trace(" No Driver\n");
450  else if (rc==MMSYSERR_NOERROR) {
451  if (winetest_interactive) {
452  trace(" %d: \"%s\" (%s) Destination=%d Source=%d\n",
453  d,mixerlineA.szShortName, mixerlineA.szName,
454  mixerlineA.dwDestination,mixerlineA.dwSource);
455  trace(" LineID=%08x Channels=%d "
456  "Connections=%d Controls=%d\n",
457  mixerlineA.dwLineID,mixerlineA.cChannels,
458  mixerlineA.cConnections,mixerlineA.cControls);
459  trace(" State=0x%08x(%s)\n",
460  mixerlineA.fdwLine,line_flags(mixerlineA.fdwLine));
461  trace(" ComponentType=%s\n",
462  component_type(mixerlineA.dwComponentType));
463  trace(" Type=%s\n",
464  target_type(mixerlineA.Target.dwType));
465  trace(" Device=%d (%s) %d.%d (%d:%d)\n",
466  mixerlineA.Target.dwDeviceID,
467  mixerlineA.Target.szPname,
468  mixerlineA.Target.vDriverVersion >> 8,
469  mixerlineA.Target.vDriverVersion & 0xff,
470  mixerlineA.Target.wMid, mixerlineA.Target.wPid);
471  }
472  ns=mixerlineA.cConnections;
473  for(s=0;s<ns;s++) {
474  mixerlineA.cbStruct = sizeof(mixerlineA);
475  mixerlineA.dwDestination=d;
476  mixerlineA.dwSource=s;
477  rc = mixerGetLineInfoA(mix, &mixerlineA, MIXER_GETLINEINFOF_SOURCE);
479  "mixerGetLineInfoA(MIXER_GETLINEINFOF_SOURCE): "
480  "MMSYSERR_NOERROR expected, got %s\n",
481  mmsys_error(rc));
482  if (rc==MMSYSERR_NODRIVER)
483  trace(" No Driver\n");
484  else if (rc==MMSYSERR_NOERROR) {
486  MIXERLINECONTROLSA controls;
487  if (winetest_interactive) {
488  trace(" %d: \"%s\" (%s) Destination=%d Source=%d\n",
489  s,mixerlineA.szShortName, mixerlineA.szName,
490  mixerlineA.dwDestination,mixerlineA.dwSource);
491  trace(" LineID=%08x Channels=%d "
492  "Connections=%d Controls=%d\n",
493  mixerlineA.dwLineID,mixerlineA.cChannels,
494  mixerlineA.cConnections,mixerlineA.cControls);
495  trace(" State=0x%08x(%s)\n",
496  mixerlineA.fdwLine,line_flags(mixerlineA.fdwLine));
497  trace(" ComponentType=%s\n",
498  component_type(mixerlineA.dwComponentType));
499  trace(" Type=%s\n",
500  target_type(mixerlineA.Target.dwType));
501  trace(" Device=%d (%s) %d.%d (%d:%d)\n",
502  mixerlineA.Target.dwDeviceID,
503  mixerlineA.Target.szPname,
504  mixerlineA.Target.vDriverVersion >> 8,
505  mixerlineA.Target.vDriverVersion & 0xff,
506  mixerlineA.Target.wMid, mixerlineA.Target.wPid);
507  }
508  if (mixerlineA.cControls) {
510  mixerlineA.cControls*sizeof(MIXERCONTROLA));
511  if (array) {
512  memset(&controls, 0, sizeof(controls));
513 
516  "mixerGetLineControlsA(MIXER_GETLINECONTROLSF_ALL): "
517  "MMSYSERR_INVALPARAM expected, got %s\n",
518  mmsys_error(rc));
519 
520  rc = mixerGetLineControlsA(mix, &controls, -1);
522  "mixerGetLineControlsA(-1): "
523  "MMSYSERR_INVALFLAG or MMSYSERR_INVALPARAM expected, got %s\n",
524  mmsys_error(rc));
525 
526  controls.cbStruct = sizeof(MIXERLINECONTROLSA);
527  controls.cControls = mixerlineA.cControls;
528  controls.dwLineID = mixerlineA.dwLineID;
529  controls.pamxctrl = array;
530  controls.cbmxctrl = sizeof(MIXERCONTROLA);
531 
532  /* FIXME: do MIXER_GETLINECONTROLSF_ONEBYID
533  * and MIXER_GETLINECONTROLSF_ONEBYTYPE
534  */
536  ok(rc==MMSYSERR_NOERROR,
537  "mixerGetLineControlsA(MIXER_GETLINECONTROLSF_ALL): "
538  "MMSYSERR_NOERROR expected, got %s\n",
539  mmsys_error(rc));
540  if (rc==MMSYSERR_NOERROR) {
541  for(nc=0;nc<mixerlineA.cControls;nc++) {
542  if (winetest_interactive) {
543  trace(" %d: \"%s\" (%s) ControlID=%d\n", nc,
544  array[nc].szShortName,
545  array[nc].szName, array[nc].dwControlID);
546  trace(" ControlType=%s\n",
547  control_type(array[nc].dwControlType));
548  trace(" Control=0x%08x(%s)\n",
549  array[nc].fdwControl,
550  control_flags(array[nc].fdwControl));
551  trace(" Items=%d Min=%d Max=%d Step=%d\n",
552  array[nc].cMultipleItems,
553  S1(array[nc].Bounds).dwMinimum,
554  S1(array[nc].Bounds).dwMaximum,
555  array[nc].Metrics.cSteps);
556  }
557 
559  }
560  }
561 
563  }
564  }
565  }
566  }
567  }
568  }
569  test_mixerClose((HMIXER)mix);
570  }
571 }
DWORD fdwLine
Definition: mmsystem.h:1236
#define MIXER_GETLINECONTROLSF_ALL
Definition: mmsystem.h:408
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1217
DWORD dwUser
Definition: mmsystem.h:1237
static void mixer_test_controlA(HMIXEROBJ mix, MIXERCONTROLA *control)
Definition: mixer.c:187
#define S1(x)
Definition: test.h:191
struct tagMIXERLINECONTROLSA MIXERLINECONTROLSA
UINT MMRESULT
Definition: mmsystem.h:962
#define MIXERR_INVALLINE
Definition: mmsystem.h:295
int winetest_interactive
MMVERSION vDriverVersion
Definition: mmsystem.h:1216
static const char * control_type(DWORD dwControlType)
Definition: mixer.c:110
CHAR szShortName[MIXER_SHORT_NAME_CHARS]
Definition: mmsystem.h:1242
DWORD cControls
Definition: mmsystem.h:1241
#define MMSYSERR_NODRIVER
Definition: mmsystem.h:102
LPMIXERCONTROLA pamxctrl
Definition: mmsystem.h:1338
struct tagMIXERLINEA::@2913 Target
Definition: devices.h:37
#define MIXER_GETLINEINFOF_DESTINATION
Definition: mmsystem.h:344
UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
Definition: winmm.c:342
DWORD cConnections
Definition: mmsystem.h:1240
DWORD dwLineID
Definition: mmsystem.h:1235
DWORD dwMinimum
Definition: mmsystem.h:1291
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define GetProcessHeap()
Definition: compat.h:395
#define trace
Definition: atltest.h:70
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define d
Definition: ke_i.h:81
UINT WINAPI mixerGetLineInfoA(HMIXEROBJ hmix, LPMIXERLINEA lpmliA, DWORD fdwInfo)
Definition: winmm.c:615
struct tagMIXERCONTROLA MIXERCONTROLA
unsigned long DWORD
Definition: ntddk_ex.h:95
UINT WINAPI mixerGetLineControlsA(HMIXEROBJ hmix, LPMIXERLINECONTROLSA lpmlcA, DWORD fdwControls)
Definition: winmm.c:506
CHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1243
#define MMSYSERR_INVALFLAG
Definition: mmsystem.h:106
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
Definition: mxnamespace.c:44
static void test_mixerClose(HMIXER mix)
Definition: mixer.c:177
DWORD cChannels
Definition: mmsystem.h:1239
static const char * control_flags(DWORD fdwControl)
Definition: mixer.c:150
GLdouble s
Definition: gl.h:2039
const char * mmsys_error(MMRESULT error)
Definition: wave.c:220
DWORD dwMaximum
Definition: mmsystem.h:1292
DWORD dwDestination
Definition: mmsystem.h:1233
DWORD cDestinations
Definition: mmsystem.h:1219
UINT WINAPI mixerGetDevCapsA(UINT_PTR uDeviceID, LPMIXERCAPSA lpCaps, UINT uSize)
Definition: winmm.c:291
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
DWORD cbStruct
Definition: mmsystem.h:1232
#define MIXER_GETLINEINFOF_SOURCE
Definition: mmsystem.h:345
DWORD dwSource
Definition: mmsystem.h:1234
#define ok(value,...)
Definition: atltest.h:57
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
Definition: winddi.h:3591
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
DWORD dwComponentType
Definition: mmsystem.h:1238
static const WCHAR szName[]
Definition: msipriv.h:1194
static const char * component_type(DWORD dwComponentType)
Definition: mixer.c:66
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define ULONG_PTR
Definition: config.h:101
static const char * line_flags(DWORD fdwLine)
Definition: mixer.c:39
#define memset(x, y, z)
Definition: compat.h:39
#define HeapFree(x, y, z)
Definition: compat.h:394
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum GLdouble GLenum GLint GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLenum GLfloat GLenum GLfloat GLenum GLushort const GLubyte GLenum GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLvoid GLenum GLenum GLint GLenum GLint GLenum GLint GLuint GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble const GLfloat GLenum const GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLint GLint GLsizei GLsizei GLenum GLuint GLenum array
Definition: glfuncs.h:320
static const char * target_type(DWORD dwType)
Definition: mixer.c:95

Referenced by mixer_testsA().

◆ mixer_test_deviceW()

static void mixer_test_deviceW ( int  device)
static

Definition at line 740 of file mixer.c.

741 {
742  MIXERCAPSW capsW;
743  HMIXEROBJ mix;
744  MMRESULT rc;
745  DWORD d,s,ns,nc;
746  char szShortName[MIXER_SHORT_NAME_CHARS];
748  char szPname[MAXPNAMELEN];
749 
750  rc=mixerGetDevCapsW(device,0,sizeof(capsW));
752  "mixerGetDevCapsW: MMSYSERR_INVALPARAM expected, got %s\n",
753  mmsys_error(rc));
754 
755  rc=mixerGetDevCapsW(device,&capsW,4);
756  ok(rc==MMSYSERR_NOERROR ||
757  rc==MMSYSERR_INVALPARAM, /* Vista and W2K8 */
758  "mixerGetDevCapsW: MMSYSERR_NOERROR or MMSYSERR_INVALPARAM expected, got %s\n",
759  mmsys_error(rc));
760 
761  rc=mixerGetDevCapsW(device,&capsW,sizeof(capsW));
762  ok(rc==MMSYSERR_NOERROR,
763  "mixerGetDevCapsW: MMSYSERR_NOERROR expected, got %s\n",
764  mmsys_error(rc));
765 
768  if (winetest_interactive) {
769  trace(" %d: \"%s\" %d.%d (%d:%d) destinations=%d\n", device,
770  szPname, capsW.vDriverVersion >> 8,
771  capsW.vDriverVersion & 0xff,capsW.wMid,capsW.wPid,
772  capsW.cDestinations);
773  } else {
774  trace(" %d: \"%s\" %d.%d (%d:%d)\n", device,
775  szPname, capsW.vDriverVersion >> 8,
776  capsW.vDriverVersion & 0xff,capsW.wMid,capsW.wPid);
777  }
778 
779 
780  rc = mixerOpen((HMIXER*)&mix, device, 0, 0, 0);
781  ok(rc==MMSYSERR_NOERROR,
782  "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",mmsys_error(rc));
783  if (rc==MMSYSERR_NOERROR) {
784  MIXERCAPSW capsW2;
785 
786  rc=mixerGetDevCapsW((UINT_PTR)mix,&capsW2,sizeof(capsW2));
787  ok(rc==MMSYSERR_NOERROR,
788  "mixerGetDevCapsW: MMSYSERR_NOERROR expected, got %s\n",
789  mmsys_error(rc));
790  ok(!lstrcmpW(capsW2.szPname, capsW.szPname), "Got wrong device caps\n");
791 
792  for (d=0;d<capsW.cDestinations;d++) {
793  MIXERLINEW mixerlineW;
794  mixerlineW.cbStruct = 0;
795  mixerlineW.dwDestination=d;
798  "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
799  "MMSYSERR_INVALPARAM expected, got %s\n",
800  mmsys_error(rc));
801 
802  mixerlineW.cbStruct = sizeof(mixerlineW);
803  mixerlineW.dwDestination=capsW.cDestinations;
806  "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
807  "MMSYSERR_INVALPARAM or MIXERR_INVALLINE expected, got %s\n",
808  mmsys_error(rc));
809 
810  mixerlineW.cbStruct = sizeof(mixerlineW);
811  mixerlineW.dwDestination=d;
814  "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
815  "MMSYSERR_INVALPARAM expected, got %s\n",
816  mmsys_error(rc));
817 
818  mixerlineW.cbStruct = sizeof(mixerlineW);
819  mixerlineW.dwDestination=d;
820  rc = mixerGetLineInfoW(mix, &mixerlineW, -1);
822  "mixerGetLineInfoW(-1): MMSYSERR_INVALFLAG expected, got %s\n",
823  mmsys_error(rc));
824 
825  mixerlineW.cbStruct = sizeof(mixerlineW);
826  mixerlineW.dwDestination=d;
827  mixerlineW.dwUser = (ULONG_PTR)0xdeadbeef;
830  "mixerGetLineInfoW(MIXER_GETLINEINFOF_DESTINATION): "
831  "MMSYSERR_NOERROR expected, got %s\n",
832  mmsys_error(rc));
833  ok(mixerlineW.dwUser == 0, "dwUser was not reset\n");
834  if (rc==MMSYSERR_NODRIVER)
835  trace(" No Driver\n");
836  else if (rc==MMSYSERR_NOERROR && winetest_interactive) {
838  MIXER_SHORT_NAME_CHARS,szShortName,
840  WideCharToMultiByte(CP_ACP,0,mixerlineW.szName,
843  WideCharToMultiByte(CP_ACP,0,mixerlineW.Target.szPname,
844  MAXPNAMELEN,szPname,
846  trace(" %d: \"%s\" (%s) Destination=%d Source=%d\n",
847  d,szShortName,szName,
848  mixerlineW.dwDestination,mixerlineW.dwSource);
849  trace(" LineID=%08x Channels=%d "
850  "Connections=%d Controls=%d\n",
851  mixerlineW.dwLineID,mixerlineW.cChannels,
852  mixerlineW.cConnections,mixerlineW.cControls);
853  trace(" State=0x%08x(%s)\n",
854  mixerlineW.fdwLine,line_flags(mixerlineW.fdwLine));
855  trace(" ComponentType=%s\n",
856  component_type(mixerlineW.dwComponentType));
857  trace(" Type=%s\n",
858  target_type(mixerlineW.Target.dwType));
859  trace(" Device=%d (%s) %d.%d (%d:%d)\n",
860  mixerlineW.Target.dwDeviceID,szPname,
861  mixerlineW.Target.vDriverVersion >> 8,
862  mixerlineW.Target.vDriverVersion & 0xff,
863  mixerlineW.Target.wMid, mixerlineW.Target.wPid);
864  }
865  ns=mixerlineW.cConnections;
866  for(s=0;s<ns;s++) {
867  mixerlineW.cbStruct = sizeof(mixerlineW);
868  mixerlineW.dwDestination=d;
869  mixerlineW.dwSource=s;
870  rc = mixerGetLineInfoW(mix, &mixerlineW, MIXER_GETLINEINFOF_SOURCE);
872  "mixerGetLineInfoW(MIXER_GETLINEINFOF_SOURCE): "
873  "MMSYSERR_NOERROR expected, got %s\n",
874  mmsys_error(rc));
875  if (rc==MMSYSERR_NODRIVER)
876  trace(" No Driver\n");
877  else if (rc==MMSYSERR_NOERROR) {
879  MIXERLINECONTROLSW controls;
880  if (winetest_interactive) {
882  MIXER_SHORT_NAME_CHARS,szShortName,
884  WideCharToMultiByte(CP_ACP,0,mixerlineW.szName,
887  WideCharToMultiByte(CP_ACP,0,mixerlineW.Target.szPname,
888  MAXPNAMELEN,szPname,
890  trace(" %d: \"%s\" (%s) Destination=%d Source=%d\n",
891  s,szShortName,szName,
892  mixerlineW.dwDestination,mixerlineW.dwSource);
893  trace(" LineID=%08x Channels=%d "
894  "Connections=%d Controls=%d\n",
895  mixerlineW.dwLineID,mixerlineW.cChannels,
896  mixerlineW.cConnections,mixerlineW.cControls);
897  trace(" State=0x%08x(%s)\n",
898  mixerlineW.fdwLine,line_flags(mixerlineW.fdwLine));
899  trace(" ComponentType=%s\n",
900  component_type(mixerlineW.dwComponentType));
901  trace(" Type=%s\n",
902  target_type(mixerlineW.Target.dwType));
903  trace(" Device=%d (%s) %d.%d (%d:%d)\n",
904  mixerlineW.Target.dwDeviceID,szPname,
905  mixerlineW.Target.vDriverVersion >> 8,
906  mixerlineW.Target.vDriverVersion & 0xff,
907  mixerlineW.Target.wMid, mixerlineW.Target.wPid);
908  }
909  if (mixerlineW.cControls) {
911  mixerlineW.cControls*sizeof(MIXERCONTROLW));
912  if (array) {
915  "mixerGetLineControlsW(MIXER_GETLINECONTROLSF_ALL): "
916  "MMSYSERR_INVALPARAM expected, got %s\n",
917  mmsys_error(rc));
918  rc = mixerGetLineControlsW(mix, &controls, -1);
920  "mixerGetLineControlsW(-1): "
921  "MMSYSERR_INVALFLAG or MMSYSERR_INVALPARAM expected, got %s\n",
922  mmsys_error(rc));
923 
924  controls.cbStruct = sizeof(MIXERLINECONTROLSW);
925  controls.cControls = mixerlineW.cControls;
926  controls.dwLineID = mixerlineW.dwLineID;
927  controls.pamxctrl = array;
928  controls.cbmxctrl = sizeof(MIXERCONTROLW);
929 
930  /* FIXME: do MIXER_GETLINECONTROLSF_ONEBYID
931  * and MIXER_GETLINECONTROLSF_ONEBYTYPE
932  */
934  ok(rc==MMSYSERR_NOERROR,
935  "mixerGetLineControlsW(MIXER_GETLINECONTROLSF_ALL): "
936  "MMSYSERR_NOERROR expected, got %s\n",
937  mmsys_error(rc));
938  if (rc==MMSYSERR_NOERROR) {
939  for(nc=0;nc<mixerlineW.cControls;nc++) {
940  if (winetest_interactive) {
941  WideCharToMultiByte(CP_ACP,0,array[nc].szShortName,
942  MIXER_SHORT_NAME_CHARS,szShortName,
947  trace(" %d: \"%s\" (%s) ControlID=%d\n", nc,
948  szShortName, szName, array[nc].dwControlID);
949  trace(" ControlType=%s\n",
950  control_type(array[nc].dwControlType));
951  trace(" Control=0x%08x(%s)\n",
952  array[nc].fdwControl,
953  control_flags(array[nc].fdwControl));
954  trace(" Items=%d Min=%d Max=%d Step=%d\n",
955  array[nc].cMultipleItems,
956  S1(array[nc].Bounds).dwMinimum,
957  S1(array[nc].Bounds).dwMaximum,
958  array[nc].Metrics.cSteps);
959  }
961  }
962  }
963 
965  }
966  }
967  }
968  }
969  }
970  test_mixerClose((HMIXER)mix);
971  }
972 }
#define MIXER_GETLINECONTROLSF_ALL
Definition: mmsystem.h:408
UINT WINAPI mixerGetLineInfoW(HMIXEROBJ hmix, LPMIXERLINEW lpmliW, DWORD fdwInfo)
Definition: winmm.c:595
#define WideCharToMultiByte
Definition: compat.h:101
LPMIXERCONTROLW pamxctrl
Definition: mmsystem.h:1350
#define S1(x)
Definition: test.h:191
#define CP_ACP
Definition: compat.h:99
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
struct tagMIXERLINECONTROLSW MIXERLINECONTROLSW
DWORD cDestinations
Definition: mmsystem.h:1228
DWORD dwLineID
Definition: mmsystem.h:1258
UINT MMRESULT
Definition: mmsystem.h:962
#define MIXERR_INVALLINE
Definition: mmsystem.h:295
int winetest_interactive
struct tagMIXERCONTROLW MIXERCONTROLW
static const char * control_type(DWORD dwControlType)
Definition: mixer.c:110
WCHAR szShortName[MIXER_SHORT_NAME_CHARS]
Definition: mmsystem.h:1265
#define MMSYSERR_NODRIVER
Definition: mmsystem.h:102
Definition: devices.h:37
DWORD dwComponentType
Definition: mmsystem.h:1261
DWORD dwDestination
Definition: mmsystem.h:1256
smooth NULL
Definition: ftsmooth.c:416
struct tagMIXERLINEW::@2914 Target
#define MIXER_GETLINEINFOF_DESTINATION
Definition: mmsystem.h:344
UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
Definition: winmm.c:342
DWORD cControls
Definition: mmsystem.h:1264
DWORD dwMinimum
Definition: mmsystem.h:1291
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define GetProcessHeap()
Definition: compat.h:395
#define trace
Definition: atltest.h:70
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define d
Definition: ke_i.h:81
DWORD dwSource
Definition: mmsystem.h:1257
DWORD cChannels
Definition: mmsystem.h:1262
DWORD cbStruct
Definition: mmsystem.h:1255
DWORD dwUser
Definition: mmsystem.h:1260
DWORD fdwLine
Definition: mmsystem.h:1259
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MMSYSERR_INVALFLAG
Definition: mmsystem.h:106
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
MMVERSION vDriverVersion
Definition: mmsystem.h:1225
static void mixer_test_controlW(HMIXEROBJ mix, MIXERCONTROLW *control)
Definition: mixer.c:573
UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW, DWORD fdwControls)
Definition: winmm.c:574
Definition: mxnamespace.c:44
#define MIXER_SHORT_NAME_CHARS
Definition: mmsystem.h:293
static void test_mixerClose(HMIXER mix)
Definition: mixer.c:177
static const char * control_flags(DWORD fdwControl)
Definition: mixer.c:150
GLdouble s
Definition: gl.h:2039
UINT WINAPI mixerGetDevCapsW(UINT_PTR uDeviceID, LPMIXERCAPSW lpCaps, UINT uSize)
Definition: winmm.c:317
const char * mmsys_error(MMRESULT error)
Definition: wave.c:220
#define MIXER_LONG_NAME_CHARS
Definition: mmsystem.h:294
DWORD dwMaximum
Definition: mmsystem.h:1292
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define MIXER_GETLINEINFOF_SOURCE
Definition: mmsystem.h:345
WCHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1266
#define ok(value,...)
Definition: atltest.h:57
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
Definition: winddi.h:3591
DWORD cConnections
Definition: mmsystem.h:1263
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define MAXPNAMELEN
Definition: mmsystem.h:24
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1226
static const WCHAR szName[]
Definition: msipriv.h:1194
static const char * component_type(DWORD dwComponentType)
Definition: mixer.c:66
#define ULONG_PTR
Definition: config.h:101
static const char * line_flags(DWORD fdwLine)
Definition: mixer.c:39
#define HeapFree(x, y, z)
Definition: compat.h:394
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum GLdouble GLenum GLint GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLenum GLfloat GLenum GLfloat GLenum GLushort const GLubyte GLenum GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLvoid GLenum GLenum GLint GLenum GLint GLenum GLint GLuint GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble const GLfloat GLenum const GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLint GLint GLsizei GLsizei GLenum GLuint GLenum array
Definition: glfuncs.h:320
static const char * target_type(DWORD dwType)
Definition: mixer.c:95

Referenced by mixer_testsW().

◆ mixer_testsA()

static void mixer_testsA ( void  )
static

Definition at line 974 of file mixer.c.

975 {
976  MIXERCAPSA capsA;
977  MMRESULT rc;
978  UINT ndev, d;
979 
980  trace("--- Testing ASCII functions ---\n");
981 
982  ndev=mixerGetNumDevs();
983  trace("found %d Mixer devices\n",ndev);
984 
985  rc=mixerGetDevCapsA(ndev+1,&capsA,sizeof(capsA));
987  "mixerGetDevCapsA: MMSYSERR_BADDEVICEID expected, got %s\n",
988  mmsys_error(rc));
989 
990  for (d=0;d<ndev;d++)
992 }
UINT MMRESULT
Definition: mmsystem.h:962
static void mixer_test_deviceA(int device)
Definition: mixer.c:361
#define trace
Definition: atltest.h:70
#define d
Definition: ke_i.h:81
#define MMSYSERR_BADDEVICEID
Definition: mmsystem.h:98
const char * mmsys_error(MMRESULT error)
Definition: wave.c:220
UINT WINAPI mixerGetDevCapsA(UINT_PTR uDeviceID, LPMIXERCAPSA lpCaps, UINT uSize)
Definition: winmm.c:291
UINT WINAPI mixerGetNumDevs(void)
Definition: winmm.c:283
#define ok(value,...)
Definition: atltest.h:57
unsigned int UINT
Definition: ndis.h:50

Referenced by START_TEST().

◆ mixer_testsW()

static void mixer_testsW ( void  )
static

Definition at line 994 of file mixer.c.

995 {
996  MIXERCAPSW capsW;
997  MMRESULT rc;
998  UINT ndev, d;
999 
1000  trace("--- Testing WCHAR functions ---\n");
1001 
1002  ndev=mixerGetNumDevs();
1003  trace("found %d Mixer devices\n",ndev);
1004 
1005  rc=mixerGetDevCapsW(ndev+1,&capsW,sizeof(capsW));
1007  "mixerGetDevCapsW: MMSYSERR_BADDEVICEID or MMSYSERR_NOTSUPPORTED "
1008  "expected, got %s\n", mmsys_error(rc));
1009  if (rc==MMSYSERR_NOTSUPPORTED)
1010  return;
1011 
1012  for (d=0;d<ndev;d++)
1014 }
UINT MMRESULT
Definition: mmsystem.h:962
#define trace
Definition: atltest.h:70
#define d
Definition: ke_i.h:81
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
#define MMSYSERR_BADDEVICEID
Definition: mmsystem.h:98
UINT WINAPI mixerGetDevCapsW(UINT_PTR uDeviceID, LPMIXERCAPSW lpCaps, UINT uSize)
Definition: winmm.c:317
const char * mmsys_error(MMRESULT error)
Definition: wave.c:220
UINT WINAPI mixerGetNumDevs(void)
Definition: winmm.c:283
#define ok(value,...)
Definition: atltest.h:57
unsigned int UINT
Definition: ndis.h:50
static void mixer_test_deviceW(int device)
Definition: mixer.c:740

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( mixer  )

Definition at line 1104 of file mixer.c.

1105 {
1106  test_mixerOpen();
1107  mixer_testsA();
1108  mixer_testsW();
1109 }
static void mixer_testsA(void)
Definition: mixer.c:974
static void mixer_testsW(void)
Definition: mixer.c:994
static void test_mixerOpen(void)
Definition: mixer.c:1016

◆ target_type()

static const char* target_type ( DWORD  dwType)
static

Definition at line 95 of file mixer.c.

96 {
97 #define TYPE_TO_STR(x) case x: return #x
98  switch (dwType) {
105  }
106 #undef TYPE_TO_STR
107  return "UNKNOWN";
108 }
#define MIXERLINE_TARGETTYPE_MIDIIN
Definition: mmsystem.h:342
#define MIXERLINE_TARGETTYPE_UNDEFINED
Definition: mmsystem.h:338
#define MIXERLINE_TARGETTYPE_AUX
Definition: mmsystem.h:343
#define MIXERLINE_TARGETTYPE_MIDIOUT
Definition: mmsystem.h:341
#define MIXERLINE_TARGETTYPE_WAVEOUT
Definition: mmsystem.h:339
#define TYPE_TO_STR(x)
#define MIXERLINE_TARGETTYPE_WAVEIN
Definition: mmsystem.h:340

Referenced by encode_type(), encode_var(), mixer_test_deviceA(), mixer_test_deviceW(), and shader_arb_load_constants_f().

◆ test_mixerClose()

static void test_mixerClose ( HMIXER  mix)
static

Definition at line 177 of file mixer.c.

178 {
179  MMRESULT rc;
180 
181  rc = mixerClose(mix);
183  "mixerClose: MMSYSERR_NOERROR or MMSYSERR_INVALHANDLE expected, got %s\n",
184  mmsys_error(rc));
185 }
UINT WINAPI mixerClose(HMIXER hMix)
Definition: winmm.c:389
UINT MMRESULT
Definition: mmsystem.h:962
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
const char * mmsys_error(MMRESULT error)
Definition: wave.c:220
#define ok(value,...)
Definition: atltest.h:57
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
Definition: winddi.h:3591

Referenced by mixer_test_deviceA(), mixer_test_deviceW(), and test_mixerOpen().

◆ test_mixerOpen()

static void test_mixerOpen ( void  )
static

Definition at line 1016 of file mixer.c.

1017 {
1018  HMIXER mix;
1019  HANDLE event;
1020  MMRESULT rc;
1021  UINT ndev, d;
1022 
1023  ndev = mixerGetNumDevs();
1024 
1025  /* Test mixerOpen with invalid device ID values. */
1026  rc = mixerOpen(&mix, ndev + 1, 0, 0, 0);
1027  ok(rc == MMSYSERR_BADDEVICEID,
1028  "mixerOpen: MMSYSERR_BADDEVICEID expected, got %s\n",
1029  mmsys_error(rc));
1030 
1031  rc = mixerOpen(&mix, -1, 0, 0, 0);
1032  ok(rc == MMSYSERR_BADDEVICEID ||
1033  rc == MMSYSERR_INVALHANDLE, /* NT4/W2K */
1034  "mixerOpen: MMSYSERR_BADDEVICEID or MMSYSERR_INVALHANDLE expected, got %s\n",
1035  mmsys_error(rc));
1036 
1037  for (d = 0; d < ndev; d++) {
1038  /* Test mixerOpen with valid device ID values and invalid parameters. */
1039  rc = mixerOpen(&mix, d, 0, 0, CALLBACK_FUNCTION);
1040  ok(rc == MMSYSERR_INVALFLAG
1041  || rc == MMSYSERR_NOTSUPPORTED, /* 98/ME */
1042  "mixerOpen: MMSYSERR_INVALFLAG expected, got %s\n",
1043  mmsys_error(rc));
1044 
1045  rc = mixerOpen(&mix, d, 0xdeadbeef, 0, CALLBACK_WINDOW);
1046  ok(rc == MMSYSERR_INVALPARAM ||
1047  broken(rc == MMSYSERR_NOERROR /* 98 */),
1048  "mixerOpen: MMSYSERR_INVALPARAM expected, got %s\n",
1049  mmsys_error(rc));
1050  if (rc == MMSYSERR_NOERROR)
1052 
1053  /* Test mixerOpen with a NULL dwCallback and CALLBACK_WINDOW flag. */
1054  rc = mixerOpen(&mix, d, 0, 0, CALLBACK_WINDOW);
1055  ok(rc == MMSYSERR_NOERROR,
1056  "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",
1057  mmsys_error(rc));
1058  if (rc == MMSYSERR_NOERROR)
1060 
1061  rc = mixerOpen(&mix, d, 0, 0, CALLBACK_THREAD);
1062  ok(rc == MMSYSERR_NOERROR /* since w2k */ ||
1063  rc == MMSYSERR_NOTSUPPORTED, /* 98 */
1064  "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",
1065  mmsys_error(rc));
1066  if (rc == MMSYSERR_NOERROR)
1068 
1069  rc = mixerOpen(&mix, d, 0, 0, CALLBACK_EVENT);
1070  ok(rc == MMSYSERR_NOERROR /* since w2k */ ||
1071  rc == MMSYSERR_NOTSUPPORTED, /* 98 */
1072  "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",
1073  mmsys_error(rc));
1074  if (rc == MMSYSERR_NOERROR)
1076 
1077  event = CreateEventW(NULL, FALSE, FALSE, NULL);
1078 
1079  /* NOTSUPPORTED is not broken, but it enables the todo_wine marker. */
1080  rc = mixerOpen(&mix, d, (DWORD_PTR)event, 0, CALLBACK_EVENT);
1081  todo_wine
1082  ok(rc == MMSYSERR_NOERROR /* since w2k */ ||
1083  broken(rc == MMSYSERR_NOTSUPPORTED), /* 98 */
1084  "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",
1085  mmsys_error(rc));
1086  if (rc == MMSYSERR_NOERROR)
1088 
1089  /* Test mixerOpen with normal parameters. */
1090  rc = mixerOpen(&mix, d, 0, 0, 0);
1091  ok(rc == MMSYSERR_NOERROR,
1092  "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",
1093  mmsys_error(rc));
1094 
1095  if (rc == MMSYSERR_NOERROR)
1097 
1098  rc = WaitForSingleObject(event, 0);
1099  ok(rc == WAIT_TIMEOUT, "WaitEvent %d\n", rc);
1100  CloseHandle(event);
1101  }
1102 }
#define CloseHandle
Definition: compat.h:398
#define CALLBACK_WINDOW
Definition: mmsystem.h:148
UINT MMRESULT
Definition: mmsystem.h:962
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define CALLBACK_EVENT
Definition: mmsystem.h:152
#define CALLBACK_FUNCTION
Definition: mmsystem.h:150
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI mixerOpen(LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
Definition: winmm.c:342
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define d
Definition: ke_i.h:81
#define CALLBACK_THREAD
Definition: mmsystem.h:151
#define MMSYSERR_INVALFLAG
Definition: mmsystem.h:106
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define todo_wine
Definition: test.h:154
static void test_mixerClose(HMIXER mix)
Definition: mixer.c:177
#define MMSYSERR_BADDEVICEID
Definition: mmsystem.h:98
const char * mmsys_error(MMRESULT error)
Definition: wave.c:220
struct _cl_event * event
Definition: glext.h:7739
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define broken(x)
Definition: _sntprintf.h:21
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
UINT WINAPI mixerGetNumDevs(void)
Definition: winmm.c:283
#define ok(value,...)
Definition: atltest.h:57
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
Definition: winddi.h:3591
unsigned int UINT
Definition: ndis.h:50

Referenced by START_TEST().