ReactOS  0.4.13-dev-563-g0561610
winmm.c File Reference
#include "winemm.h"
Include dependency graph for winmm.c:

Go to the source code of this file.

Classes

struct  WINE_MIDIStream
 
struct  mm_starter
 

Macros

#define ERR_TO_STR(dev)   case dev: return #dev
 
#define WINE_MSM_HEADER   (WM_USER+0)
 
#define WINE_MSM_STOP   (WM_USER+1)
 

Typedefs

typedef struct WINE_MIDIStream WINE_MIDIStream
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (winmm)
 
static BOOL WINMM_CreateIData (HINSTANCE hInstDLL)
 
static void WINMM_DeleteIData (void)
 
static HANDLE (WINAPI *pGetModuleHandle16)(LPCSTR)
 
static DWORD (WINAPI *pLoadLibrary16)(LPCSTR)
 
BOOL WINMM_CheckForMMSystem (void)
 
const charWINMM_ErrorToString (MMRESULT error)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad)
 
MMRESULT WINMM_CheckCallback (DWORD_PTR dwCallback, DWORD fdwOpen, BOOL mixer)
 
static UINT MIXER_GetDev (HMIXEROBJ hmix, DWORD dwFlags, LPWINE_MIXER *lplpwm)
 
UINT WINAPI mixerGetNumDevs (void)
 
UINT WINAPI mixerGetDevCapsA (UINT_PTR uDeviceID, LPMIXERCAPSA lpCaps, UINT uSize)
 
UINT WINAPI mixerGetDevCapsW (UINT_PTR uDeviceID, LPMIXERCAPSW lpCaps, UINT uSize)
 
static void CALLBACK MIXER_WCallback (HMIXEROBJ hmx, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam, DWORD_PTR param2)
 
UINT WINAPI mixerOpen (LPHMIXER lphMix, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
 
UINT WINAPI mixerClose (HMIXER hMix)
 
UINT WINAPI mixerGetID (HMIXEROBJ hmix, LPUINT lpid, DWORD fdwID)
 
UINT WINAPI mixerGetControlDetailsW (HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdW, DWORD fdwDetails)
 
UINT WINAPI mixerGetControlDetailsA (HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdA, DWORD fdwDetails)
 
UINT WINAPI mixerGetLineControlsA (HMIXEROBJ hmix, LPMIXERLINECONTROLSA lpmlcA, DWORD fdwControls)
 
UINT WINAPI mixerGetLineControlsW (HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW, DWORD fdwControls)
 
UINT WINAPI mixerGetLineInfoW (HMIXEROBJ hmix, LPMIXERLINEW lpmliW, DWORD fdwInfo)
 
UINT WINAPI mixerGetLineInfoA (HMIXEROBJ hmix, LPMIXERLINEA lpmliA, DWORD fdwInfo)
 
UINT WINAPI mixerSetControlDetails (HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcd, DWORD fdwDetails)
 
DWORD WINAPI mixerMessage (HMIXER hmix, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
 
UINT WINAPI auxGetNumDevs (void)
 
UINT WINAPI auxGetDevCapsW (UINT_PTR uDeviceID, LPAUXCAPSW lpCaps, UINT uSize)
 
UINT WINAPI auxGetDevCapsA (UINT_PTR uDeviceID, LPAUXCAPSA lpCaps, UINT uSize)
 
UINT WINAPI auxGetVolume (UINT uDeviceID, DWORD *lpdwVolume)
 
UINT WINAPI auxSetVolume (UINT uDeviceID, DWORD dwVolume)
 
UINT WINAPI auxOutMessage (UINT uDeviceID, UINT uMessage, DWORD_PTR dw1, DWORD_PTR dw2)
 
UINT WINAPI midiOutGetNumDevs (void)
 
UINT WINAPI midiOutGetDevCapsW (UINT_PTR uDeviceID, LPMIDIOUTCAPSW lpCaps, UINT uSize)
 
UINT WINAPI midiOutGetDevCapsA (UINT_PTR uDeviceID, LPMIDIOUTCAPSA lpCaps, UINT uSize)
 
UINT WINAPI midiOutGetErrorTextA (UINT uError, LPSTR lpText, UINT uSize)
 
UINT WINAPI midiOutGetErrorTextW (UINT uError, LPWSTR lpText, UINT uSize)
 
static LPWINE_MIDI MIDI_OutAlloc (HMIDIOUT *lphMidiOut, DWORD_PTR *lpdwCallback, DWORD_PTR *lpdwInstance, LPDWORD lpdwFlags, DWORD cIDs, MIDIOPENSTRMID *lpIDs)
 
MMRESULT WINAPI midiOutOpen (LPHMIDIOUT lphMidiOut, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
 
UINT WINAPI midiOutClose (HMIDIOUT hMidiOut)
 
UINT WINAPI midiOutPrepareHeader (HMIDIOUT hMidiOut, MIDIHDR *lpMidiOutHdr, UINT uSize)
 
UINT WINAPI midiOutUnprepareHeader (HMIDIOUT hMidiOut, MIDIHDR *lpMidiOutHdr, UINT uSize)
 
UINT WINAPI midiOutShortMsg (HMIDIOUT hMidiOut, DWORD dwMsg)
 
UINT WINAPI midiOutLongMsg (HMIDIOUT hMidiOut, MIDIHDR *lpMidiOutHdr, UINT uSize)
 
UINT WINAPI midiOutReset (HMIDIOUT hMidiOut)
 
UINT WINAPI midiOutGetVolume (HMIDIOUT hMidiOut, DWORD *lpdwVolume)
 
UINT WINAPI midiOutSetVolume (HMIDIOUT hMidiOut, DWORD dwVolume)
 
UINT WINAPI midiOutCachePatches (HMIDIOUT hMidiOut, UINT uBank, WORD *lpwPatchArray, UINT uFlags)
 
UINT WINAPI midiOutCacheDrumPatches (HMIDIOUT hMidiOut, UINT uPatch, WORD *lpwKeyArray, UINT uFlags)
 
UINT WINAPI midiOutGetID (HMIDIOUT hMidiOut, UINT *lpuDeviceID)
 
UINT WINAPI midiOutMessage (HMIDIOUT hMidiOut, UINT uMessage, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
 
UINT WINAPI midiInGetNumDevs (void)
 
UINT WINAPI midiInGetDevCapsW (UINT_PTR uDeviceID, LPMIDIINCAPSW lpCaps, UINT uSize)
 
UINT WINAPI midiInGetDevCapsA (UINT_PTR uDeviceID, LPMIDIINCAPSA lpCaps, UINT uSize)
 
MMRESULT WINAPI midiInOpen (HMIDIIN *lphMidiIn, UINT uDeviceID, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
 
UINT WINAPI midiInClose (HMIDIIN hMidiIn)
 
UINT WINAPI midiInPrepareHeader (HMIDIIN hMidiIn, MIDIHDR *lpMidiInHdr, UINT uSize)
 
UINT WINAPI midiInUnprepareHeader (HMIDIIN hMidiIn, MIDIHDR *lpMidiInHdr, UINT uSize)
 
UINT WINAPI midiInAddBuffer (HMIDIIN hMidiIn, MIDIHDR *lpMidiInHdr, UINT uSize)
 
UINT WINAPI midiInStart (HMIDIIN hMidiIn)
 
UINT WINAPI midiInStop (HMIDIIN hMidiIn)
 
UINT WINAPI midiInReset (HMIDIIN hMidiIn)
 
UINT WINAPI midiInGetID (HMIDIIN hMidiIn, UINT *lpuDeviceID)
 
UINT WINAPI midiInMessage (HMIDIIN hMidiIn, UINT uMessage, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
 
MMRESULT WINAPI midiConnect (HMIDI hMidi, HMIDIOUT hmo, LPVOID pReserved)
 
MMRESULT WINAPI midiDisconnect (HMIDI hMidi, HMIDIOUT hmo, LPVOID pReserved)
 
static BOOL MMSYSTEM_GetMidiStream (HMIDISTRM hMidiStrm, WINE_MIDIStream **lpMidiStrm, WINE_MIDI **lplpwm)
 
static DWORD MMSYSTEM_MidiStream_Convert (WINE_MIDIStream *lpMidiStrm, DWORD pulse)
 
static BOOL MMSYSTEM_MidiStream_MessageHandler (WINE_MIDIStream *lpMidiStrm, LPWINE_MIDI lpwm, LPMSG msg)
 
static DWORD CALLBACK MMSYSTEM_MidiStream_Player (LPVOID pmt)
 
static BOOL MMSYSTEM_MidiStream_PostMessage (WINE_MIDIStream *lpMidiStrm, WORD msg, DWORD pmt1, DWORD pmt2)
 
MMRESULT WINAPI midiStreamClose (HMIDISTRM hMidiStrm)
 
MMRESULT WINAPI midiStreamOpen (HMIDISTRM *lphMidiStrm, LPUINT lpuDeviceID, DWORD cMidi, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
 
MMRESULT WINAPI midiStreamOut (HMIDISTRM hMidiStrm, LPMIDIHDR lpMidiHdr, UINT cbMidiHdr)
 
MMRESULT WINAPI midiStreamPause (HMIDISTRM hMidiStrm)
 
MMRESULT WINAPI midiStreamPosition (HMIDISTRM hMidiStrm, LPMMTIME lpMMT, UINT cbmmt)
 
MMRESULT WINAPI midiStreamProperty (HMIDISTRM hMidiStrm, LPBYTE lpPropData, DWORD dwProperty)
 
MMRESULT WINAPI midiStreamRestart (HMIDISTRM hMidiStrm)
 
MMRESULT WINAPI midiStreamStop (HMIDISTRM hMidiStrm)
 
static UINT WAVE_Open (HANDLE *lphndl, UINT uDeviceID, UINT uType, LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
 
UINT WINAPI waveOutGetNumDevs (void)
 
UINT WINAPI waveOutGetDevCapsA (UINT_PTR uDeviceID, LPWAVEOUTCAPSA lpCaps, UINT uSize)
 
UINT WINAPI waveOutGetDevCapsW (UINT_PTR uDeviceID, LPWAVEOUTCAPSW lpCaps, UINT uSize)
 
UINT WINAPI waveOutGetErrorTextA (UINT uError, LPSTR lpText, UINT uSize)
 
UINT WINAPI waveOutGetErrorTextW (UINT uError, LPWSTR lpText, UINT uSize)
 
MMRESULT WINAPI waveOutOpen (LPHWAVEOUT lphWaveOut, UINT uDeviceID, LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
 
UINT WINAPI waveOutClose (HWAVEOUT hWaveOut)
 
UINT WINAPI waveOutPrepareHeader (HWAVEOUT hWaveOut, WAVEHDR *lpWaveOutHdr, UINT uSize)
 
UINT WINAPI waveOutUnprepareHeader (HWAVEOUT hWaveOut, LPWAVEHDR lpWaveOutHdr, UINT uSize)
 
UINT WINAPI waveOutWrite (HWAVEOUT hWaveOut, LPWAVEHDR lpWaveOutHdr, UINT uSize)
 
UINT WINAPI waveOutBreakLoop (HWAVEOUT hWaveOut)
 
UINT WINAPI waveOutPause (HWAVEOUT hWaveOut)
 
UINT WINAPI waveOutReset (HWAVEOUT hWaveOut)
 
UINT WINAPI waveOutRestart (HWAVEOUT hWaveOut)
 
UINT WINAPI waveOutGetPosition (HWAVEOUT hWaveOut, LPMMTIME lpTime, UINT uSize)
 
UINT WINAPI waveOutGetPitch (HWAVEOUT hWaveOut, LPDWORD lpdw)
 
UINT WINAPI waveOutSetPitch (HWAVEOUT hWaveOut, DWORD dw)
 
UINT WINAPI waveOutGetPlaybackRate (HWAVEOUT hWaveOut, LPDWORD lpdw)
 
UINT WINAPI waveOutSetPlaybackRate (HWAVEOUT hWaveOut, DWORD dw)
 
UINT WINAPI waveOutGetVolume (HWAVEOUT hWaveOut, LPDWORD lpdw)
 
UINT WINAPI waveOutSetVolume (HWAVEOUT hWaveOut, DWORD dw)
 
UINT WINAPI waveOutGetID (HWAVEOUT hWaveOut, UINT *lpuDeviceID)
 
UINT WINAPI waveOutMessage (HWAVEOUT hWaveOut, UINT uMessage, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
 
UINT WINAPI waveInGetNumDevs (void)
 
UINT WINAPI waveInGetDevCapsW (UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSize)
 
UINT WINAPI waveInGetDevCapsA (UINT_PTR uDeviceID, LPWAVEINCAPSA lpCaps, UINT uSize)
 
MMRESULT WINAPI waveInOpen (HWAVEIN *lphWaveIn, UINT uDeviceID, LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
 
UINT WINAPI waveInClose (HWAVEIN hWaveIn)
 
UINT WINAPI waveInPrepareHeader (HWAVEIN hWaveIn, WAVEHDR *lpWaveInHdr, UINT uSize)
 
UINT WINAPI waveInUnprepareHeader (HWAVEIN hWaveIn, WAVEHDR *lpWaveInHdr, UINT uSize)
 
UINT WINAPI waveInAddBuffer (HWAVEIN hWaveIn, WAVEHDR *lpWaveInHdr, UINT uSize)
 
UINT WINAPI waveInReset (HWAVEIN hWaveIn)
 
UINT WINAPI waveInStart (HWAVEIN hWaveIn)
 
UINT WINAPI waveInStop (HWAVEIN hWaveIn)
 
UINT WINAPI waveInGetPosition (HWAVEIN hWaveIn, LPMMTIME lpTime, UINT uSize)
 
UINT WINAPI waveInGetID (HWAVEIN hWaveIn, UINT *lpuDeviceID)
 
UINT WINAPI waveInMessage (HWAVEIN hWaveIn, UINT uMessage, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
 
static DWORD WINAPI mmTaskRun (void *pmt)
 
UINT WINAPI mmTaskCreate (LPTASKCALLBACK cb, HANDLE *ph, DWORD_PTR client)
 
VOID WINAPI mmTaskBlock (DWORD tid)
 
BOOL WINAPI mmTaskSignal (DWORD tid)
 
VOID WINAPI mmTaskYield (VOID)
 
DWORD WINAPI mmGetCurrentTask (VOID)
 

Variables

HINSTANCE hWinMM32Instance
 
HANDLE psLastEvent
 
HANDLE psStopEvent
 
CRITICAL_SECTION WINMM_cs
 

Macro Definition Documentation

◆ ERR_TO_STR

#define ERR_TO_STR (   dev)    case dev: return #dev

◆ WINE_MSM_HEADER

#define WINE_MSM_HEADER   (WM_USER+0)

Definition at line 1470 of file winmm.c.

◆ WINE_MSM_STOP

#define WINE_MSM_STOP   (WM_USER+1)

Definition at line 1471 of file winmm.c.

Typedef Documentation

◆ WINE_MIDIStream

Function Documentation

◆ auxGetDevCapsA()

UINT WINAPI auxGetDevCapsA ( UINT_PTR  uDeviceID,
LPAUXCAPSA  lpCaps,
UINT  uSize 
)

Definition at line 742 of file winmm.c.

743 {
744  AUXCAPSW acW;
745  UINT ret;
746 
747  if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
748 
749  ret = auxGetDevCapsW(uDeviceID, &acW, sizeof(acW));
750 
751  if (ret == MMSYSERR_NOERROR) {
752  AUXCAPSA acA;
753  acA.wMid = acW.wMid;
754  acA.wPid = acW.wPid;
755  acA.vDriverVersion = acW.vDriverVersion;
756  WideCharToMultiByte( CP_ACP, 0, acW.szPname, -1, acA.szPname,
757  sizeof(acA.szPname), NULL, NULL );
758  acA.wTechnology = acW.wTechnology;
759  acA.dwSupport = acW.dwSupport;
760  memcpy(lpCaps, &acA, min(uSize, sizeof(acA)));
761  }
762  return ret;
763 }
DWORD dwSupport
Definition: mmsystem.h:1205
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
WORD wTechnology
Definition: mmsystem.h:1203
DWORD dwSupport
Definition: mmsystem.h:1195
MMVERSION vDriverVersion
Definition: mmsystem.h:1201
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI auxGetDevCapsW(UINT_PTR uDeviceID, LPAUXCAPSW lpCaps, UINT uSize)
Definition: winmm.c:726
WORD wTechnology
Definition: mmsystem.h:1193
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
MMVERSION vDriverVersion
Definition: mmsystem.h:1191
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1202
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1192

◆ auxGetDevCapsW()

UINT WINAPI auxGetDevCapsW ( UINT_PTR  uDeviceID,
LPAUXCAPSW  lpCaps,
UINT  uSize 
)

Definition at line 726 of file winmm.c.

727 {
728  LPWINE_MLD wmld;
729 
730  TRACE("(%04lX, %p, %d) !\n", uDeviceID, lpCaps, uSize);
731 
732  if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
733 
734  if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_AUX, TRUE)) == NULL)
735  return MMSYSERR_INVALHANDLE;
736  return MMDRV_Message(wmld, AUXDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
737 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define TRUE
Definition: types.h:120
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define MMDRV_AUX
Definition: winemm.h:76
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
#define AUXDM_GETDEVCAPS
Definition: mmddk.h:183
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107

Referenced by auxGetDevCapsA().

◆ auxGetNumDevs()

UINT WINAPI auxGetNumDevs ( void  )

Definition at line 718 of file winmm.c.

719 {
720  return MMDRV_GetNum(MMDRV_AUX);
721 }
#define MMDRV_AUX
Definition: winemm.h:76
UINT MMDRV_GetNum(UINT type)
Definition: lolvldrv.c:61

◆ auxGetVolume()

UINT WINAPI auxGetVolume ( UINT  uDeviceID,
DWORD lpdwVolume 
)

Definition at line 768 of file winmm.c.

769 {
770  LPWINE_MLD wmld;
771 
772  TRACE("(%04X, %p) !\n", uDeviceID, lpdwVolume);
773 
774  if ((wmld = MMDRV_Get(UlongToHandle(uDeviceID), MMDRV_AUX, TRUE)) == NULL)
775  return MMSYSERR_INVALHANDLE;
776  return MMDRV_Message(wmld, AUXDM_GETVOLUME, (DWORD_PTR)lpdwVolume, 0L);
777 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define TRUE
Definition: types.h:120
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define MMDRV_AUX
Definition: winemm.h:76
smooth NULL
Definition: ftsmooth.c:416
#define AUXDM_GETVOLUME
Definition: mmddk.h:184
#define TRACE(s)
Definition: solgame.cpp:4
#define UlongToHandle(ul)
Definition: basetsd.h:97
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
static const WCHAR L[]
Definition: oid.c:1250
uint32_t DWORD_PTR
Definition: typedefs.h:63

◆ auxOutMessage()

UINT WINAPI auxOutMessage ( UINT  uDeviceID,
UINT  uMessage,
DWORD_PTR  dw1,
DWORD_PTR  dw2 
)

Definition at line 796 of file winmm.c.

797 {
798  LPWINE_MLD wmld;
799 
800  if ((wmld = MMDRV_Get(UlongToHandle(uDeviceID), MMDRV_AUX, TRUE)) == NULL)
801  return MMSYSERR_INVALHANDLE;
802 
803  return MMDRV_Message(wmld, uMessage, dw1, dw2);
804 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define TRUE
Definition: types.h:120
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define MMDRV_AUX
Definition: winemm.h:76
smooth NULL
Definition: ftsmooth.c:416
#define UlongToHandle(ul)
Definition: basetsd.h:97
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71

◆ auxSetVolume()

UINT WINAPI auxSetVolume ( UINT  uDeviceID,
DWORD  dwVolume 
)

Definition at line 782 of file winmm.c.

783 {
784  LPWINE_MLD wmld;
785 
786  TRACE("(%04X, %u) !\n", uDeviceID, dwVolume);
787 
788  if ((wmld = MMDRV_Get(UlongToHandle(uDeviceID), MMDRV_AUX, TRUE)) == NULL)
789  return MMSYSERR_INVALHANDLE;
790  return MMDRV_Message(wmld, AUXDM_SETVOLUME, dwVolume, 0L);
791 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define TRUE
Definition: types.h:120
#define AUXDM_SETVOLUME
Definition: mmddk.h:185
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define MMDRV_AUX
Definition: winemm.h:76
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define UlongToHandle(ul)
Definition: basetsd.h:97
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
static const WCHAR L[]
Definition: oid.c:1250

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstDLL,
DWORD  fdwReason,
LPVOID  fImpLoad 
)

Definition at line 159 of file winmm.c.

160 {
161  TRACE("%p 0x%x %p\n", hInstDLL, fdwReason, fImpLoad);
162 
163  switch (fdwReason) {
164  case DLL_PROCESS_ATTACH:
165  DisableThreadLibraryCalls(hInstDLL);
166 
167  if (!WINMM_CreateIData(hInstDLL))
168  return FALSE;
169  if (!MMDRV_Init()) {
171  return FALSE;
172  }
173  break;
174  case DLL_PROCESS_DETACH:
175  /* close all opened MCI drivers */
177  MMDRV_Exit();
178  /* There's no guarantee the drivers haven't already been unloaded on
179  * process shutdown.
180  */
181  if (!fImpLoad)
182  {
183  /* now unload all remaining drivers... */
185  }
186 
188  break;
189  }
190  return TRUE;
191 }
void DRIVER_UnloadAll(void)
Definition: driver.c:658
#define TRUE
Definition: types.h:120
#define MCI_WAIT
Definition: mmsystem.h:730
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
#define MCI_ALL_DEVICE_ID
Definition: mmsystem.h:679
static BOOL WINMM_CreateIData(HINSTANCE hInstDLL)
Definition: winmm.c:59
#define DLL_PROCESS_DETACH
Definition: compat.h:119
#define TRACE(s)
Definition: solgame.cpp:4
void MMDRV_Exit(void)
Definition: lolvldrv.c:607
static void WINMM_DeleteIData(void)
Definition: winmm.c:71
static const WCHAR L[]
Definition: oid.c:1250
DWORD LPVOID fImpLoad
Definition: misc.cpp:155
#define MCI_CLOSE
Definition: mmsystem.h:647
BOOL MMDRV_Init(void)
Definition: lolvldrv.c:526
DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: mci.c:1908

◆ DWORD()

static DWORD ( WINAPI pLoadLibrary16)
static

◆ HANDLE()

static HANDLE ( WINAPI pGetModuleHandle16)
static

◆ MIDI_OutAlloc()

static LPWINE_MIDI MIDI_OutAlloc ( HMIDIOUT *  lphMidiOut,
DWORD_PTR lpdwCallback,
DWORD_PTR lpdwInstance,
LPDWORD  lpdwFlags,
DWORD  cIDs,
MIDIOPENSTRMID lpIDs 
)
static

Definition at line 912 of file winmm.c.

915 {
916  HANDLE hMidiOut;
917  LPWINE_MIDI lpwm;
918  UINT size;
919 
920  size = sizeof(WINE_MIDI) + (cIDs ? (cIDs-1) : 0) * sizeof(MIDIOPENSTRMID);
921 
922  lpwm = (LPWINE_MIDI)MMDRV_Alloc(size, MMDRV_MIDIOUT, &hMidiOut, lpdwFlags,
923  lpdwCallback, lpdwInstance);
924 
925  *lphMidiOut = hMidiOut;
926 
927  if (lpwm) {
928  lpwm->mod.hMidi = hMidiOut;
929  lpwm->mod.dwCallback = *lpdwCallback;
930  lpwm->mod.dwInstance = *lpdwInstance;
931  lpwm->mod.dnDevNode = 0;
932  lpwm->mod.cIds = cIDs;
933  if (cIDs)
934  memcpy(&(lpwm->mod.rgIds), lpIDs, cIDs * sizeof(MIDIOPENSTRMID));
935  }
936  return lpwm;
937 }
DWORD dwCallback
Definition: mmddk.h:413
DWORD cIds
Definition: mmddk.h:416
DWORD dwInstance
Definition: mmddk.h:414
MIDIOPENSTRMID rgIds
Definition: mmddk.h:417
LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD *dwFlags, DWORD_PTR *dwCallback, DWORD_PTR *dwInstance)
Definition: lolvldrv.c:123
MIDIOPENDESC mod
Definition: winemm.h:110
DWORD dnDevNode
Definition: mmddk.h:415
#define MMDRV_MIDIOUT
Definition: winemm.h:79
GLsizeiptr size
Definition: glext.h:5919
HMIDI hMidi
Definition: mmddk.h:412
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned int UINT
Definition: ndis.h:50
struct WINE_MIDI * LPWINE_MIDI

Referenced by midiOutOpen(), and midiStreamOpen().

◆ midiConnect()

MMRESULT WINAPI midiConnect ( HMIDI  hMidi,
HMIDIOUT  hmo,
LPVOID  pReserved 
)

Definition at line 1441 of file winmm.c.

1442 {
1443  FIXME("(%p, %p, %p): Stub\n", hMidi, hmo, pReserved);
1444  return MMSYSERR_ERROR;
1445 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define MMSYSERR_ERROR
Definition: mmsystem.h:97

◆ midiDisconnect()

MMRESULT WINAPI midiDisconnect ( HMIDI  hMidi,
HMIDIOUT  hmo,
LPVOID  pReserved 
)

Definition at line 1450 of file winmm.c.

1451 {
1452  FIXME("(%p, %p, %p): Stub\n", hMidi, hmo, pReserved);
1453  return MMSYSERR_ERROR;
1454 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define MMSYSERR_ERROR
Definition: mmsystem.h:97

◆ midiInAddBuffer()

UINT WINAPI midiInAddBuffer ( HMIDIIN  hMidiIn,
MIDIHDR lpMidiInHdr,
UINT  uSize 
)

Definition at line 1339 of file winmm.c.

1341 {
1342  LPWINE_MLD wmld;
1343 
1344  TRACE("(%p, %p, %d)\n", hMidiIn, lpMidiInHdr, uSize);
1345 
1346  if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1347  return MMSYSERR_INVALHANDLE;
1348 
1349  return MMDRV_Message(wmld, MIDM_ADDBUFFER, (DWORD_PTR)lpMidiInHdr, uSize);
1350 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMDRV_MIDIIN
Definition: winemm.h:78
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MIDM_ADDBUFFER
Definition: mmddk.h:175

Referenced by test_midiIn_device().

◆ midiInClose()

UINT WINAPI midiInClose ( HMIDIIN  hMidiIn)

Definition at line 1279 of file winmm.c.

1280 {
1281  LPWINE_MLD wmld;
1282  DWORD dwRet;
1283 
1284  TRACE("(%p)\n", hMidiIn);
1285 
1286  if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1287  return MMSYSERR_INVALHANDLE;
1288 
1289  dwRet = MMDRV_Close(wmld, MIDM_CLOSE);
1290  MMDRV_Free(hMidiIn, wmld);
1291  return dwRet;
1292 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MIDM_CLOSE
Definition: mmddk.h:172
#define MMDRV_MIDIIN
Definition: winemm.h:78
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD MMDRV_Close(LPWINE_MLD mld, UINT wMsg)
Definition: lolvldrv.c:228
void MMDRV_Free(HANDLE hndl, LPWINE_MLD mld)
Definition: lolvldrv.c:165

Referenced by test_midi_infns(), and test_midiIn_device().

◆ midiInGetDevCapsA()

UINT WINAPI midiInGetDevCapsA ( UINT_PTR  uDeviceID,
LPMIDIINCAPSA  lpCaps,
UINT  uSize 
)

Definition at line 1212 of file winmm.c.

1213 {
1214  MIDIINCAPSW micW;
1215  UINT ret;
1216 
1217  if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
1218 
1219  ret = midiInGetDevCapsW(uDeviceID, &micW, sizeof(micW));
1220 
1221  if (ret == MMSYSERR_NOERROR) {
1222  MIDIINCAPSA micA;
1223  micA.wMid = micW.wMid;
1224  micA.wPid = micW.wPid;
1225  micA.vDriverVersion = micW.vDriverVersion;
1226  WideCharToMultiByte( CP_ACP, 0, micW.szPname, -1, micA.szPname,
1227  sizeof(micA.szPname), NULL, NULL );
1228  micA.dwSupport = micW.dwSupport;
1229  memcpy(lpCaps, &micA, min(uSize, sizeof(micA)));
1230  }
1231  return ret;
1232 }
MMVERSION vDriverVersion
Definition: mmsystem.h:1145
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1146
MMVERSION vDriverVersion
Definition: mmsystem.h:1137
smooth NULL
Definition: ftsmooth.c:416
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
UINT WINAPI midiInGetDevCapsW(UINT_PTR uDeviceID, LPMIDIINCAPSW lpCaps, UINT uSize)
Definition: winmm.c:1195
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1138
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
DWORD dwSupport
Definition: mmsystem.h:1147
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
DWORD dwSupport
Definition: mmsystem.h:1139

Referenced by test_midiIn_device(), and test_midiOut_device().

◆ midiInGetDevCapsW()

UINT WINAPI midiInGetDevCapsW ( UINT_PTR  uDeviceID,
LPMIDIINCAPSW  lpCaps,
UINT  uSize 
)

Definition at line 1195 of file winmm.c.

1196 {
1197  LPWINE_MLD wmld;
1198 
1199  TRACE("(%ld, %p, %d);\n", uDeviceID, lpCaps, uSize);
1200 
1201  if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
1202 
1203  if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIDIIN, TRUE)) == NULL)
1204  return MMSYSERR_INVALHANDLE;
1205 
1206  return MMDRV_Message(wmld, MIDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
1207 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define TRUE
Definition: types.h:120
#define MMDRV_MIDIIN
Definition: winemm.h:78
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define MIDM_GETDEVCAPS
Definition: mmddk.h:170
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107

Referenced by create_system_ports_list(), and midiInGetDevCapsA().

◆ midiInGetID()

UINT WINAPI midiInGetID ( HMIDIIN  hMidiIn,
UINT lpuDeviceID 
)

Definition at line 1400 of file winmm.c.

1401 {
1402  LPWINE_MLD wmld;
1403 
1404  TRACE("(%p, %p)\n", hMidiIn, lpuDeviceID);
1405 
1406  if (lpuDeviceID == NULL) return MMSYSERR_INVALPARAM;
1407 
1408  if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, TRUE)) == NULL)
1409  return MMSYSERR_INVALHANDLE;
1410 
1411  *lpuDeviceID = wmld->uDeviceID;
1412 
1413  return MMSYSERR_NOERROR;
1414 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define TRUE
Definition: types.h:120
#define MMDRV_MIDIIN
Definition: winemm.h:78
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
UINT uDeviceID
Definition: winemm.h:94
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107

◆ midiInGetNumDevs()

UINT WINAPI midiInGetNumDevs ( void  )

Definition at line 1187 of file winmm.c.

1188 {
1189  return MMDRV_GetNum(MMDRV_MIDIIN);
1190 }
#define MMDRV_MIDIIN
Definition: winemm.h:78
UINT MMDRV_GetNum(UINT type)
Definition: lolvldrv.c:61

Referenced by create_system_ports_list(), and test_midi_infns().

◆ midiInMessage()

UINT WINAPI midiInMessage ( HMIDIIN  hMidiIn,
UINT  uMessage,
DWORD_PTR  dwParam1,
DWORD_PTR  dwParam2 
)

Definition at line 1419 of file winmm.c.

1421 {
1422  LPWINE_MLD wmld;
1423 
1424  TRACE("(%p, %04X, %08lX, %08lX)\n", hMidiIn, uMessage, dwParam1, dwParam2);
1425 
1426  if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1427  return MMSYSERR_INVALHANDLE;
1428 
1429  switch (uMessage) {
1430  case MIDM_OPEN:
1431  case MIDM_CLOSE:
1432  FIXME("can't handle OPEN or CLOSE message!\n");
1433  return MMSYSERR_NOTSUPPORTED;
1434  }
1435  return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2);
1436 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MIDM_CLOSE
Definition: mmddk.h:172
#define MMDRV_MIDIIN
Definition: winemm.h:78
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
#define MIDM_OPEN
Definition: mmddk.h:171

◆ midiInOpen()

MMRESULT WINAPI midiInOpen ( HMIDIIN *  lphMidiIn,
UINT  uDeviceID,
DWORD_PTR  dwCallback,
DWORD_PTR  dwInstance,
DWORD  dwFlags 
)

Definition at line 1237 of file winmm.c.

1239 {
1240  HANDLE hMidiIn;
1241  LPWINE_MIDI lpwm;
1242  DWORD dwRet;
1243 
1244  TRACE("(%p, %d, %08lX, %08lX, %08X);\n",
1245  lphMidiIn, uDeviceID, dwCallback, dwInstance, dwFlags);
1246 
1247  if (lphMidiIn != NULL) *lphMidiIn = 0;
1248 
1249  dwRet = WINMM_CheckCallback(dwCallback, dwFlags, FALSE);
1250  if (dwRet != MMSYSERR_NOERROR)
1251  return dwRet;
1252 
1253  lpwm = (LPWINE_MIDI)MMDRV_Alloc(sizeof(WINE_MIDI), MMDRV_MIDIIN, &hMidiIn,
1254  &dwFlags, &dwCallback, &dwInstance);
1255 
1256  if (lpwm == NULL)
1257  return MMSYSERR_NOMEM;
1258 
1259  lpwm->mod.hMidi = hMidiIn;
1260  lpwm->mod.dwCallback = dwCallback;
1261  lpwm->mod.dwInstance = dwInstance;
1262 
1263  lpwm->mld.uDeviceID = uDeviceID;
1264  dwRet = MMDRV_Open(&lpwm->mld, MIDM_OPEN, (DWORD_PTR)&lpwm->mod, dwFlags);
1265 
1266  if (dwRet != MMSYSERR_NOERROR) {
1267  MMDRV_Free(hMidiIn, &lpwm->mld);
1268  hMidiIn = 0;
1269  }
1270  if (lphMidiIn != NULL) *lphMidiIn = hMidiIn;
1271  TRACE("=> %d hMidi=%p\n", dwRet, hMidiIn);
1272 
1273  return dwRet;
1274 }
DWORD dwCallback
Definition: mmddk.h:413
WINE_MLD mld
Definition: winemm.h:109
#define MMDRV_MIDIIN
Definition: winemm.h:78
DWORD dwInstance
Definition: mmddk.h:414
LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD *dwFlags, DWORD_PTR *dwCallback, DWORD_PTR *dwInstance)
Definition: lolvldrv.c:123
MMRESULT WINMM_CheckCallback(DWORD_PTR dwCallback, DWORD fdwOpen, BOOL mixer)
Definition: winmm.c:196
MIDIOPENDESC mod
Definition: winemm.h:110
#define MMSYSERR_NOMEM
Definition: mmsystem.h:103
smooth NULL
Definition: ftsmooth.c:416
DWORD MMDRV_Open(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD dwFlags)
Definition: lolvldrv.c:183
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
HMIDI hMidi
Definition: mmddk.h:412
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MIDM_OPEN
Definition: mmddk.h:171
UINT uDeviceID
Definition: winemm.h:94
void MMDRV_Free(HANDLE hndl, LPWINE_MLD mld)
Definition: lolvldrv.c:165
struct WINE_MIDI * LPWINE_MIDI

Referenced by test_midi_infns(), and test_midiIn_device().

◆ midiInPrepareHeader()

UINT WINAPI midiInPrepareHeader ( HMIDIIN  hMidiIn,
MIDIHDR lpMidiInHdr,
UINT  uSize 
)

Definition at line 1297 of file winmm.c.

1299 {
1300  LPWINE_MLD wmld;
1301 
1302  TRACE("(%p, %p, %d)\n", hMidiIn, lpMidiInHdr, uSize);
1303 
1304  if (lpMidiInHdr == NULL || uSize < sizeof (MIDIHDR))
1305  return MMSYSERR_INVALPARAM;
1306 
1307  if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1308  return MMSYSERR_INVALHANDLE;
1309 
1310  return MMDRV_Message(wmld, MIDM_PREPARE, (DWORD_PTR)lpMidiInHdr, uSize);
1311 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMDRV_MIDIIN
Definition: winemm.h:78
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
#define MIDM_PREPARE
Definition: mmddk.h:173
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107

Referenced by test_midiIn_device().

◆ midiInReset()

UINT WINAPI midiInReset ( HMIDIIN  hMidiIn)

Definition at line 1385 of file winmm.c.

1386 {
1387  LPWINE_MLD wmld;
1388 
1389  TRACE("(%p)\n", hMidiIn);
1390 
1391  if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1392  return MMSYSERR_INVALHANDLE;
1393 
1394  return MMDRV_Message(wmld, MIDM_RESET, 0L, 0L);
1395 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMDRV_MIDIIN
Definition: winemm.h:78
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define MIDM_RESET
Definition: mmddk.h:178
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
static const WCHAR L[]
Definition: oid.c:1250

Referenced by test_midiIn_device().

◆ midiInStart()

UINT WINAPI midiInStart ( HMIDIIN  hMidiIn)

Definition at line 1355 of file winmm.c.

1356 {
1357  LPWINE_MLD wmld;
1358 
1359  TRACE("(%p)\n", hMidiIn);
1360 
1361  if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1362  return MMSYSERR_INVALHANDLE;
1363 
1364  return MMDRV_Message(wmld, MIDM_START, 0L, 0L);
1365 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMDRV_MIDIIN
Definition: winemm.h:78
#define MIDM_START
Definition: mmddk.h:176
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
static const WCHAR L[]
Definition: oid.c:1250

◆ midiInStop()

UINT WINAPI midiInStop ( HMIDIIN  hMidiIn)

Definition at line 1370 of file winmm.c.

1371 {
1372  LPWINE_MLD wmld;
1373 
1374  TRACE("(%p)\n", hMidiIn);
1375 
1376  if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1377  return MMSYSERR_INVALHANDLE;
1378 
1379  return MMDRV_Message(wmld, MIDM_STOP, 0L, 0L);
1380 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMDRV_MIDIIN
Definition: winemm.h:78
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
static const WCHAR L[]
Definition: oid.c:1250
#define MIDM_STOP
Definition: mmddk.h:177

◆ midiInUnprepareHeader()

UINT WINAPI midiInUnprepareHeader ( HMIDIIN  hMidiIn,
MIDIHDR lpMidiInHdr,
UINT  uSize 
)

Definition at line 1316 of file winmm.c.

1318 {
1319  LPWINE_MLD wmld;
1320 
1321  TRACE("(%p, %p, %d)\n", hMidiIn, lpMidiInHdr, uSize);
1322 
1323  if (lpMidiInHdr == NULL || uSize < sizeof (MIDIHDR))
1324  return MMSYSERR_INVALPARAM;
1325 
1326  if (!(lpMidiInHdr->dwFlags & MHDR_PREPARED)) {
1327  return MMSYSERR_NOERROR;
1328  }
1329 
1330  if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1331  return MMSYSERR_INVALHANDLE;
1332 
1333  return MMDRV_Message(wmld, MIDM_UNPREPARE, (DWORD_PTR)lpMidiInHdr, uSize);
1334 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMDRV_MIDIIN
Definition: winemm.h:78
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
#define MIDM_UNPREPARE
Definition: mmddk.h:174
DWORD dwFlags
Definition: mmsystem.h:1155
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define MHDR_PREPARED
Definition: mmsystem.h:269

Referenced by test_midiIn_device().

◆ midiOutCacheDrumPatches()

UINT WINAPI midiOutCacheDrumPatches ( HMIDIOUT  hMidiOut,
UINT  uPatch,
WORD lpwKeyArray,
UINT  uFlags 
)

Definition at line 1129 of file winmm.c.

1131 {
1132  FIXME("not supported yet\n");
1133  return MMSYSERR_NOTSUPPORTED;
1134 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104

◆ midiOutCachePatches()

UINT WINAPI midiOutCachePatches ( HMIDIOUT  hMidiOut,
UINT  uBank,
WORD lpwPatchArray,
UINT  uFlags 
)

Definition at line 1118 of file winmm.c.

1120 {
1121  /* not really necessary to support this */
1122  FIXME("not supported yet\n");
1123  return MMSYSERR_NOTSUPPORTED;
1124 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104

◆ midiOutClose()

UINT WINAPI midiOutClose ( HMIDIOUT  hMidiOut)

Definition at line 981 of file winmm.c.

982 {
983  LPWINE_MLD wmld;
984  DWORD dwRet;
985 
986  TRACE("(%p)\n", hMidiOut);
987 
988  if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
989  return MMSYSERR_INVALHANDLE;
990 
991  dwRet = MMDRV_Close(wmld, MODM_CLOSE);
992  MMDRV_Free(hMidiOut, wmld);
993 
994  return dwRet;
995 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define MODM_CLOSE
Definition: mmddk.h:157
#define TRACE(s)
Definition: solgame.cpp:4
#define MMDRV_MIDIOUT
Definition: winemm.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD MMDRV_Close(LPWINE_MLD mld, UINT wMsg)
Definition: lolvldrv.c:228
void MMDRV_Free(HANDLE hndl, LPWINE_MLD mld)
Definition: lolvldrv.c:165

Referenced by MIDI_player(), midiStreamClose(), modClose(), test_midi_outfns(), and test_midiOut_device().

◆ midiOutGetDevCapsA()

UINT WINAPI midiOutGetDevCapsA ( UINT_PTR  uDeviceID,
LPMIDIOUTCAPSA  lpCaps,
UINT  uSize 
)

Definition at line 835 of file winmm.c.

837 {
838  MIDIOUTCAPSW mocW;
839  UINT ret;
840 
841  if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
842 
843  ret = midiOutGetDevCapsW(uDeviceID, &mocW, sizeof(mocW));
844 
845  if (ret == MMSYSERR_NOERROR) {
846  MIDIOUTCAPSA mocA;
847  mocA.wMid = mocW.wMid;
848  mocA.wPid = mocW.wPid;
849  mocA.vDriverVersion = mocW.vDriverVersion;
850  WideCharToMultiByte( CP_ACP, 0, mocW.szPname, -1, mocA.szPname,
851  sizeof(mocA.szPname), NULL, NULL );
852  mocA.wTechnology = mocW.wTechnology;
853  mocA.wVoices = mocW.wVoices;
854  mocA.wNotes = mocW.wNotes;
855  mocA.wChannelMask = mocW.wChannelMask;
856  mocA.dwSupport = mocW.dwSupport;
857  memcpy(lpCaps, &mocA, min(uSize, sizeof(mocA)));
858  }
859  return ret;
860 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
MMVERSION vDriverVersion
Definition: mmsystem.h:1125
MMVERSION vDriverVersion
Definition: mmsystem.h:1113
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1114
smooth NULL
Definition: ftsmooth.c:416
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1126
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
UINT WINAPI midiOutGetDevCapsW(UINT_PTR uDeviceID, LPMIDIOUTCAPSW lpCaps, UINT uSize)
Definition: winmm.c:817
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50

Referenced by test_midi_outfns(), and test_midiOut_device().

◆ midiOutGetDevCapsW()

UINT WINAPI midiOutGetDevCapsW ( UINT_PTR  uDeviceID,
LPMIDIOUTCAPSW  lpCaps,
UINT  uSize 
)

Definition at line 817 of file winmm.c.

819 {
820  LPWINE_MLD wmld;
821 
822  TRACE("(%lu, %p, %u);\n", uDeviceID, lpCaps, uSize);
823 
824  if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
825 
826  if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIDIOUT, TRUE)) == NULL)
827  return MMSYSERR_INVALHANDLE;
828 
829  return MMDRV_Message(wmld, MODM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
830 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define TRUE
Definition: types.h:120
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define MODM_GETDEVCAPS
Definition: mmddk.h:155
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MMDRV_MIDIOUT
Definition: winemm.h:79
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107

Referenced by create_system_ports_list(), MIDIMAP_drvOpen(), midiOutGetDevCapsA(), register_midiout_devices(), and test_midiout().

◆ midiOutGetErrorTextA()

UINT WINAPI midiOutGetErrorTextA ( UINT  uError,
LPSTR  lpText,
UINT  uSize 
)

Definition at line 866 of file winmm.c.

867 {
868  UINT ret;
869 
870  if (lpText == NULL) ret = MMSYSERR_INVALPARAM;
871  else if (uSize == 0) ret = MMSYSERR_NOERROR;
872  else
873  {
874  LPWSTR xstr = HeapAlloc(GetProcessHeap(), 0, uSize * sizeof(WCHAR));
875  if (!xstr) ret = MMSYSERR_NOMEM;
876  else
877  {
878  ret = midiOutGetErrorTextW(uError, xstr, uSize);
879  if (ret == MMSYSERR_NOERROR)
880  WideCharToMultiByte(CP_ACP, 0, xstr, -1, lpText, uSize, NULL, NULL);
881  HeapFree(GetProcessHeap(), 0, xstr);
882  }
883  }
884  return ret;
885 }
UINT WINAPI midiOutGetErrorTextW(UINT uError, LPWSTR lpText, UINT uSize)
Definition: winmm.c:891
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
#define MMSYSERR_NOMEM
Definition: mmsystem.h:103
smooth NULL
Definition: ftsmooth.c:416
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
int ret
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
unsigned int UINT
Definition: ndis.h:50
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ midiOutGetErrorTextW()

UINT WINAPI midiOutGetErrorTextW ( UINT  uError,
LPWSTR  lpText,
UINT  uSize 
)

Definition at line 891 of file winmm.c.

892 {
894 
895  if (lpText == NULL) ret = MMSYSERR_INVALPARAM;
896  else if (uSize == 0) ret = MMSYSERR_NOERROR;
897  else if (
898  /* test has been removed because MMSYSERR_BASE is 0, and gcc did emit
899  * a warning for the test was always true */
900  (/*uError >= MMSYSERR_BASE && */ uError <= MMSYSERR_LASTERROR) ||
901  (uError >= MIDIERR_BASE && uError <= MIDIERR_LASTERROR)) {
902  if (LoadStringW(hWinMM32Instance, uError, lpText, uSize) > 0) {
904  }
905  }
906  return ret;
907 }
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
smooth NULL
Definition: ftsmooth.c:416
#define MMSYSERR_LASTERROR
Definition: mmsystem.h:118
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
int ret
#define MMSYSERR_BADERRNUM
Definition: mmsystem.h:105
#define MIDIERR_LASTERROR
Definition: mmsystem.h:239
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
unsigned int UINT
Definition: ndis.h:50
HINSTANCE hWinMM32Instance
Definition: winmm.c:50
#define MIDIERR_BASE
Definition: mmsystem.h:86

Referenced by midiOutGetErrorTextA().

◆ midiOutGetID()

UINT WINAPI midiOutGetID ( HMIDIOUT  hMidiOut,
UINT lpuDeviceID 
)

Definition at line 1139 of file winmm.c.

1140 {
1141  LPWINE_MLD wmld;
1142 
1143  TRACE("(%p, %p)\n", hMidiOut, lpuDeviceID);
1144 
1145  if (lpuDeviceID == NULL) return MMSYSERR_INVALPARAM;
1146  if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
1147  return MMSYSERR_INVALHANDLE;
1148 
1149  *lpuDeviceID = wmld->uDeviceID;
1150  return MMSYSERR_NOERROR;
1151 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MMDRV_MIDIOUT
Definition: winemm.h:79
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
UINT uDeviceID
Definition: winemm.h:94
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107

Referenced by test_midiOut_device().

◆ midiOutGetNumDevs()

UINT WINAPI midiOutGetNumDevs ( void  )

Definition at line 809 of file winmm.c.

810 {
811  return MMDRV_GetNum(MMDRV_MIDIOUT);
812 }
#define MMDRV_MIDIOUT
Definition: winemm.h:79
UINT MMDRV_GetNum(UINT type)
Definition: lolvldrv.c:61

Referenced by create_system_ports_list(), InitAudioDlg(), main(), MIDI_mciSet(), MIDIMAP_drvOpen(), register_midiout_devices(), test_midi_outfns(), and test_midiout().

◆ midiOutGetVolume()

UINT WINAPI midiOutGetVolume ( HMIDIOUT  hMidiOut,
DWORD lpdwVolume 
)

Definition at line 1088 of file winmm.c.

1089 {
1090  LPWINE_MLD wmld;
1091 
1092  TRACE("(%p, %p);\n", hMidiOut, lpdwVolume);
1093 
1094  if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) == NULL)
1095  return MMSYSERR_INVALHANDLE;
1096 
1097  return MMDRV_Message(wmld, MODM_GETVOLUME, (DWORD_PTR)lpdwVolume, 0L);
1098 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define TRUE
Definition: types.h:120
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MMDRV_MIDIOUT
Definition: winemm.h:79
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
static const WCHAR L[]
Definition: oid.c:1250
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MODM_GETVOLUME
Definition: mmddk.h:163

Referenced by test_midiOut_device().

◆ midiOutLongMsg()

UINT WINAPI midiOutLongMsg ( HMIDIOUT  hMidiOut,
MIDIHDR lpMidiOutHdr,
UINT  uSize 
)

Definition at line 1057 of file winmm.c.

1059 {
1060  LPWINE_MLD wmld;
1061 
1062  TRACE("(%p, %p, %d)\n", hMidiOut, lpMidiOutHdr, uSize);
1063 
1064  if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
1065  return MMSYSERR_INVALHANDLE;
1066 
1067  return MMDRV_Message(wmld, MODM_LONGDATA, (DWORD_PTR)lpMidiOutHdr, uSize);
1068 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MODM_LONGDATA
Definition: mmddk.h:161
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MMDRV_MIDIOUT
Definition: winemm.h:79
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
uint32_t DWORD_PTR
Definition: typedefs.h:63

Referenced by modLongData(), test_midiOut_device(), and test_midiStream().

◆ midiOutMessage()

UINT WINAPI midiOutMessage ( HMIDIOUT  hMidiOut,
UINT  uMessage,
DWORD_PTR  dwParam1,
DWORD_PTR  dwParam2 
)

Definition at line 1156 of file winmm.c.

1158 {
1159  LPWINE_MLD wmld;
1160 
1161  TRACE("(%p, %04X, %08lX, %08lX)\n", hMidiOut, uMessage, dwParam1, dwParam2);
1162 
1163  if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) {
1164  /* HACK... */
1165  if (uMessage == 0x0001) {
1166  *(LPDWORD)dwParam1 = 1;
1167  return 0;
1168  }
1169  if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) != NULL) {
1170  return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2);
1171  }
1172  return MMSYSERR_INVALHANDLE;
1173  }
1174 
1175  switch (uMessage) {
1176  case MODM_OPEN:
1177  case MODM_CLOSE:
1178  FIXME("can't handle OPEN or CLOSE message!\n");
1179  return MMSYSERR_NOTSUPPORTED;
1180  }
1181  return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2);
1182 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define TRUE
Definition: types.h:120
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define MODM_CLOSE
Definition: mmddk.h:157
#define TRACE(s)
Definition: solgame.cpp:4
#define MMDRV_MIDIOUT
Definition: winemm.h:79
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
#define MODM_OPEN
Definition: mmddk.h:156
#define LPDWORD
Definition: nt_native.h:46
UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:303

◆ midiOutOpen()

MMRESULT WINAPI midiOutOpen ( LPHMIDIOUT  lphMidiOut,
UINT  uDeviceID,
DWORD_PTR  dwCallback,
DWORD_PTR  dwInstance,
DWORD  dwFlags 
)

Definition at line 942 of file winmm.c.

944 {
945  HMIDIOUT hMidiOut;
946  LPWINE_MIDI lpwm;
947  UINT dwRet;
948 
949  TRACE("(%p, %d, %08lX, %08lX, %08X);\n",
950  lphMidiOut, uDeviceID, dwCallback, dwInstance, dwFlags);
951 
952  if (lphMidiOut != NULL) *lphMidiOut = 0;
953 
954  dwRet = WINMM_CheckCallback(dwCallback, dwFlags, FALSE);
955  if (dwRet != MMSYSERR_NOERROR)
956  return dwRet;
957 
958  lpwm = MIDI_OutAlloc(&hMidiOut, &dwCallback, &dwInstance, &dwFlags, 0, NULL);
959 
960  if (lpwm == NULL)
961  return MMSYSERR_NOMEM;
962 
963  lpwm->mld.uDeviceID = uDeviceID;
964 
965  dwRet = MMDRV_Open((LPWINE_MLD)lpwm, MODM_OPEN, (DWORD_PTR)&lpwm->mod, dwFlags);
966 
967  if (dwRet != MMSYSERR_NOERROR) {
968  MMDRV_Free(hMidiOut, (LPWINE_MLD)lpwm);
969  hMidiOut = 0;
970  }
971 
972  if (lphMidiOut) *lphMidiOut = hMidiOut;
973  TRACE("=> %d hMidi=%p\n", dwRet, hMidiOut);
974 
975  return dwRet;
976 }
static LPWINE_MIDI MIDI_OutAlloc(HMIDIOUT *lphMidiOut, DWORD_PTR *lpdwCallback, DWORD_PTR *lpdwInstance, LPDWORD lpdwFlags, DWORD cIDs, MIDIOPENSTRMID *lpIDs)
Definition: winmm.c:912
WINE_MLD mld
Definition: winemm.h:109
MMRESULT WINMM_CheckCallback(DWORD_PTR dwCallback, DWORD fdwOpen, BOOL mixer)
Definition: winmm.c:196
#define MMSYSERR_NOMEM
Definition: mmsystem.h:103
smooth NULL
Definition: ftsmooth.c:416
DWORD MMDRV_Open(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD dwFlags)
Definition: lolvldrv.c:183
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define MODM_OPEN
Definition: mmddk.h:156
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
uint32_t DWORD_PTR
Definition: typedefs.h:63
UINT uDeviceID
Definition: winemm.h:94
void MMDRV_Free(HANDLE hndl, LPWINE_MLD mld)
Definition: lolvldrv.c:165
unsigned int UINT
Definition: ndis.h:50

Referenced by main(), MIDI_player(), modData(), test_midi_outfns(), and test_midiOut_device().

◆ midiOutPrepareHeader()

UINT WINAPI midiOutPrepareHeader ( HMIDIOUT  hMidiOut,
MIDIHDR lpMidiOutHdr,
UINT  uSize 
)

Definition at line 1000 of file winmm.c.

1002 {
1003  LPWINE_MLD wmld;
1004 
1005  TRACE("(%p, %p, %d)\n", hMidiOut, lpMidiOutHdr, uSize);
1006 
1007  if (lpMidiOutHdr == NULL || uSize < sizeof (MIDIHDR))
1008  return MMSYSERR_INVALPARAM;
1009 
1010  if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
1011  return MMSYSERR_INVALHANDLE;
1012 
1013  return MMDRV_Message(wmld, MODM_PREPARE, (DWORD_PTR)lpMidiOutHdr, uSize);
1014 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define MODM_PREPARE
Definition: mmddk.h:158
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MMDRV_MIDIOUT
Definition: winemm.h:79
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107

Referenced by modLongData(), test_midiOut_device(), and test_midiStream().

◆ midiOutReset()

UINT WINAPI midiOutReset ( HMIDIOUT  hMidiOut)

Definition at line 1073 of file winmm.c.

1074 {
1075  LPWINE_MLD wmld;
1076 
1077  TRACE("(%p)\n", hMidiOut);
1078 
1079  if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
1080  return MMSYSERR_INVALHANDLE;
1081 
1082  return MMDRV_Message(wmld, MODM_RESET, 0L, 0L);
1083 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MMDRV_MIDIOUT
Definition: winemm.h:79
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
static const WCHAR L[]
Definition: oid.c:1250
#define MODM_RESET
Definition: mmddk.h:162

Referenced by MIDI_mciStop(), MIDI_player(), MMSYSTEM_MidiStream_MessageHandler(), modReset(), and test_midiOut_device().

◆ midiOutSetVolume()

UINT WINAPI midiOutSetVolume ( HMIDIOUT  hMidiOut,
DWORD  dwVolume 
)

Definition at line 1103 of file winmm.c.

1104 {
1105  LPWINE_MLD wmld;
1106 
1107  TRACE("(%p, %d);\n", hMidiOut, dwVolume);
1108 
1109  if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) == NULL)
1110  return MMSYSERR_INVALHANDLE;
1111 
1112  return MMDRV_Message(wmld, MODM_SETVOLUME, dwVolume, 0L);
1113 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define TRUE
Definition: types.h:120
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MMDRV_MIDIOUT
Definition: winemm.h:79
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
static const WCHAR L[]
Definition: oid.c:1250
#define MODM_SETVOLUME
Definition: mmddk.h:164

Referenced by test_midiOut_device().

◆ midiOutShortMsg()

UINT WINAPI midiOutShortMsg ( HMIDIOUT  hMidiOut,
DWORD  dwMsg 
)

Definition at line 1042 of file winmm.c.

1043 {
1044  LPWINE_MLD wmld;
1045 
1046  TRACE("(%p, %08X)\n", hMidiOut, dwMsg);
1047 
1048  if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
1049  return MMSYSERR_INVALHANDLE;
1050 
1051  return MMDRV_Message(wmld, MODM_DATA, dwMsg, 0L);
1052 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MMDRV_MIDIOUT
Definition: winemm.h:79
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
static const WCHAR L[]
Definition: oid.c:1250
#define MODM_DATA
Definition: mmddk.h:160

Referenced by main(), MIDI_mciPause(), MIDI_player(), MMSYSTEM_MidiStream_Player(), modData(), and test_midiOut_device().

◆ midiOutUnprepareHeader()

UINT WINAPI midiOutUnprepareHeader ( HMIDIOUT  hMidiOut,
MIDIHDR lpMidiOutHdr,
UINT  uSize 
)

Definition at line 1019 of file winmm.c.

1021 {
1022  LPWINE_MLD wmld;
1023 
1024  TRACE("(%p, %p, %d)\n", hMidiOut, lpMidiOutHdr, uSize);
1025 
1026  if (lpMidiOutHdr == NULL || uSize < sizeof (MIDIHDR))
1027  return MMSYSERR_INVALPARAM;
1028 
1029  if (!(lpMidiOutHdr->dwFlags & MHDR_PREPARED)) {
1030  return MMSYSERR_NOERROR;
1031  }
1032 
1033  if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
1034  return MMSYSERR_INVALHANDLE;
1035 
1036  return MMDRV_Message(wmld, MODM_UNPREPARE, (DWORD_PTR)lpMidiOutHdr, uSize);
1037 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define MODM_UNPREPARE
Definition: mmddk.h:159
#define TRACE(s)
Definition: solgame.cpp:4
#define MMDRV_MIDIOUT
Definition: winemm.h:79
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
DWORD dwFlags
Definition: mmsystem.h:1155
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define MHDR_PREPARED
Definition: mmsystem.h:269

Referenced by modLongData(), test_midiOut_device(), and test_midiStream().

◆ midiStreamClose()

MMRESULT WINAPI midiStreamClose ( HMIDISTRM  hMidiStrm)

Definition at line 1778 of file winmm.c.

1779 {
1780  WINE_MIDIStream* lpMidiStrm;
1781 
1782  TRACE("(%p)!\n", hMidiStrm);
1783 
1784  if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL))
1785  return MMSYSERR_INVALHANDLE;
1786 
1787  midiStreamStop(hMidiStrm);
1788  MMSYSTEM_MidiStream_PostMessage(lpMidiStrm, WM_QUIT, 0, 0);
1789  HeapFree(GetProcessHeap(), 0, lpMidiStrm);
1790  CloseHandle(lpMidiStrm->hEvent);
1791 
1792  return midiOutClose((HMIDIOUT)hMidiStrm);
1793 }
#define CloseHandle
Definition: compat.h:398
HANDLE hEvent
Definition: winmm.c:1466
static BOOL MMSYSTEM_GetMidiStream(HMIDISTRM hMidiStrm, WINE_MIDIStream **lpMidiStrm, WINE_MIDI **lplpwm)
Definition: winmm.c:1476
#define WM_QUIT
Definition: winuser.h:1605
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
static BOOL MMSYSTEM_MidiStream_PostMessage(WINE_MIDIStream *lpMidiStrm, WORD msg, DWORD pmt1, DWORD pmt2)
Definition: winmm.c:1760
MMRESULT WINAPI midiStreamStop(HMIDISTRM hMidiStrm)
Definition: winmm.c:2038
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
UINT WINAPI midiOutClose(HMIDIOUT hMidiOut)
Definition: winmm.c:981
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by midiStreamOpen(), and test_midiStream().

◆ midiStreamOpen()

MMRESULT WINAPI midiStreamOpen ( HMIDISTRM *  lphMidiStrm,
LPUINT  lpuDeviceID,
DWORD  cMidi,
DWORD_PTR  dwCallback,
DWORD_PTR  dwInstance,
DWORD  fdwOpen 
)

Definition at line 1798 of file winmm.c.

1801 {
1802  WINE_MIDIStream* lpMidiStrm;
1803  MMRESULT ret;
1804  MIDIOPENSTRMID mosm;
1805  LPWINE_MIDI lpwm;
1806  HMIDIOUT hMidiOut;
1807 
1808  TRACE("(%p, %p, %d, 0x%08lx, 0x%08lx, 0x%08x)!\n",
1809  lphMidiStrm, lpuDeviceID, cMidi, dwCallback, dwInstance, fdwOpen);
1810 
1811  if (cMidi != 1 || lphMidiStrm == NULL || lpuDeviceID == NULL)
1812  return MMSYSERR_INVALPARAM;
1813 
1814  ret = WINMM_CheckCallback(dwCallback, fdwOpen, FALSE);
1815  if (ret != MMSYSERR_NOERROR)
1816  return ret;
1817 
1818  lpMidiStrm = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_MIDIStream));
1819  if (!lpMidiStrm)
1820  return MMSYSERR_NOMEM;
1821 
1822  lpMidiStrm->dwTempo = 500000;
1823  lpMidiStrm->dwTimeDiv = 480; /* 480 is 120 quarter notes per minute *//* FIXME ??*/
1824  lpMidiStrm->dwPositionMS = 0;
1825 
1826  mosm.dwStreamID = (DWORD_PTR)lpMidiStrm; // FIXME: not 64 bit safe
1827  /* FIXME: the correct value is not allocated yet for MAPPER */
1828  mosm.wDeviceID = *lpuDeviceID;
1829  lpwm = MIDI_OutAlloc(&hMidiOut, &dwCallback, &dwInstance, &fdwOpen, 1, &mosm);
1830  lpMidiStrm->hDevice = hMidiOut;
1831  *lphMidiStrm = (HMIDISTRM)hMidiOut;
1832 
1833  lpwm->mld.uDeviceID = *lpuDeviceID;
1834 
1835  ret = MMDRV_Open(&lpwm->mld, MODM_OPEN, (DWORD_PTR)&lpwm->mod, fdwOpen);
1836  lpMidiStrm->hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
1837  lpMidiStrm->wFlags = HIWORD(fdwOpen);
1838 
1840  lpMidiStrm, 0, &(lpMidiStrm->dwThreadID));
1841 
1842  if (!lpMidiStrm->hThread) {
1843  midiStreamClose((HMIDISTRM)hMidiOut);
1844  return MMSYSERR_NOMEM;
1845  }
1847 
1848  /* wait for thread to have started, and for its queue to be created */
1849  {
1850  //DWORD count;
1851 
1852  /* (Release|Restore)ThunkLock() is needed when this method is called from 16 bit code,
1853  * (meaning the Win16Lock is set), so that it's released and the 32 bit thread running
1854  * MMSYSTEM_MidiStreamPlayer can acquire Win16Lock to create its queue.
1855  */
1856  //ReleaseThunkLock(&count);
1857  WaitForSingleObject(lpMidiStrm->hEvent, INFINITE);
1858  //RestoreThunkLock(count);
1859  }
1860 
1861  TRACE("=> (%u/%d) hMidi=%p ret=%d lpMidiStrm=%p\n",
1862  *lpuDeviceID, lpwm->mld.uDeviceID, *lphMidiStrm, ret, lpMidiStrm);
1863  return ret;
1864 }
DWORD dwTimeDiv
Definition: winmm.c:1461
static LPWINE_MIDI MIDI_OutAlloc(HMIDIOUT *lphMidiOut, DWORD_PTR *lpdwCallback, DWORD_PTR *lpdwInstance, LPDWORD lpdwFlags, DWORD cIDs, MIDIOPENSTRMID *lpIDs)
Definition: winmm.c:912
WINE_MLD mld
Definition: winemm.h:109
#define DWORD_PTR
Definition: treelist.c:76
DWORD dwPositionMS
Definition: winmm.c:1462
HANDLE hEvent
Definition: winmm.c:1466
WORD wDeviceID
Definition: mmddk.h:408
UINT MMRESULT
Definition: mmsystem.h:962
MMRESULT WINMM_CheckCallback(DWORD_PTR dwCallback, DWORD fdwOpen, BOOL mixer)
Definition: winmm.c:196
HANDLE hThread
Definition: winmm.c:1458
MIDIOPENDESC mod
Definition: winemm.h:110
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define MMSYSERR_NOMEM
Definition: mmsystem.h:103
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)
Definition: thread.c:111
smooth NULL
Definition: ftsmooth.c:416
DWORD MMDRV_Open(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD dwFlags)
Definition: lolvldrv.c:183
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
Definition: thread.c:661
DWORD dwThreadID
Definition: winmm.c:1459
MMRESULT WINAPI midiStreamClose(HMIDISTRM hMidiStrm)
Definition: winmm.c:1778
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HMIDIOUT hDevice
Definition: winmm.c:1457
#define MODM_OPEN
Definition: mmddk.h:156
#define THREAD_PRIORITY_TIME_CRITICAL
Definition: winbase.h:278
int ret
DWORD dwTempo
Definition: winmm.c:1460
uint32_t DWORD_PTR
Definition: typedefs.h:63
static DWORD CALLBACK MMSYSTEM_MidiStream_Player(LPVOID pmt)
Definition: winmm.c:1635
UINT uDeviceID
Definition: winemm.h:94
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
DWORD dwStreamID
Definition: mmddk.h:407
#define HIWORD(l)
Definition: typedefs.h:246
#define INFINITE
Definition: serial.h:102

Referenced by test_midiStream().

◆ midiStreamOut()

MMRESULT WINAPI midiStreamOut ( HMIDISTRM  hMidiStrm,
LPMIDIHDR  lpMidiHdr,
UINT  cbMidiHdr 
)

Definition at line 1869 of file winmm.c.

1871 {
1872  WINE_MIDIStream* lpMidiStrm;
1874 
1875  TRACE("(%p, %p, %u)!\n", hMidiStrm, lpMidiHdr, cbMidiHdr);
1876 
1877  if (cbMidiHdr < offsetof(MIDIHDR,dwOffset) || !lpMidiHdr || !lpMidiHdr->lpData
1878  || lpMidiHdr->dwBufferLength < lpMidiHdr->dwBytesRecorded
1879  || lpMidiHdr->dwBytesRecorded % 4 /* player expects DWORD padding */)
1880  return MMSYSERR_INVALPARAM;
1881  /* FIXME: Native additionally checks if the MIDIEVENTs in lpData
1882  * exactly fit dwBytesRecorded. */
1883 
1884  if (!(lpMidiHdr->dwFlags & MHDR_PREPARED))
1885  return MIDIERR_UNPREPARED;
1886 
1887  if (lpMidiHdr->dwFlags & MHDR_INQUEUE)
1888  return MIDIERR_STILLPLAYING;
1889 
1890  if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) {
1892  } else {
1893  lpMidiHdr->dwFlags |= MHDR_ISSTRM;
1894  if (!PostThreadMessageA(lpMidiStrm->dwThreadID,
1895  WINE_MSM_HEADER, cbMidiHdr,
1896  (LPARAM)lpMidiHdr)) {
1897  WARN("bad PostThreadMessageA\n");
1898  ret = MMSYSERR_ERROR;
1899  }
1900  }
1901  return ret;
1902 }
LPSTR lpData
Definition: mmsystem.h:1151
#define MIDIERR_STILLPLAYING
Definition: mmsystem.h:232
DWORD dwBufferLength
Definition: mmsystem.h:1152
static BOOL MMSYSTEM_GetMidiStream(HMIDISTRM hMidiStrm, WINE_MIDIStream **lpMidiStrm, WINE_MIDI **lplpwm)
Definition: winmm.c:1476
#define WARN(fmt,...)
Definition: debug.h:111
#define WINE_MSM_HEADER
Definition: winmm.c:1470
BOOL WINAPI PostThreadMessageA(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
_In_ DWORD _In_ DWORD dwOffset
Definition: ntgdi.h:2032
#define MIDIERR_UNPREPARED
Definition: mmsystem.h:231
smooth NULL
Definition: ftsmooth.c:416
#define offsetof(TYPE, MEMBER)
LONG_PTR LPARAM
Definition: windef.h:208
#define MHDR_ISSTRM
Definition: mmsystem.h:271
DWORD dwThreadID
Definition: winmm.c:1459
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define MMSYSERR_ERROR
Definition: mmsystem.h:97
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwFlags
Definition: mmsystem.h:1155
int ret
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define MHDR_INQUEUE
Definition: mmsystem.h:270
#define MHDR_PREPARED
Definition: mmsystem.h:269
DWORD dwBytesRecorded
Definition: mmsystem.h:1153

Referenced by playStream(), and test_midiStream().

◆ midiStreamPause()

MMRESULT WINAPI midiStreamPause ( HMIDISTRM  hMidiStrm)

Definition at line 1907 of file winmm.c.

1908 {
1909  WINE_MIDIStream* lpMidiStrm;
1911 
1912  TRACE("(%p)!\n", hMidiStrm);
1913 
1914  if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) {
1916  } else {
1917  if (SuspendThread(lpMidiStrm->hThread) == 0xFFFFFFFF) {
1918  WARN("bad Suspend (%d)\n", GetLastError());
1919  ret = MMSYSERR_ERROR;
1920  }
1921  }
1922  return ret;
1923 }
static BOOL MMSYSTEM_GetMidiStream(HMIDISTRM hMidiStrm, WINE_MIDIStream **lpMidiStrm, WINE_MIDI **lplpwm)
Definition: winmm.c:1476
#define WARN(fmt,...)
Definition: debug.h:111
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
HANDLE hThread
Definition: winmm.c:1458
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define MMSYSERR_ERROR
Definition: mmsystem.h:97
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
DWORD WINAPI SuspendThread(IN HANDLE hThread)
Definition: thread.c:603

◆ midiStreamPosition()

MMRESULT WINAPI midiStreamPosition ( HMIDISTRM  hMidiStrm,
LPMMTIME  lpMMT,
UINT  cbmmt 
)

Definition at line 1928 of file winmm.c.

1929 {
1930  WINE_MIDIStream* lpMidiStrm;
1932 
1933  TRACE("(%p, %p, %u)!\n", hMidiStrm, lpMMT, cbmmt);
1934 
1935  if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) {
1937  } else if (lpMMT == NULL || cbmmt != sizeof(MMTIME)) {
1939  } else {
1940  switch (lpMMT->wType) {
1941  case TIME_MS:
1942  lpMMT->u.ms = lpMidiStrm->dwPositionMS;
1943  TRACE("=> %d ms\n", lpMMT->u.ms);
1944  break;
1945  case TIME_TICKS:
1946  lpMMT->u.ticks = lpMidiStrm->dwPulses;
1947  TRACE("=> %d ticks\n", lpMMT->u.ticks);
1948  break;
1949  default:
1950  WARN("Unsupported time type %d\n", lpMMT->wType);
1951  lpMMT->wType = TIME_MS;
1953  break;
1954  }
1955  }
1956  return ret;
1957 }
DWORD dwPositionMS
Definition: winmm.c:1462
UINT wType
Definition: mmsystem.h:965
static BOOL MMSYSTEM_GetMidiStream(HMIDISTRM hMidiStrm, WINE_MIDIStream **lpMidiStrm, WINE_MIDI **lplpwm)
Definition: winmm.c:1476
#define WARN(fmt,...)
Definition: debug.h:111
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
DWORD ticks
Definition: mmsystem.h:970
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define TIME_MS
Definition: mmsystem.h:28
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define TIME_TICKS
Definition: mmsystem.h:33
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
DWORD dwPulses
Definition: winmm.c:1463
DWORD ms
Definition: mmsystem.h:967
union mmtime_tag::@2908 u

Referenced by test_position().

◆ midiStreamProperty()

MMRESULT WINAPI midiStreamProperty ( HMIDISTRM  hMidiStrm,
LPBYTE  lpPropData,
DWORD  dwProperty 
)

Definition at line 1962 of file winmm.c.

1963 {
1964  WINE_MIDIStream* lpMidiStrm;
1966 
1967  TRACE("(%p, %p, %x)\n", hMidiStrm, lpPropData, dwProperty);
1968 
1969  if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) {
1971  } else if ((dwProperty & (MIDIPROP_GET|MIDIPROP_SET)) == 0) {
1973  } else if (dwProperty & MIDIPROP_TEMPO) {
1974  MIDIPROPTEMPO* mpt = (MIDIPROPTEMPO*)lpPropData;
1975 
1976  if (sizeof(MIDIPROPTEMPO) != mpt->cbStruct) {
1978  } else if (dwProperty & MIDIPROP_SET) {
1979  lpMidiStrm->dwTempo = mpt->dwTempo;
1980  TRACE("Setting tempo to %d\n", mpt->dwTempo);
1981  } else if (dwProperty & MIDIPROP_GET) {
1982  mpt->dwTempo = lpMidiStrm->dwTempo;
1983  TRACE("Getting tempo <= %d\n", mpt->dwTempo);
1984  }
1985  } else if (dwProperty & MIDIPROP_TIMEDIV) {
1986  MIDIPROPTIMEDIV* mptd = (MIDIPROPTIMEDIV*)lpPropData;
1987 
1988  if (sizeof(MIDIPROPTIMEDIV) != mptd->cbStruct) {
1990  } else if (dwProperty & MIDIPROP_SET) {
1991  lpMidiStrm->dwTimeDiv = mptd->dwTimeDiv;
1992  TRACE("Setting time div to %d\n", mptd->dwTimeDiv);
1993  } else if (dwProperty & MIDIPROP_GET) {
1994  mptd->dwTimeDiv = lpMidiStrm->dwTimeDiv;
1995  TRACE("Getting time div <= %d\n", mptd->dwTimeDiv);
1996  }
1997  } else {
1999  }
2000 
2001  return ret;
2002 }
DWORD dwTimeDiv
Definition: winmm.c:1461
static BOOL MMSYSTEM_GetMidiStream(HMIDISTRM hMidiStrm, WINE_MIDIStream **lpMidiStrm, WINE_MIDI **lplpwm)
Definition: winmm.c:1476
UINT MMRESULT
Definition: mmsystem.h:962
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
#define MIDIPROP_GET
Definition: mmsystem.h:285
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define MIDIPROP_SET
Definition: mmsystem.h:284
int ret
DWORD dwTempo
Definition: winmm.c:1460
#define MIDIPROP_TEMPO
Definition: mmsystem.h:287
#define MIDIPROP_TIMEDIV
Definition: mmsystem.h:286
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107

Referenced by test_midiStream().

◆ midiStreamRestart()

MMRESULT WINAPI midiStreamRestart ( HMIDISTRM  hMidiStrm)

Definition at line 2007 of file winmm.c.

2008 {
2009  WINE_MIDIStream* lpMidiStrm;
2011 
2012  TRACE("(%p)!\n", hMidiStrm);
2013 
2014  if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) {
2016  } else {
2017  DWORD ret;
2018 
2019  /* since we increase the thread suspend count on each midiStreamPause
2020  * there may be a need for several midiStreamResume
2021  */
2022  do {
2023  ret = ResumeThread(lpMidiStrm->hThread);
2024  } while (ret != 0xFFFFFFFF && ret != 0);
2025  if (ret == 0xFFFFFFFF) {
2026  WARN("bad Resume (%d)\n", GetLastError());
2027  ret = MMSYSERR_ERROR;
2028  } else {
2029  lpMidiStrm->dwStartTicks = GetTickCount() - lpMidiStrm->dwPositionMS;
2030  }
2031  }
2032  return ret;
2033 }
DWORD dwPositionMS
Definition: winmm.c:1462
static BOOL MMSYSTEM_GetMidiStream(HMIDISTRM hMidiStrm, WINE_MIDIStream **lpMidiStrm, WINE_MIDI **lplpwm)
Definition: winmm.c:1476
#define WARN(fmt,...)
Definition: debug.h:111
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
UINT MMRESULT
Definition: mmsystem.h:962
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
HANDLE hThread
Definition: winmm.c:1458
DWORD dwStartTicks
Definition: winmm.c:1464
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define MMSYSERR_ERROR
Definition: mmsystem.h:97
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
DWORD WINAPI ResumeThread(IN HANDLE hThread)
Definition: thread.c:528

Referenced by midiStreamStop(), and test_midiStream().

◆ midiStreamStop()

MMRESULT WINAPI midiStreamStop ( HMIDISTRM  hMidiStrm)

Definition at line 2038 of file winmm.c.

2039 {
2040  WINE_MIDIStream* lpMidiStrm;
2042 
2043  TRACE("(%p)!\n", hMidiStrm);
2044 
2045  if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) {
2047  } else {
2048  /* in case stream has been paused... FIXME is the current state correct ? */
2049  midiStreamRestart(hMidiStrm);
2051  }
2052  return ret;
2053 }
static BOOL MMSYSTEM_GetMidiStream(HMIDISTRM hMidiStrm, WINE_MIDIStream **lpMidiStrm, WINE_MIDI **lplpwm)
Definition: winmm.c:1476
#define WINE_MSM_STOP
Definition: winmm.c:1471
UINT MMRESULT
Definition: mmsystem.h:962
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
static BOOL MMSYSTEM_MidiStream_PostMessage(WINE_MIDIStream *lpMidiStrm, WORD msg, DWORD pmt1, DWORD pmt2)
Definition: winmm.c:1760
smooth NULL
Definition: ftsmooth.c:416
MMRESULT WINAPI midiStreamRestart(HMIDISTRM hMidiStrm)
Definition: winmm.c:2007
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
int ret

Referenced by midiStreamClose(), and test_midiStream().

◆ MIXER_GetDev()

static UINT MIXER_GetDev ( HMIXEROBJ  hmix,
DWORD  dwFlags,
LPWINE_MIXER lplpwm 
)
static

Definition at line 229 of file winmm.c.

230 {
231  LPWINE_MIXER lpwm = NULL;
232  UINT uRet = MMSYSERR_NOERROR;
233 
234  switch (dwFlags & 0xF0000000ul) {
235  case MIXER_OBJECTF_MIXER:
236  lpwm = (LPWINE_MIXER)MMDRV_Get(hmix, MMDRV_MIXER, TRUE);
237  break;
239  lpwm = (LPWINE_MIXER)MMDRV_Get(hmix, MMDRV_MIXER, FALSE);
240  break;
243  break;
246  break;
249  break;
252  break;
255  break;
258  break;
261  break;
264  break;
265  case MIXER_OBJECTF_AUX:
267  break;
268  default:
269  WARN("Unsupported flag (%08lx)\n", dwFlags & 0xF0000000ul);
270  lpwm = 0;
271  uRet = MMSYSERR_INVALFLAG;
272  break;
273  }
274  *lplpwm = lpwm;
275  if (lpwm == 0 && uRet == MMSYSERR_NOERROR)
276  uRet = MMSYSERR_INVALPARAM;
277  return uRet;
278 }
#define MIXER_OBJECTF_HWAVEIN
Definition: mmsystem.h:305
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
struct WINE_MIXER * LPWINE_MIXER
#define MMDRV_MIXER
Definition: winemm.h:77
#define TRUE
Definition: types.h:120
#define MMDRV_MIDIIN
Definition: winemm.h:78
#define WARN(fmt,...)
Definition: debug.h:111
#define MIXER_OBJECTF_MIDIIN
Definition: mmsystem.h:308
#define MIXER_OBJECTF_HMIDIOUT
Definition: mmsystem.h:307
#define MIXER_OBJECTF_MIDIOUT
Definition: mmsystem.h:306
#define MMDRV_WAVEOUT
Definition: winemm.h:81
#define MIXER_OBJECTF_MIXER
Definition: mmsystem.h:300
#define MMDRV_AUX
Definition: winemm.h:76
LPWINE_MLD MMDRV_GetRelated(HANDLE hndl, UINT srcType, BOOL bSrcCanBeID, UINT dstType)
Definition: lolvldrv.c:285
#define MMDRV_WAVEIN
Definition: winemm.h:80
smooth NULL
Definition: ftsmooth.c:416
#define MIXER_OBJECTF_HMIDIIN
Definition: mmsystem.h:309
#define MIXER_OBJECTF_HWAVEOUT
Definition: mmsystem.h:303
#define MMDRV_MIDIOUT
Definition: winemm.h:79
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define MIXER_OBJECTF_WAVEIN
Definition: mmsystem.h:304
#define MIXER_OBJECTF_AUX
Definition: mmsystem.h:310
#define MMSYSERR_INVALFLAG
Definition: mmsystem.h:106
#define MIXER_OBJECTF_HMIXER
Definition: mmsystem.h:301
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define MIXER_OBJECTF_WAVEOUT
Definition: mmsystem.h:302
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
unsigned int UINT
Definition: ndis.h:50

Referenced by mixerGetControlDetailsW(), mixerGetID(), mixerGetLineControlsW(), mixerGetLineInfoW(), and mixerSetControlDetails().

◆ MIXER_WCallback()

static void CALLBACK MIXER_WCallback ( HMIXEROBJ  hmx,
UINT  uMsg,
DWORD_PTR  dwInstance,
DWORD_PTR  dwParam,
DWORD_PTR  param2 
)
static

Definition at line 329 of file winmm.c.

330 {
331  HWND hWnd = (HWND)dwInstance;
332 
333  if (!dwInstance)
334  return;
335 
336  PostMessageW(hWnd, uMsg, (WPARAM)hmx, (LPARAM)dwParam);
337 }
HWND hWnd
Definition: settings.c:17
HANDLE HWND
Definition: compat.h:13
UINT_PTR WPARAM
Definition: windef.h:207
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by mixerOpen().

◆ mixerClose()

UINT WINAPI mixerClose ( HMIXER  hMix)

Definition at line 389 of file winmm.c.

390 {
391  LPWINE_MLD wmld;
392  DWORD dwRet;
393 
394  TRACE("(%p)\n", hMix);
395 
396  if ((wmld = MMDRV_Get(hMix, MMDRV_MIXER, FALSE)) == NULL) return MMSYSERR_INVALHANDLE;
397 
398  dwRet = MMDRV_Close(wmld, MXDM_CLOSE);
399  MMDRV_Free(hMix, wmld);
400 
401  return dwRet;
402 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMDRV_MIXER
Definition: winemm.h:77
#define MXDM_CLOSE
Definition: mmddk.h:194
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD MMDRV_Close(LPWINE_MLD mld, UINT wMsg)
Definition: lolvldrv.c:228
void MMDRV_Free(HANDLE hndl, LPWINE_MLD mld)
Definition: lolvldrv.c:165

Referenced by SndMixerClose(), SndMixerEnumProducts(), SndMixerSelect(), SpeakerVolumeDlgProc(), test_mixerClose(), TrayDlgProc(), and VolumeDlgProc().

◆ mixerGetControlDetailsA()

UINT WINAPI mixerGetControlDetailsA ( HMIXEROBJ  hmix,
LPMIXERCONTROLDETAILS  lpmcdA,
DWORD  fdwDetails 
)

Definition at line 447 of file winmm.c.

449 {
451 
452  TRACE("(%p, %p, %08x)\n", hmix, lpmcdA, fdwDetails);
453 
454  if (lpmcdA == NULL || lpmcdA->cbStruct != sizeof(*lpmcdA))
455  return MMSYSERR_INVALPARAM;
456 
457  switch (fdwDetails & MIXER_GETCONTROLDETAILSF_QUERYMASK) {
459  /* can safely use A structure as it is, no string inside */
460  ret = mixerGetControlDetailsW(hmix, lpmcdA, fdwDetails);
461  break;
463  {
464  MIXERCONTROLDETAILS_LISTTEXTA *pDetailsA = lpmcdA->paDetails;
466  int size = max(1, lpmcdA->cChannels) * sizeof(MIXERCONTROLDETAILS_LISTTEXTW);
467  unsigned int i;
468 
469  if (lpmcdA->u.cMultipleItems != 0) {
470  size *= lpmcdA->u.cMultipleItems;
471  }
472  pDetailsW = HeapAlloc(GetProcessHeap(), 0, size);
473  lpmcdA->paDetails = pDetailsW;
474  lpmcdA->cbDetails = sizeof(MIXERCONTROLDETAILS_LISTTEXTW);
475  /* set up lpmcd->paDetails */
476  ret = mixerGetControlDetailsW(hmix, lpmcdA, fdwDetails);
477  /* copy from lpmcd->paDetails back to paDetailsW; */
478  if (ret == MMSYSERR_NOERROR) {
479  for (i = 0; i < lpmcdA->u.cMultipleItems * lpmcdA->cChannels; i++) {
480  pDetailsA->dwParam1 = pDetailsW->dwParam1;
481  pDetailsA->dwParam2 = pDetailsW->dwParam2;
482  WideCharToMultiByte( CP_ACP, 0, pDetailsW->szName, -1,
483  pDetailsA->szName,
484  sizeof(pDetailsA->szName), NULL, NULL );
485  pDetailsA++;
486  pDetailsW++;
487  }
488  pDetailsA -= lpmcdA->u.cMultipleItems * lpmcdA->cChannels;
489  pDetailsW -= lpmcdA->u.cMultipleItems * lpmcdA->cChannels;
490  }
491  HeapFree(GetProcessHeap(), 0, pDetailsW);
492  lpmcdA->paDetails = pDetailsA;
493  lpmcdA->cbDetails = sizeof(MIXERCONTROLDETAILS_LISTTEXTA);
494  }
495  break;
496  default:
497  ERR("Unsupported fdwDetails=0x%08x\n", fdwDetails);
498  }
499 
500  return ret;
501 }
#define max(a, b)
Definition: svc.c:63
#define MIXER_GETCONTROLDETAILSF_VALUE
Definition: mmsystem.h:412
#define WideCharToMultiByte
Definition: compat.h:101
UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdW, DWORD fdwDetails)
Definition: winmm.c:426
#define CP_ACP
Definition: compat.h:99
CHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1368
#define MIXER_GETCONTROLDETAILSF_LISTTEXT
Definition: mmsystem.h:413
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 i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
WCHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1374
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MIXER_GETCONTROLDETAILSF_QUERYMASK
Definition: mmsystem.h:414
#define MMSYSERR_NOTENABLED
Definition: mmsystem.h:99
int ret
struct tagMIXERCONTROLDETAILS_LISTTEXTW MIXERCONTROLDETAILS_LISTTEXTW
struct tagMIXERCONTROLDETAILS_LISTTEXTA MIXERCONTROLDETAILS_LISTTEXTA
#define ERR(fmt,...)
Definition: debug.h:109
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by mixer_test_controlA().

◆ mixerGetControlDetailsW()

UINT WINAPI mixerGetControlDetailsW ( HMIXEROBJ  hmix,
LPMIXERCONTROLDETAILS  lpmcdW,
DWORD  fdwDetails 
)

Definition at line 426 of file winmm.c.

428 {
429  LPWINE_MIXER lpwm;
430  UINT uRet = MMSYSERR_NOERROR;
431 
432  TRACE("(%p, %p, %08x)\n", hmix, lpmcdW, fdwDetails);
433 
434  if ((uRet = MIXER_GetDev(hmix, fdwDetails, &lpwm)) != MMSYSERR_NOERROR)
435  return uRet;
436 
437  if (lpmcdW == NULL || lpmcdW->cbStruct != sizeof(*lpmcdW))
438  return MMSYSERR_INVALPARAM;
439 
440  return MMDRV_Message(&lpwm->mld, MXDM_GETCONTROLDETAILS, (DWORD_PTR)lpmcdW,
441  fdwDetails);
442 }
WINE_MLD mld
Definition: winemm.h:114
smooth NULL
Definition: ftsmooth.c:416
#define MXDM_GETCONTROLDETAILS
Definition: mmddk.h:197
static UINT MIXER_GetDev(HMIXEROBJ hmix, DWORD dwFlags, LPWINE_MIXER *lplpwm)
Definition: winmm.c:229
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
unsigned int UINT
Definition: ndis.h:50

Referenced by mixer_test_controlW(), mixerGetControlDetailsA(), printMixerLine(), and Volume_IsMute().

◆ mixerGetDevCapsA()

UINT WINAPI mixerGetDevCapsA ( UINT_PTR  uDeviceID,
LPMIXERCAPSA  lpCaps,
UINT  uSize 
)

Definition at line 291 of file winmm.c.

292 {
293  MIXERCAPSW micW;
294  UINT ret;
295 
296  if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
297 
298  ret = mixerGetDevCapsW(uDeviceID, &micW, sizeof(micW));
299 
300  if (ret == MMSYSERR_NOERROR) {
301  MIXERCAPSA micA;
302  micA.wMid = micW.wMid;
303  micA.wPid = micW.wPid;
304  micA.vDriverVersion = micW.vDriverVersion;
305  WideCharToMultiByte( CP_ACP, 0, micW.szPname, -1, micA.szPname,
306  sizeof(micA.szPname), NULL, NULL );
307  micA.fdwSupport = micW.fdwSupport;
308  micA.cDestinations = micW.cDestinations;
309  memcpy(lpCaps, &micA, min(uSize, sizeof(micA)));
310  }
311  return ret;
312 }
DWORD fdwSupport
Definition: mmsystem.h:1227
DWORD fdwSupport
Definition: mmsystem.h:1218
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1217
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
DWORD cDestinations
Definition: mmsystem.h:1228
MMVERSION vDriverVersion
Definition: mmsystem.h:1216
smooth NULL
Definition: ftsmooth.c:416
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
MMVERSION vDriverVersion
Definition: mmsystem.h:1225
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
UINT WINAPI mixerGetDevCapsW(UINT_PTR uDeviceID, LPMIXERCAPSW lpCaps, UINT uSize)
Definition: winmm.c:317
DWORD cDestinations
Definition: mmsystem.h:1219
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1226

Referenced by mixer_test_deviceA(), and mixer_testsA().

◆ mixerGetDevCapsW()

UINT WINAPI mixerGetDevCapsW ( UINT_PTR  uDeviceID,
LPMIXERCAPSW  lpCaps,
UINT  uSize 
)

Definition at line 317 of file winmm.c.

318 {
319  LPWINE_MLD wmld;
320 
321  if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
322 
323  if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIXER, TRUE)) == NULL)
324  return MMSYSERR_BADDEVICEID;
325 
326  return MMDRV_Message(wmld, MXDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
327 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMDRV_MIXER
Definition: winemm.h:77
#define TRUE
Definition: types.h:120
#define MXDM_GETDEVCAPS
Definition: mmddk.h:192
smooth NULL
Definition: ftsmooth.c:416
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
#define MMSYSERR_BADDEVICEID
Definition: mmsystem.h:98
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107

Referenced by main(), mixer_test_deviceW(), mixer_testsW(), mixerGetDevCapsA(), and Volume_FindMixerControl().

◆ mixerGetID()

UINT WINAPI mixerGetID ( HMIXEROBJ  hmix,
LPUINT  lpid,
DWORD  fdwID 
)

Definition at line 407 of file winmm.c.

408 {
409  LPWINE_MIXER lpwm;
410  UINT uRet = MMSYSERR_NOERROR;
411 
412  TRACE("(%p %p %08x)\n", hmix, lpid, fdwID);
413 
414  if ((uRet = MIXER_GetDev(hmix, fdwID, &lpwm)) != MMSYSERR_NOERROR)
415  return uRet;
416 
417  if (lpid)
418  *lpid = lpwm->mld.uDeviceID;
419 
420  return uRet;
421 }
WINE_MLD mld
Definition: winemm.h:114
static UINT MIXER_GetDev(HMIXEROBJ hmix, DWORD dwFlags, LPWINE_MIXER *lplpwm)
Definition: winmm.c:229
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
UINT uDeviceID
Definition: winemm.h:94
unsigned int UINT
Definition: ndis.h:50

Referenced by GetDevNum(), and Volume_FindMixerControl().

◆ mixerGetLineControlsA()

UINT WINAPI mixerGetLineControlsA ( HMIXEROBJ  hmix,
LPMIXERLINECONTROLSA  lpmlcA,
DWORD  fdwControls 
)

Definition at line 506 of file winmm.c.

508 {
509  MIXERLINECONTROLSW mlcW;
510  DWORD ret;
511  unsigned int i;
512 
513  TRACE("(%p, %p, %08x)\n", hmix, lpmlcA, fdwControls);
514 
515  if (lpmlcA == NULL || lpmlcA->cbStruct != sizeof(*lpmlcA) ||
516  lpmlcA->cbmxctrl != sizeof(MIXERCONTROLA))
517  return MMSYSERR_INVALPARAM;
518 
519  mlcW.cbStruct = sizeof(mlcW);
520  mlcW.dwLineID = lpmlcA->dwLineID;
521  mlcW.u.dwControlID = lpmlcA->u.dwControlID;
522  mlcW.u.dwControlType = lpmlcA->u.dwControlType;
523 
524  /* Debugging on Windows shows for MIXER_GETLINECONTROLSF_ONEBYTYPE only,
525  the control count is assumed to be 1 - This is relied upon by a game,
526  "Dynomite Deluze" */
528  mlcW.cControls = 1;
529  } else {
530  mlcW.cControls = lpmlcA->cControls;
531  }
532  mlcW.cbmxctrl = sizeof(MIXERCONTROLW);
533  mlcW.pamxctrl = HeapAlloc(GetProcessHeap(), 0,
534  mlcW.cControls * mlcW.cbmxctrl);
535 
536  ret = mixerGetLineControlsW(hmix, &mlcW, fdwControls);
537 
538  if (ret == MMSYSERR_NOERROR) {
539  lpmlcA->dwLineID = mlcW.dwLineID;
540  lpmlcA->u.dwControlID = mlcW.u.dwControlID;
541  lpmlcA->u.dwControlType = mlcW.u.dwControlType;
542 
543  for (i = 0; i < mlcW.cControls; i++) {
544  lpmlcA->pamxctrl[i].cbStruct = sizeof(MIXERCONTROLA);
545  lpmlcA->pamxctrl[i].dwControlID = mlcW.pamxctrl[i].dwControlID;
546  lpmlcA->pamxctrl[i].dwControlType = mlcW.pamxctrl[i].dwControlType;
547  lpmlcA->pamxctrl[i].fdwControl = mlcW.pamxctrl[i].fdwControl;
550  lpmlcA->pamxctrl[i].szShortName,
551  sizeof(lpmlcA->pamxctrl[i].szShortName), NULL, NULL );
552  WideCharToMultiByte( CP_ACP, 0, mlcW.pamxctrl[i].szName, -1,
553  lpmlcA->pamxctrl[i].szName,
554  sizeof(lpmlcA->pamxctrl[i].szName), NULL, NULL );
555  /* sizeof(lpmlcA->pamxctrl[i].Bounds) ==
556  * sizeof(mlcW.pamxctrl[i].Bounds) */
557  memcpy(&lpmlcA->pamxctrl[i].Bounds, &mlcW.pamxctrl[i].Bounds,
558  sizeof(mlcW.pamxctrl[i].Bounds));
559  /* sizeof(lpmlcA->pamxctrl[i].Metrics) ==
560  * sizeof(mlcW.pamxctrl[i].Metrics) */
561  memcpy(&lpmlcA->pamxctrl[i].Metrics, &mlcW.pamxctrl[i].Metrics,
562  sizeof(mlcW.pamxctrl[i].Metrics));
563  }
564  }
565 
566  HeapFree(GetProcessHeap(), 0, mlcW.pamxctrl);
567 
568  return ret;
569 }
WCHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1310
WCHAR szShortName[MIXER_SHORT_NAME_CHARS]
Definition: mmsystem.h:1309
#define WideCharToMultiByte
Definition: compat.h:101
LPMIXERCONTROLW pamxctrl
Definition: mmsystem.h:1350
DWORD dwControlType
Definition: mmsystem.h:1306
#define CP_ACP
Definition: compat.h:99
#define MIXER_GETLINECONTROLSF_QUERYMASK
Definition: mmsystem.h:411
union tagMIXERCONTROLA::@2914 Metrics
DWORD cMultipleItems
Definition: mmsystem.h:1308
union tagMIXERCONTROLW::@2917 Bounds
struct tagMIXERCONTROLW MIXERCONTROLW
CHAR szShortName[MIXER_SHORT_NAME_CHARS]
Definition: mmsystem.h:1283
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 i
Definition: glfuncs.h:248
DWORD dwControlType
Definition: mmsystem.h:1280
LPMIXERCONTROLA pamxctrl
Definition: mmsystem.h:1338
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
CHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1284
struct tagMIXERCONTROLA MIXERCONTROLA
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW, DWORD fdwControls)
Definition: winmm.c:574
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
union tagMIXERCONTROLA::@2913 Bounds
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define MIXER_GETLINECONTROLSF_ONEBYTYPE
Definition: mmsystem.h:410
DWORD cMultipleItems
Definition: mmsystem.h:1282
union tagMIXERCONTROLW::@2918 Metrics
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by mixer_test_deviceA().

◆ mixerGetLineControlsW()

UINT WINAPI mixerGetLineControlsW ( HMIXEROBJ  hmix,
LPMIXERLINECONTROLSW  lpmlcW,
DWORD  fdwControls 
)

Definition at line 574 of file winmm.c.

576 {
577  LPWINE_MIXER lpwm;
578  UINT uRet = MMSYSERR_NOERROR;
579 
580  TRACE("(%p, %p, %08x)\n", hmix, lpmlcW, fdwControls);
581 
582  if ((uRet = MIXER_GetDev(hmix, fdwControls, &lpwm)) != MMSYSERR_NOERROR)
583  return uRet;
584 
585  if (lpmlcW == NULL || lpmlcW->cbStruct != sizeof(*lpmlcW))
586  return MMSYSERR_INVALPARAM;
587 
588  return MMDRV_Message(&lpwm->mld, MXDM_GETLINECONTROLS, (DWORD_PTR)lpmlcW,
589  fdwControls);
590 }
WINE_MLD mld
Definition: winemm.h:114
smooth NULL
Definition: ftsmooth.c:416
static UINT MIXER_GetDev(HMIXEROBJ hmix, DWORD dwFlags, LPWINE_MIXER *lplpwm)
Definition: winmm.c:229
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
#define MXDM_GETLINECONTROLS
Definition: mmddk.h:196
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
unsigned int UINT
Definition: ndis.h:50

Referenced by mixer_test_deviceW(), mixerGetLineControlsA(), printMixerLine(), and Volume_FindMixerControl().

◆ mixerGetLineInfoA()

UINT WINAPI mixerGetLineInfoA ( HMIXEROBJ  hmix,
LPMIXERLINEA  lpmliA,
DWORD  fdwInfo 
)

Definition at line 615 of file winmm.c.

617 {
618  MIXERLINEW mliW;
619  UINT ret;
620 
621  TRACE("(%p, %p, %08x)\n", hmix, lpmliA, fdwInfo);
622 
623  if (lpmliA == NULL || lpmliA->cbStruct != sizeof(*lpmliA))
624  return MMSYSERR_INVALPARAM;
625 
626  mliW.cbStruct = sizeof(mliW);
627  switch (fdwInfo & MIXER_GETLINEINFOF_QUERYMASK) {
629  mliW.dwComponentType = lpmliA->dwComponentType;
630  break;
632  mliW.dwDestination = lpmliA->dwDestination;
633  break;
635  mliW.dwLineID = lpmliA->dwLineID;
636  break;
638  mliW.dwDestination = lpmliA->dwDestination;
639  mliW.dwSource = lpmliA->dwSource;
640  break;
642  mliW.Target.dwType = lpmliA->Target.dwType;
643  mliW.Target.wMid = lpmliA->Target.wMid;
644  mliW.Target.wPid = lpmliA->Target.wPid;
645  mliW.Target.vDriverVersion = lpmliA->Target.vDriverVersion;
646  MultiByteToWideChar( CP_ACP, 0, lpmliA->Target.szPname, -1, mliW.Target.szPname, sizeof(mliW.Target.szPname)/sizeof(WCHAR));
647  break;
648  default:
649  WARN("Unsupported fdwControls=0x%08x\n", fdwInfo);
650  return MMSYSERR_INVALFLAG;
651  }
652 
653  ret = mixerGetLineInfoW(hmix, &mliW, fdwInfo);
654 
655  if(ret == MMSYSERR_NOERROR)
656  {
657  lpmliA->dwDestination = mliW.dwDestination;
658  lpmliA->dwSource = mliW.dwSource;
659  lpmliA->dwLineID = mliW.dwLineID;
660  lpmliA->fdwLine = mliW.fdwLine;
661  lpmliA->dwUser = mliW.dwUser;
662  lpmliA->dwComponentType = mliW.dwComponentType;
663  lpmliA->cChannels = mliW.cChannels;
664  lpmliA->cConnections = mliW.cConnections;
665  lpmliA->cControls = mliW.cControls;
666  WideCharToMultiByte( CP_ACP, 0, mliW.szShortName, -1, lpmliA->szShortName,
667  sizeof(lpmliA->szShortName), NULL, NULL);
668  WideCharToMultiByte( CP_ACP, 0, mliW.szName, -1, lpmliA->szName,
669  sizeof(lpmliA->szName), NULL, NULL );
670  lpmliA->Target.dwType = mliW.Target.dwType;
671  lpmliA->Target.dwDeviceID = mliW.Target.dwDeviceID;
672  lpmliA->Target.wMid = mliW.Target.wMid;
673  lpmliA->Target.wPid = mliW.Target.wPid;
674  lpmliA->Target.vDriverVersion = mliW.Target.vDriverVersion;
675  WideCharToMultiByte( CP_ACP, 0, mliW.Target.szPname, -1, lpmliA->Target.szPname,
676  sizeof(lpmliA->Target.szPname), NULL, NULL );
677  }
678  return ret;
679 }
DWORD fdwLine
Definition: mmsystem.h:1236
UINT WINAPI mixerGetLineInfoW(HMIXEROBJ hmix, LPMIXERLINEW lpmliW, DWORD fdwInfo)
Definition: winmm.c:595
#define WideCharToMultiByte
Definition: compat.h:101
DWORD dwUser
Definition: mmsystem.h:1237
#define CP_ACP
Definition: compat.h:99
#define WARN(fmt,...)
Definition: debug.h:111
DWORD dwLineID
Definition: mmsystem.h:1258
#define MIXER_GETLINEINFOF_COMPONENTTYPE
Definition: mmsystem.h:347
struct tagMIXERLINEA::@2911 Target
CHAR szShortName[MIXER_SHORT_NAME_CHARS]
Definition: mmsystem.h:1242
struct tagMIXERLINEW::@2912 Target
DWORD cControls
Definition: mmsystem.h:1241
WCHAR szShortName[MIXER_SHORT_NAME_CHARS]
Definition: mmsystem.h:1265
DWORD dwComponentType
Definition: mmsystem.h:1261
DWORD dwDestination
Definition: mmsystem.h:1256
smooth NULL
Definition: ftsmooth.c:416
#define MIXER_GETLINEINFOF_DESTINATION
Definition: mmsystem.h:344
DWORD cConnections
Definition: mmsystem.h:1240
DWORD cControls
Definition: mmsystem.h:1264
#define MIXER_GETLINEINFOF_LINEID
Definition: mmsystem.h:346
DWORD dwLineID
Definition: mmsystem.h:1235
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
__wchar_t WCHAR
Definition: xmlstorage.h:180
DWORD dwSource
Definition: mmsystem.h:1257
DWORD cChannels
Definition: mmsystem.h:1262
#define MIXER_GETLINEINFOF_TARGETTYPE
Definition: mmsystem.h:348
DWORD cbStruct
Definition: mmsystem.h:1255
DWORD dwUser
Definition: mmsystem.h:1260
DWORD fdwLine
Definition: mmsystem.h:1259
CHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1243
#define MMSYSERR_INVALFLAG
Definition: mmsystem.h:106
int ret
DWORD cChannels
Definition: mmsystem.h:1239
DWORD dwDestination
Definition: mmsystem.h:1233
#define MIXER_GETLINEINFOF_QUERYMASK
Definition: mmsystem.h:349
#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
WCHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1266
unsigned int UINT
Definition: ndis.h:50
DWORD cConnections
Definition: mmsystem.h:1263
#define MultiByteToWideChar
Definition: compat.h:100
DWORD dwComponentType
Definition: mmsystem.h:1238

Referenced by mixer_test_deviceA().

◆ mixerGetLineInfoW()

UINT WINAPI mixerGetLineInfoW ( HMIXEROBJ  hmix,
LPMIXERLINEW  lpmliW,
DWORD  fdwInfo 
)

Definition at line 595 of file winmm.c.

596 {
597  LPWINE_MIXER lpwm;
598  UINT uRet = MMSYSERR_NOERROR;
599 
600  TRACE("(%p, %p, %08x)\n", hmix, lpmliW, fdwInfo);
601 
602  if (lpmliW == NULL || lpmliW->cbStruct != sizeof(*lpmliW))
603  return MMSYSERR_INVALPARAM;
604 
605  if ((uRet = MIXER_GetDev(hmix, fdwInfo, &lpwm)) != MMSYSERR_NOERROR)
606  return uRet;
607 
608  return MMDRV_Message(&lpwm->mld, MXDM_GETLINEINFO, (DWORD_PTR)lpmliW,
609  fdwInfo);
610 }
WINE_MLD mld
Definition: winemm.h:114
smooth NULL
Definition: ftsmooth.c:416
static UINT MIXER_GetDev(HMIXEROBJ hmix, DWORD dwFlags, LPWINE_MIXER *lplpwm)
Definition: winmm.c:229
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
DWORD cbStruct
Definition: mmsystem.h:1255
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
unsigned int UINT
Definition: ndis.h:50
#define MXDM_GETLINEINFO
Definition: mmddk.h:195

Referenced by main(), mixer_test_deviceW(), mixerGetLineInfoA(), and Volume_FindMixerControl().

◆ mixerGetNumDevs()

UINT WINAPI mixerGetNumDevs ( void  )

Definition at line 283 of file winmm.c.

284 {
285  return MMDRV_GetNum(MMDRV_MIXER);
286 }
#define MMDRV_MIXER
Definition: winemm.h:77
UINT MMDRV_GetNum(UINT type)
Definition: lolvldrv.c:61

Referenced by CreateApplicationWindow(), InitVolumeControls(), main(), mixer_testsA(), mixer_testsW(), SndMixerCreate(), and test_mixerOpen().

◆ mixerMessage()

DWORD WINAPI mixerMessage ( HMIXER  hmix,
UINT  uMsg,
DWORD_PTR  dwParam1,
DWORD_PTR  dwParam2 
)

Definition at line 702 of file winmm.c.

703 {
704  LPWINE_MLD wmld;
705 
706  TRACE("(%p, %d, %08lx, %08lx): semi-stub?\n",
707  hmix, uMsg, dwParam1, dwParam2);
708 
709  if ((wmld = MMDRV_Get(hmix, MMDRV_MIXER, FALSE)) == NULL)
710  return MMSYSERR_INVALHANDLE;
711 
712  return MMDRV_Message(wmld, uMsg, dwParam1, dwParam2);
713 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MMDRV_MIXER
Definition: winemm.h:77
#define MMSYSERR_INVALHANDLE
Definition: mmsystem.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71

◆ mixerOpen()

UINT WINAPI mixerOpen ( LPHMIXER  lphMix,
UINT  uDeviceID,
DWORD_PTR  dwCallback,
DWORD_PTR  dwInstance,
DWORD  fdwOpen 
)

Definition at line 342 of file winmm.c.

344 {
345  HANDLE hMix;
346  LPWINE_MLD wmld;
347  DWORD dwRet;
349 
350  TRACE("(%p, %d, %08lx, %08lx, %08x)\n",
351  lphMix, uDeviceID, dwCallback, dwInstance, fdwOpen);
352 
353  dwRet = WINMM_CheckCallback(dwCallback, fdwOpen, TRUE);
354  if(dwRet != MMSYSERR_NOERROR)
355  return dwRet;
356 
357  mod.dwCallback = (DWORD_PTR)MIXER_WCallback;
358  if ((fdwOpen & CALLBACK_TYPEMASK) == CALLBACK_WINDOW)
359  mod.dwInstance = dwCallback;
360  else
361  mod.dwInstance = 0;
362 
363  /* We're remapping to CALLBACK_FUNCTION because that's what old winmm is
364  * documented to do when opening the mixer driver.
365  * FIXME: Native supports CALLBACK_EVENT + CALLBACK_THREAD flags since w2k.
366  * FIXME: The non ALSA drivers ignore callback requests - bug.
367  */
368 
369  wmld = MMDRV_Alloc(sizeof(WINE_MIXER), MMDRV_MIXER, &hMix, &fdwOpen,
370  &dwCallback, &dwInstance);
371  wmld->uDeviceID = uDeviceID;
372  mod.hmx = hMix;
373 
375 
376  if (dwRet != MMSYSERR_NOERROR) {
377  MMDRV_Free(hMix, wmld);
378  hMix = 0;
379  }
380  if (lphMix) *lphMix = hMix;
381  TRACE("=> %d hMixer=%p\n", dwRet, hMix);
382 
383  return dwRet;
384 }
#define MMDRV_MIXER
Definition: winemm.h:77
#define TRUE
Definition: types.h:120
#define CALLBACK_WINDOW
Definition: mmsystem.h:148
#define DWORD_PTR
Definition: treelist.c:76
LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD *dwFlags, DWORD_PTR *dwCallback, DWORD_PTR *dwInstance)
Definition: lolvldrv.c:123
#define CALLBACK_TYPEMASK
Definition: mmsystem.h:146
MMRESULT WINMM_CheckCallback(DWORD_PTR dwCallback, DWORD fdwOpen, BOOL mixer)
Definition: winmm.c:196
#define CALLBACK_FUNCTION
Definition: mmsystem.h:150
DWORD MMDRV_Open(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD dwFlags)
Definition: lolvldrv.c:183
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
unsigned long DWORD
Definition: ntddk_ex.h:95
uint32_t DWORD_PTR
Definition: typedefs.h:63
UINT uDeviceID
Definition: winemm.h:94
void MMDRV_Free(HANDLE hndl, LPWINE_MLD mld)
Definition: lolvldrv.c:165
static void CALLBACK MIXER_WCallback(HMIXEROBJ hmx, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam, DWORD_PTR param2)
Definition: winmm.c:329
#define MXDM_OPEN
Definition: mmddk.h:193
static int mod
Definition: i386-dis.c:1273

Referenced by InitVolumeControls(), mixer_test_deviceA(), mixer_test_deviceW(), OnInitDialog(), OnTrayInitMixer(), SndMixerEnumProducts(), SndMixerSelect(), test(), and test_mixerOpen().

◆ mixerSetControlDetails()

UINT WINAPI mixerSetControlDetails ( HMIXEROBJ  hmix,
LPMIXERCONTROLDETAILS  lpmcd,
DWORD  fdwDetails 
)

Definition at line 684 of file winmm.c.

686 {
687  LPWINE_MIXER lpwm;
688  UINT uRet = MMSYSERR_NOERROR;
689 
690  TRACE("(%p, %p, %08x)\n", hmix, lpmcd, fdwDetails);
691 
692  if ((uRet = MIXER_GetDev(hmix, fdwDetails, &lpwm)) != MMSYSERR_NOERROR)
693  return uRet;
694 
695  return MMDRV_Message(&lpwm->mld, MXDM_SETCONTROLDETAILS, (DWORD_PTR)lpmcd,
696  fdwDetails);
697 }
WINE_MLD mld
Definition: winemm.h:114
#define MXDM_SETCONTROLDETAILS
Definition: mmddk.h:198
static UINT MIXER_GetDev(HMIXEROBJ hmix, DWORD dwFlags, LPWINE_MIXER *lplpwm)
Definition: winmm.c:229
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
DWORD MMDRV_Message(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:71
uint32_t DWORD_PTR
Definition: typedefs.h:63
unsigned int UINT
Definition: ndis.h:50

Referenced by mixer_test_controlA(), mixer_test_controlW(), OnCommand(), OnHScroll(), OnSetDefaults(), OnVScroll(), printMixerLine(), RestoreVolumeValue(), SetVolumeValue(), SndMixerSetVolumeControlDetails(), and SwitchMuteState().

◆ mmGetCurrentTask()

DWORD WINAPI mmGetCurrentTask ( VOID  )

Definition at line 2915 of file winmm.c.

2916 {
2917  return GetCurrentThreadId();
2918 }
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:420

◆ MMSYSTEM_GetMidiStream()

static BOOL MMSYSTEM_GetMidiStream ( HMIDISTRM  hMidiStrm,
WINE_MIDIStream **  lpMidiStrm,
WINE_MIDI **  lplpwm 
)
static

Definition at line 1476 of file winmm.c.

1477 {
1478  WINE_MIDI* lpwm = (LPWINE_MIDI)MMDRV_Get(hMidiStrm, MMDRV_MIDIOUT, FALSE);
1479 
1480  if (lplpwm)
1481  *lplpwm = lpwm;
1482 
1483  if (lpwm == NULL) {
1484  return FALSE;
1485  }
1486 
1487  *lpMidiStrm = (WINE_MIDIStream*)(ULONG_PTR)lpwm->mod.rgIds.dwStreamID; // FIXME: not 64 bit safe
1488 
1489  return *lpMidiStrm != NULL;
1490 }
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
MIDIOPENSTRMID rgIds
Definition: mmddk.h:417
MIDIOPENDESC mod
Definition: winemm.h:110
uint32_t ULONG_PTR
Definition: typedefs.h:63
smooth NULL
Definition: ftsmooth.c:416
#define MMDRV_MIDIOUT
Definition: winemm.h:79
DWORD dwStreamID
Definition: mmddk.h:407
struct WINE_MIDI * LPWINE_MIDI

Referenced by midiStreamClose(), midiStreamOut(), midiStreamPause(), midiStreamPosition(), midiStreamProperty(), midiStreamRestart(), and midiStreamStop().

◆ MMSYSTEM_MidiStream_Convert()

static DWORD MMSYSTEM_MidiStream_Convert ( WINE_MIDIStream lpMidiStrm,
DWORD  pulse 
)
static

Definition at line 1495 of file winmm.c.

1496 {
1497  DWORD ret = 0;
1498 
1499  if (lpMidiStrm->dwTimeDiv == 0) {
1500  FIXME("Shouldn't happen. lpMidiStrm->dwTimeDiv = 0\n");
1501  } else if (lpMidiStrm->dwTimeDiv > 0x8000) { /* SMPTE, unchecked FIXME? */
1502  int nf = -(char)HIBYTE(lpMidiStrm->dwTimeDiv); /* number of frames */
1503  int nsf = LOBYTE(lpMidiStrm->dwTimeDiv); /* number of sub-frames */
1504  ret = (pulse * 1000) / (nf * nsf);
1505  } else {
1506  ret = (DWORD)((double)pulse * ((double)lpMidiStrm->dwTempo / 1000) /
1507  (double)lpMidiStrm->dwTimeDiv);
1508  }
1509 
1510  return ret;
1511 }
DWORD dwTimeDiv
Definition: winmm.c:1461
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
static DWORD(WINAPI *pLoadLibrary16)(LPCSTR)
#define FIXME(fmt,...)
Definition: debug.h:110
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
unsigned char
Definition: typeof.h:29
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
DWORD dwTempo
Definition: winmm.c:1460

Referenced by MMSYSTEM_MidiStream_Player().

◆ MMSYSTEM_MidiStream_MessageHandler()

static BOOL MMSYSTEM_MidiStream_MessageHandler ( WINE_MIDIStream lpMidiStrm,
LPWINE_MIDI  lpwm,
LPMSG  msg 
)
static

Definition at line 1516 of file winmm.c.

1517 {
1518  LPMIDIHDR lpMidiHdr;
1519  LPMIDIHDR* lpmh;
1520  LPBYTE lpData;
1521 
1522  switch (msg->message) {
1523  case WM_QUIT:
1524  SetEvent(lpMidiStrm->hEvent);
1525  return FALSE;
1526  case WINE_MSM_STOP:
1527  TRACE("STOP\n");
1528  /* this is not quite what MS doc says... */
1529  midiOutReset(lpMidiStrm->hDevice);
1530  /* empty list of already submitted buffers */
1531  for (lpMidiHdr = lpMidiStrm->lpMidiHdr; lpMidiHdr; lpMidiHdr = lpMidiHdr->lpNext) {
1532  lpMidiHdr->dwFlags |= MHDR_DONE;
1533  lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
1534 
1535  DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
1536  (HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE,
1537  lpwm->mod.dwInstance, (DWORD_PTR)lpMidiHdr, 0);
1538  }
1539  lpMidiStrm->lpMidiHdr = 0;
1540  SetEvent(lpMidiStrm->hEvent);
1541  break;
1542  case WINE_MSM_HEADER:
1543  /* sets initial tick count for first MIDIHDR */
1544  if (!lpMidiStrm->dwStartTicks)
1545  lpMidiStrm->dwStartTicks = GetTickCount();
1546 
1547  /* FIXME(EPP): "I don't understand the content of the first MIDIHDR sent
1548  * by native mcimidi, it doesn't look like a correct one".
1549  * this trick allows to throw it away... but I don't like it.
1550  * It looks like part of the file I'm trying to play and definitively looks
1551  * like raw midi content
1552  * I'd really like to understand why native mcimidi sends it. Perhaps a bad
1553  * synchronization issue where native mcimidi is still processing raw MIDI
1554  * content before generating MIDIEVENTs ?
1555  *
1556  * 4c 04 89 3b 00 81 7c 99 3b 43 00 99 23 5e 04 89 L..;..|.;C..#^..
1557  * 3b 00 00 89 23 00 7c 99 3b 45 00 99 28 62 04 89 ;...#.|.;E..(b..
1558  * 3b 00 00 89 28 00 81 7c 99 3b 4e 00 99 23 5e 04 ;...(..|.;N..#^.
1559  * 89 3b 00 00 89 23 00 7c 99 3b 45 00 99 23 78 04 .;...#.|.;E..#x.
1560  * 89 3b 00 00 89 23 00 81 7c 99 3b 48 00 99 23 5e .;...#..|.;H..#^
1561  * 04 89 3b 00 00 89 23 00 7c 99 3b 4e 00 99 28 62 ..;...#.|.;N..(b
1562  * 04 89 3b 00 00 89 28 00 81 7c 99 39 4c 00 99 23 ..;...(..|.9L..#
1563  * 5e 04 89 39 00 00 89 23 00 82 7c 99 3b 4c 00 99 ^..9...#..|.;L..
1564  * 23 5e 04 89 3b 00 00 89 23 00 7c 99 3b 48 00 99 #^..;...#.|.;H..
1565  * 28 62 04 89 3b 00 00 89 28 00 81 7c 99 3b 3f 04 (b..;...(..|.;?.
1566  * 89 3b 00 1c 99 23 5e 04 89 23 00 5c 99 3b 45 00 .;...#^..#.\.;E.
1567  * 99 23 78 04 89 3b 00 00 89 23 00 81 7c 99 3b 46 .#x..;...#..|.;F
1568  * 00 99 23 5e 04 89 3b 00 00 89 23 00 7c 99 3b 48 ..#^..;...#.|.;H
1569  * 00 99 28 62 04 89 3b 00 00 89 28 00 81 7c 99 3b ..(b..;...(..|.;
1570  * 46 00 99 23 5e 04 89 3b 00 00 89 23 00 7c 99 3b F..#^..;...#.|.;
1571  * 48 00 99 23 78 04 89 3b 00 00 89 23 00 81 7c 99 H..#x..;...#..|.
1572  * 3b 4c 00 99 23 5e 04 89 3b 00 00 89 23 00 7c 99 ;L..#^..;...#.|.
1573  */
1574  lpMidiHdr = (LPMIDIHDR)msg->lParam;
1575  lpData = (LPBYTE)lpMidiHdr->lpData;
1576  TRACE("Adding %s lpMidiHdr=%p [lpData=0x%p dwBufferLength=%u/%u dwFlags=0x%08x size=%lu]\n",
1577  (lpMidiHdr->dwFlags & MHDR_ISSTRM) ? "stream" : "regular", lpMidiHdr,
1578  lpMidiHdr, lpMidiHdr->dwBufferLength, lpMidiHdr->dwBytesRecorded,
1579  lpMidiHdr->dwFlags, msg->wParam);
1580 #if 0
1581  /* dumps content of lpMidiHdr->lpData
1582  * FIXME: there should be a debug routine somewhere that already does this
1583  * I hate spreading this type of shit all around the code
1584  */
1585  for (dwToGo = 0; dwToGo < lpMidiHdr->dwBufferLength; dwToGo += 16) {
1586  DWORD i;
1587  BYTE ch;
1588 
1589  for (i = 0; i < min(16, lpMidiHdr->dwBufferLength - dwToGo); i++)
1590  printf("%02x ", lpData[dwToGo + i]);
1591  for (; i < 16; i++)
1592  printf(" ");
1593  for (i = 0; i < min(16, lpMidiHdr->dwBufferLength - dwToGo); i++) {
1594  ch = lpData[dwToGo + i];
1595  printf("%c", (ch >= 0x20 && ch <= 0x7F) ? ch : '.');
1596  }
1597  printf("\n");
1598  }
1599 #endif
1600  if (((LPMIDIEVENT)lpData)->dwStreamID != 0 &&
1601  ((LPMIDIEVENT)lpData)->dwStreamID != 0xFFFFFFFF &&
1602  /* FIXME: not 64 bit safe */
1603  ((LPMIDIEVENT)lpData)->dwStreamID != (DWORD_PTR)lpMidiStrm) {
1604  FIXME("Dropping bad %s lpMidiHdr (streamID=%08x)\n",
1605  (lpMidiHdr->dwFlags & MHDR_ISSTRM) ? "stream" : "regular",
1606  ((LPMIDIEVENT)lpData)->dwStreamID);
1607  lpMidiHdr->dwFlags |= MHDR_DONE;
1608  lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
1609 
1610  DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
1611  (HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE,
1612  lpwm->mod.dwInstance, (DWORD_PTR)lpMidiHdr, 0);
1613  break;
1614  }
1615 
1616  for (lpmh = &lpMidiStrm->lpMidiHdr; *lpmh; lpmh = &(*lpmh)->lpNext);
1617  *lpmh = lpMidiHdr;
1618  lpMidiHdr = (LPMIDIHDR)msg->lParam;
1619  lpMidiHdr->lpNext = 0;
1620  lpMidiHdr->dwFlags |= MHDR_INQUEUE;
1621  lpMidiHdr->dwFlags &= ~MHDR_DONE;
1622  lpMidiHdr->dwOffset = 0;
1623 
1624  break;
1625  default:
1626  FIXME("Unknown message %d\n", msg->message);
1627  break;
1628  }
1629  return TRUE;
1630 }
DWORD dwCallback
Definition: mmddk.h:413
#define TRUE
Definition: types.h:120
DWORD dwInstance
Definition: mmddk.h:414
HANDLE hEvent
Definition: winmm.c:1466
LPSTR lpData
Definition: mmsystem.h:1151
DWORD dwBufferLength
Definition: mmsystem.h:1152
#define WINE_MSM_HEADER
Definition: winmm.c:1470
#define WM_QUIT
Definition: winuser.h:1605
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
#define WINE_MSM_STOP
Definition: winmm.c:1471
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
MIDIOPENDESC mod
Definition: winemm.h:110
DWORD dwStartTicks
Definition: winmm.c:1464
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 i
Definition: glfuncs.h:248
unsigned char * LPBYTE
Definition: typedefs.h:52
#define FIXME(fmt,...)
Definition: debug.h:110
#define MHDR_ISSTRM
Definition: mmsystem.h:271
UINT WINAPI midiOutReset(HMIDIOUT hMidiOut)
Definition: winmm.c:1073
#define TRACE(s)
Definition: solgame.cpp:4
HMIDIOUT hDevice
Definition: winmm.c:1457
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwFlags
Definition: mmsystem.h:1155
unsigned char BYTE
Definition: mem.h:68
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MHDR_DONE
Definition: mmsystem.h:268
struct midihdr_tag * LPMIDIHDR
#define MHDR_INQUEUE
Definition: mmsystem.h:270
#define min(a, b)
Definition: monoChain.cc:55
struct midihdr_tag * lpNext
Definition: mmsystem.h:1156
#define msg(x)
Definition: auth_time.c:54
LPMIDIHDR lpMidiHdr
Definition: winmm.c:1467
DWORD dwOffset
Definition: mmsystem.h:1158
BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HDRVR hDev, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2)
#define MM_MOM_DONE
Definition: mmsystem.h:70
DWORD dwBytesRecorded
Definition: mmsystem.h:1153
#define printf
Definition: config.h:203

Referenced by MMSYSTEM_MidiStream_Player().

◆ MMSYSTEM_MidiStream_Player()

static DWORD CALLBACK MMSYSTEM_MidiStream_Player ( LPVOID  pmt)
static

Definition at line 1635 of file winmm.c.

1636 {
1637  WINE_MIDIStream* lpMidiStrm = pmt;
1638  WINE_MIDI* lpwm;
1639  MSG msg;
1640  DWORD dwToGo;
1641  DWORD dwCurrTC;
1642  LPMIDIHDR lpMidiHdr;
1643  LPMIDIEVENT me;
1644  LPBYTE lpData = 0;
1645 
1646  TRACE("(%p)!\n", lpMidiStrm);
1647 
1648  if (!lpMidiStrm ||
1649  (lpwm = (LPWINE_MIDI)MMDRV_Get(lpMidiStrm->hDevice, MMDRV_MIDIOUT, FALSE)) == NULL)
1650  goto the_end;
1651 
1652  /* force thread's queue creation */
1653  /* Used to be InitThreadInput16(0, 5); */
1654  /* but following works also with hack in midiStreamOpen */
1655  PeekMessageA(&msg, 0, 0, 0, 0);
1656 
1657  /* FIXME: this next line must be called before midiStreamOut or midiStreamRestart are called */
1658  SetEvent(lpMidiStrm->hEvent);
1659  TRACE("Ready to go 1\n");
1660  /* thread is started in paused mode */
1661  SuspendThread(lpMidiStrm->hThread);
1662  TRACE("Ready to go 2\n");
1663 
1664  lpMidiStrm->dwStartTicks = 0;
1665  lpMidiStrm->dwPulses = 0;
1666 
1667  lpMidiStrm->lpMidiHdr = 0;
1668 
1669  for (;;) {
1670  lpMidiHdr = lpMidiStrm->lpMidiHdr;
1671  if (!lpMidiHdr) {
1672  /* for first message, block until one arrives, then process all that are available */
1673  GetMessageA(&msg, 0, 0, 0);
1674  do {
1675  if (!MMSYSTEM_MidiStream_MessageHandler(lpMidiStrm, lpwm, &msg))
1676  goto the_end;
1677  } while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE));
1678  lpData = 0;
1679  continue;
1680  }
1681 
1682  if (!lpData)
1683  lpData = (LPBYTE)lpMidiHdr->lpData;
1684 
1685  me = (LPMIDIEVENT)(lpData + lpMidiHdr->dwOffset);
1686 
1687  /* do we have to wait ? */
1688  if (me->dwDeltaTime) {
1689  lpMidiStrm->dwPositionMS += MMSYSTEM_MidiStream_Convert(lpMidiStrm, me->dwDeltaTime);
1690  lpMidiStrm->dwPulses += me->dwDeltaTime;
1691 
1692  dwToGo = lpMidiStrm->dwStartTicks + lpMidiStrm->dwPositionMS;
1693 
1694  TRACE("%d/%d/%d\n", dwToGo, GetTickCount(), me->dwDeltaTime);
1695  while ((dwCurrTC = GetTickCount()) < dwToGo) {
1696  if (MsgWaitForMultipleObjects(0, NULL, FALSE, dwToGo - dwCurrTC, QS_ALLINPUT) == WAIT_OBJECT_0) {
1697  /* got a message, handle it */
1698  while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) {
1699  if (!MMSYSTEM_MidiStream_MessageHandler(lpMidiStrm, lpwm, &msg))
1700  goto the_end;
1701  }
1702  lpData = 0;
1703  } else {
1704  /* timeout, so me->dwDeltaTime is elapsed, can break the while loop */
1705  break;
1706  }
1707  }
1708  }
1709  switch (MEVT_EVENTTYPE(me->dwEvent & ~MEVT_F_CALLBACK)) {
1710  case MEVT_COMMENT:
1711  FIXME("NIY: MEVT_COMMENT\n");
1712  /* do nothing, skip bytes */
1713  break;
1714  case MEVT_LONGMSG:
1715  FIXME("NIY: MEVT_LONGMSG, aka sending Sysex event\n");
1716  break;
1717  case MEVT_NOP:
1718  break;
1719  case MEVT_SHORTMSG:
1720  midiOutShortMsg(lpMidiStrm->hDevice, MEVT_EVENTPARM(me->dwEvent));
1721  break;
1722  case MEVT_TEMPO:
1723  lpMidiStrm->dwTempo = MEVT_EVENTPARM(me->dwEvent);
1724  break;
1725  case MEVT_VERSION:
1726  break;
1727  default:
1728  FIXME("Unknown MEVT (0x%02x)\n", MEVT_EVENTTYPE(me->dwEvent & ~MEVT_F_CALLBACK));
1729  break;
1730  }
1731  if (me->dwEvent & MEVT_F_CALLBACK) {
1732  DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
1733  (HDRVR)lpMidiStrm->hDevice, MM_MOM_POSITIONCB,
1734  lpwm->mod.dwInstance, (LPARAM)lpMidiHdr, 0L);
1735  }
1736  lpMidiHdr->dwOffset += sizeof(MIDIEVENT) - sizeof(me->dwParms);
1737  if (me->dwEvent & MEVT_F_LONG)
1738  lpMidiHdr->dwOffset += (MEVT_EVENTPARM(me->dwEvent) + 3) & ~3;
1739  if (lpMidiHdr->dwOffset >= lpMidiHdr->dwBufferLength) {
1740  /* done with this header */
1741  lpMidiHdr->dwFlags |= MHDR_DONE;
1742  lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
1743 
1744  lpMidiStrm->lpMidiHdr = lpMidiHdr->lpNext;
1745  DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
1746  (HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE,
1747  lpwm->mod.dwInstance, (DWORD_PTR)lpMidiHdr, 0);
1748  lpData = 0;
1749  }
1750  }
1751 the_end:
1752  TRACE("End of thread\n");
1753  ExitThread(0);
1754  return 0; /* for removing the warning, never executed */
1755 }
DWORD dwCallback
Definition: mmddk.h:413
LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
Definition: lolvldrv.c:250
#define MEVT_EVENTTYPE(x)
Definition: mmsystem.h:275
DWORD dwPositionMS
Definition: winmm.c:1462
DWORD dwInstance
Definition: mmddk.h:414
HANDLE hEvent
Definition: winmm.c:1466
LPSTR lpData
Definition: mmsystem.h:1151
DWORD dwBufferLength
Definition: mmsystem.h:1152
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
#define MEVT_F_CALLBACK
Definition: mmsystem.h:274
static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream *lpMidiStrm, LPWINE_MIDI lpwm, LPMSG msg)
Definition: winmm.c:1516
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
HANDLE hThread
Definition: winmm.c:1458
MIDIOPENDESC mod
Definition: winemm.h:110
DWORD dwStartTicks
Definition: winmm.c:1464
UINT WINAPI midiOutShortMsg(HMIDIOUT hMidiOut, DWORD dwMsg)
Definition: winmm.c:1042
unsigned char * LPBYTE
Definition: typedefs.h:52
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
VOID WINAPI ExitThread(IN DWORD uExitCode)
Definition: thread.c:326
#define MEVT_LONGMSG
Definition: mmsystem.h:280
#define TRACE(s)
Definition: solgame.cpp:4
#define MMDRV_MIDIOUT
Definition: winemm.h:79
#define WAIT_OBJECT_0
Definition: winbase.h:387
HMIDIOUT hDevice
Definition: winmm.c:1457
unsigned long DWORD
Definition: ntddk_ex.h:95
#define MEVT_NOP
Definition: mmsystem.h:279
#define MEVT_EVENTPARM(x)
Definition: mmsystem.h:276
DWORD dwFlags
Definition: mmsystem.h:1155
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
DWORD dwTempo
Definition: winmm.c:1460
DWORD WINAPI SuspendThread(IN HANDLE hThread)
Definition: thread.c:603
#define MEVT_VERSION
Definition: mmsystem.h:282
static const WCHAR L[]
Definition: oid.c:1250
#define MEVT_COMMENT
Definition: mmsystem.h:281
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MHDR_DONE
Definition: mmsystem.h:268
#define MEVT_SHORTMSG
Definition: mmsystem.h:277
static DWORD MMSYSTEM_MidiStream_Convert(WINE_MIDIStream *lpMidiStrm, DWORD pulse)
Definition: winmm.c:1495
#define QS_ALLINPUT
Definition: winuser.h:874
#define MHDR_INQUEUE
Definition: mmsystem.h:270
struct midihdr_tag * lpNext
Definition: mmsystem.h:1156
#define msg(x)
Definition: auth_time.c:54
#define MEVT_F_LONG
Definition: mmsystem.h:273
LPMIDIHDR lpMidiHdr
Definition: winmm.c:1467
DWORD dwOffset
Definition: mmsystem.h:1158
#define MM_MOM_POSITIONCB
Definition: mmsystem.h:79
#define MEVT_TEMPO
Definition: mmsystem.h:278
#define PM_REMOVE
Definition: winuser.h:1182
BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HDRVR hDev, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2)
DWORD dwPulses
Definition: winmm.c:1463
struct midievent_tag MIDIEVENT
#define MM_MOM_DONE
Definition: mmsystem.h:70

Referenced by midiStreamOpen().

◆ MMSYSTEM_MidiStream_PostMessage()

static BOOL MMSYSTEM_MidiStream_PostMessage ( WINE_MIDIStream lpMidiStrm,
WORD  msg,
DWORD  pmt1,
DWORD  pmt2 
)
static

Definition at line 1760 of file winmm.c.

1761 {
1762  if (PostThreadMessageA(lpMidiStrm->dwThreadID, msg, pmt1, pmt2)) {
1763  //DWORD count;
1764 
1765  //ReleaseThunkLock(&count);
1766  WaitForSingleObject(lpMidiStrm->hEvent, INFINITE);
1767  //RestoreThunkLock(count);
1768  } else {
1769  WARN("bad PostThreadMessageA\n");
1770  return FALSE;
1771  }
1772  return TRUE;
1773 }
#define TRUE
Definition: types.h:120
HANDLE hEvent
Definition: winmm.c:1466
#define WARN(fmt,...)
Definition: debug.h:111
BOOL WINAPI PostThreadMessageA(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
DWORD dwThreadID
Definition: winmm.c:1459
#define msg(x)
Definition: auth_time.c:54
#define INFINITE
Definition: serial.h:102

Referenced by midiStreamClose(), and midiStreamStop().

◆ mmTaskBlock()

VOID WINAPI mmTaskBlock ( DWORD  tid)

Definition at line 2888 of file winmm.c.

2889 {
2890  MSG msg;
2891 
2892  do
2893  {
2894  GetMessageA(&msg, 0, 0, 0);
2895  if (msg.hwnd) DispatchMessageA(&msg);
2896  } while (msg.message != WM_USER);
2897 }
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define WM_USER
Definition: winuser.h:1856
#define msg(x)
Definition: auth_time.c:54

◆ mmTaskCreate()

UINT WINAPI mmTaskCreate ( LPTASKCALLBACK  cb,
HANDLE ph,
DWORD_PTR  client 
)

Definition at line 2859 of file winmm.c.

2860 {
2861  HANDLE hThread;
2862  HANDLE hEvent = 0;
2863  struct mm_starter *mms;
2864 
2865  mms = HeapAlloc(GetProcessHeap(), 0, sizeof(struct mm_starter));
2866  if (mms == NULL) return TASKERR_OUTOFMEMORY;
2867 
2868  mms->cb = cb;
2869  mms->client = client;
2870  if (ph) hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
2871  mms->event = hEvent;
2872 
2873  hThread = CreateThread(0, 0, mmTaskRun, mms, 0, NULL);
2874  if (!hThread) {
2875  HeapFree(GetProcessHeap(), 0, mms);
2876  if (hEvent) CloseHandle(hEvent);
2877  return TASKERR_OUTOFMEMORY;
2878  }
2880  if (ph) *ph = hEvent;
2882  return 0;
2883 }
#define CloseHandle
Definition: compat.h:398
LPTASKCALLBACK cb
Definition: winmm.c:2840
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
static HANDLE hEvent
Definition: comm.c:54
HANDLE event
Definition: winmm.c:2842
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)
Definition: thread.c:111
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
Definition: thread.c:661
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define TASKERR_OUTOFMEMORY
Definition: mmddk.h:470
static FILE * client
Definition: client.c:41
static DWORD cb
Definition: integrity.c:41
#define THREAD_PRIORITY_TIME_CRITICAL
Definition: winbase.h:278
static DWORD WINAPI mmTaskRun(void *pmt)
Definition: winmm.c:2845
HANDLE hThread
Definition: wizard.c:27
#define HeapFree(x, y, z)
Definition: compat.h:394
DWORD client
Definition: winmm.c:2841

◆ mmTaskRun()

static DWORD WINAPI mmTaskRun ( void pmt)
static

Definition at line 2845 of file winmm.c.

2846 {
2847  struct mm_starter mms;
2848 
2849  memcpy(&mms, pmt, sizeof(struct mm_starter));
2850  HeapFree(GetProcessHeap(), 0, pmt);
2851  mms.cb(mms.client);
2852  if (mms.event) SetEvent(mms.event);
2853  return 0;
2854 }
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
#define GetProcessHeap()
Definition: compat.h:395
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by mmTaskCreate().

◆ mmTaskSignal()

BOOL WINAPI mmTaskSignal ( DWORD  tid)

Definition at line 2902 of file winmm.c.

2903 {
2904  return PostThreadMessageW(tid, WM_USER, 0, 0);
2905 }
#define WM_USER
Definition: winuser.h:1856
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static TfClientId tid

◆ mmTaskYield()

VOID WINAPI mmTaskYield ( VOID  )

Definition at line 2910 of file winmm.c.

2910 {}

◆ WAVE_Open()

static UINT WAVE_Open ( HANDLE lphndl,
UINT  uDeviceID,
UINT  uType,
LPCWAVEFORMATEX  lpFormat,
DWORD_PTR  dwCallback,
DWORD_PTR  dwInstance,
DWORD  dwFlags 
)
static

Definition at line 2055 of file winmm.c.

2058 {
2059  HANDLE handle;
2060  LPWINE_MLD wmld;
2061  DWORD dwRet;
2062  WAVEOPENDESC wod;
2063 
2064  TRACE("(%p, %d, %s, %p, %08lX, %08lX, %08X);\n",
2065  lphndl, (int)uDeviceID, (uType==MMDRV_WAVEOUT)?"Out":"In", lpFormat, dwCallback,
2066  dwInstance, dwFlags);
2067 
2068  if (dwFlags & WAVE_FORMAT_QUERY)
2069  TRACE("WAVE_FORMAT_QUERY requested !\n");
2070 
2071  dwRet = WINMM_CheckCallback(dwCallback, dwFlags, FALSE);
2072  if (dwRet != MMSYSERR_NOERROR)
2073  return dwRet;
2074 
2075  if (lpFormat == NULL) {
2076  WARN("bad format\n");
2077  return WAVERR_BADFORMAT;
2078  }
2079 
2080  if ((dwFlags & WAVE_MAPPED) && (uDeviceID == (UINT)-1)) {
2081  WARN("invalid parameter\n");
2082  return MMSYSERR_INVALPARAM;
2083  }
2084 
2085  /* may have a PCMWAVEFORMAT rather than a WAVEFORMATEX so don't read cbSize */
2086  TRACE("wFormatTag=%u, nChannels=%u, nSamplesPerSec=%u, nAvgBytesPerSec=%u, nBlockAlign=%u, wBitsPerSample=%u\n",
2087  lpFormat->wFormatTag, lpFormat->nChannels, lpFormat->nSamplesPerSec,
2088  lpFormat->nAvgBytesPerSec, lpFormat->nBlockAlign, lpFormat->wBitsPerSample);
2089 
2090  if ((wmld = MMDRV_Alloc(sizeof(WINE_WAVE), uType, &handle,
2091  &dwFlags, &dwCallback, &dwInstance)) == NULL) {
2092  return MMSYSERR_NOMEM;
2093  }
2094 
2095  wod.hWave = handle;
2096  wod.lpFormat = (LPWAVEFORMATEX)lpFormat; /* should the struct be copied iso pointer? */
2097  wod.dwCallback = dwCallback;
2098  wod.dwInstance = dwInstance;
2099  wod.dnDevNode = 0L;
2100 
2101  TRACE("cb=%08lx\n", wod.dwCallback);
2102 
2103  for (;;) {
2104  if (dwFlags & WAVE_MAPPED) {
2105  wod.uMappedDeviceID = uDeviceID;
2106  uDeviceID = WAVE_MAPPER;
2107  } else {
2108  wod.uMappedDeviceID = -1;
2109  }
2110  wmld->uDeviceID = uDeviceID;
2111 
2112  dwRet = MMDRV_Open(wmld, (uType == MMDRV_WAVEOUT) ? WODM_OPEN : WIDM_OPEN,
2113  (DWORD_PTR)&wod, dwFlags);
2114 
2115  TRACE("dwRet = %s\n", WINMM_ErrorToString(dwRet));
2116  if (dwRet != WAVERR_BADFORMAT ||
2117  ((dwFlags & (WAVE_MAPPED|WAVE_FORMAT_DIRECT)) != 0) || (uDeviceID == WAVE_MAPPER)) break;
2118  /* if we ask for a format which isn't supported by the physical driver,
2119  * let's try to map it through the wave mapper (except, if we already tried
2120  * or user didn't allow us to use acm codecs or the device is already the mapper)
2121  */
2122  dwFlags |= WAVE_MAPPED;
2123  /* we shall loop only one */
2124  }
2125 
2126  if ((dwFlags & WAVE_FORMAT_QUERY) || dwRet != MMSYSERR_NOERROR) {
2127  MMDRV_Free(handle, wmld);
2128  handle = 0;
2129  }
2130 
2131  if (lphndl != NULL) *lphndl = handle;
2132  TRACE("=> %s hWave=%p\n", WINMM_ErrorToString(dwRet), handle);
2133 
2134  return dwRet;
2135 }
#define WAVERR_BADFORMAT
Definition: mmsystem.h:176
const char * WINMM_ErrorToString(MMRESULT error)
Definition: winmm.c:113
#define WAVE_FORMAT_QUERY
Definition: mmsystem.h:188
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
DWORD dwCallback
Definition: mmddk.h:400
LPWINE_MLD MMDRV_Alloc(UINT size, UINT type, LPHANDLE hndl, DWORD *dwFlags, DWORD_PTR *dwCallback, DWORD_PTR *dwInstance)
Definition: lolvldrv.c:123
#define WARN(fmt,...)
Definition: debug.h:111
#define WODM_OPEN
Definition: mmddk.h:110
UINT uMappedDeviceID
Definition: mmddk.h:402
#define MMDRV_WAVEOUT
Definition: winemm.h:81
DWORD dnDevNode
Definition: mmddk.h:403
MMRESULT WINMM_CheckCallback(DWORD_PTR dwCallback, DWORD fdwOpen, BOOL mixer)
Definition: winmm.c:196
#define WAVE_FORMAT_DIRECT
Definition: mmsystem.h:191
#define MMSYSERR_NOMEM
Definition: mmsystem.h:103
struct _WAVEFORMATEX * LPWAVEFORMATEX
smooth NULL
Definition: ftsmooth.c:416
DWORD MMDRV_Open(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD dwFlags)
Definition: lolvldrv.c:183
HWAVE hWave
Definition: mmddk.h:398
#define TRACE(s)
Definition: solgame.cpp:4
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define WAVE_MAPPER
Definition: mmsystem.h:187
LPWAVEFORMATEX lpFormat
Definition: mmddk.h:399
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
DWORD dwInstance
Definition: mmddk.h:401
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
LPCWSTR lpFormat
Definition: trayclock.cpp:32
uint32_t DWORD_PTR
Definition: typedefs.h:63
UINT uDeviceID
Definition: winemm.h:94
void MMDRV_Free(HANDLE hndl, LPWINE_MLD mld)
Definition: lolvldrv.c:165
#define MMSYSERR_INVALPARAM
Definition: mmsystem.h:107
#define WAVE_MAPPED
Definition: mmsystem.h:190
unsigned int UINT
Definition: ndis.h:50
#define WIDM_OPEN
Definition: mmddk.h:138

Referenced by waveInOpen(), and waveOutOpen().

◆ waveInAddBuffer()

UINT WINAPI waveInAddBuffer ( HWAVEIN  hWaveIn,
WAVEHDR lpWaveInHdr,
UINT  uSize 
)

Definition at line 2720 of file winmm.c.

2722 {
2723  LPWINE_MLD wmld;
2724 
2725  TRACE("(%p, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize);
2726 
2727  if (lpWaveInHdr == NULL) retu