ReactOS 0.4.15-dev-8417-gb6b82fe
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
 
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 1467 of file winmm.c.

◆ WINE_MSM_STOP

#define WINE_MSM_STOP   (WM_USER+1)

Definition at line 1468 of file winmm.c.

Typedef Documentation

◆ WINE_MIDIStream

Function Documentation

◆ auxGetDevCapsA()

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

Definition at line 739 of file winmm.c.

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

◆ auxGetDevCapsW()

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

Definition at line 723 of file winmm.c.

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

Referenced by auxGetDevCapsA().

◆ auxGetNumDevs()

UINT WINAPI auxGetNumDevs ( void  )

Definition at line 715 of file winmm.c.

716{
717 return MMDRV_GetNum(MMDRV_AUX);
718}
UINT MMDRV_GetNum(UINT type)
Definition: lolvldrv.c:61

◆ auxGetVolume()

UINT WINAPI auxGetVolume ( UINT  uDeviceID,
DWORD lpdwVolume 
)

Definition at line 765 of file winmm.c.

766{
767 LPWINE_MLD wmld;
768
769 TRACE("(%04X, %p) !\n", uDeviceID, lpdwVolume);
770
771 if ((wmld = MMDRV_Get(UlongToHandle(uDeviceID), MMDRV_AUX, TRUE)) == NULL)
773 return MMDRV_Message(wmld, AUXDM_GETVOLUME, (DWORD_PTR)lpdwVolume, 0L);
774}
#define UlongToHandle(ul)
Definition: basetsd.h:97
#define AUXDM_GETVOLUME
Definition: mmddk.h:184
#define L(x)
Definition: ntvdm.h:50

◆ auxOutMessage()

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

Definition at line 793 of file winmm.c.

794{
795 LPWINE_MLD wmld;
796
797 if ((wmld = MMDRV_Get(UlongToHandle(uDeviceID), MMDRV_AUX, TRUE)) == NULL)
799
800 return MMDRV_Message(wmld, uMessage, dw1, dw2);
801}

◆ auxSetVolume()

UINT WINAPI auxSetVolume ( UINT  uDeviceID,
DWORD  dwVolume 
)

Definition at line 779 of file winmm.c.

780{
781 LPWINE_MLD wmld;
782
783 TRACE("(%04X, %u) !\n", uDeviceID, dwVolume);
784
785 if ((wmld = MMDRV_Get(UlongToHandle(uDeviceID), MMDRV_AUX, TRUE)) == NULL)
787 return MMDRV_Message(wmld, AUXDM_SETVOLUME, dwVolume, 0L);
788}
#define AUXDM_SETVOLUME
Definition: mmddk.h:185

◆ DllMain()

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

Definition at line 156 of file winmm.c.

157{
158 TRACE("%p 0x%x %p\n", hInstDLL, fdwReason, fImpLoad);
159
160 switch (fdwReason) {
163
164 if (!WINMM_CreateIData(hInstDLL))
165 return FALSE;
166 if (!MMDRV_Init()) {
168 return FALSE;
169 }
170 break;
172 /* close all opened MCI drivers */
174 MMDRV_Exit();
175 /* There's no guarantee the drivers haven't already been unloaded on
176 * process shutdown.
177 */
178 if (!fImpLoad)
179 {
180 /* now unload all remaining drivers... */
182 }
183
185 break;
186 }
187 return TRUE;
188}
DWORD LPVOID fImpLoad
Definition: misc.cpp:155
#define FALSE
Definition: types.h:117
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
void DRIVER_UnloadAll(void)
Definition: driver.c:658
DWORD MCI_SendCommand(UINT wDevID, UINT16 wMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: mci.c:2075
void MMDRV_Exit(void)
Definition: lolvldrv.c:611
BOOL MMDRV_Init(void)
Definition: lolvldrv.c:530
#define MCI_ALL_DEVICE_ID
Definition: mmsystem.h:679
#define MCI_CLOSE
Definition: mmsystem.h:647
#define MCI_WAIT
Definition: mmsystem.h:730
static void WINMM_DeleteIData(void)
Definition: winmm.c:69
static BOOL WINMM_CreateIData(HINSTANCE hInstDLL)
Definition: winmm.c:58

◆ 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 909 of file winmm.c.

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

Referenced by midiOutOpen(), and midiStreamOpen().

◆ midiConnect()

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

Definition at line 1438 of file winmm.c.

1439{
1440 FIXME("(%p, %p, %p): Stub\n", hMidi, hmo, pReserved);
1441 return MMSYSERR_ERROR;
1442}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define MMSYSERR_ERROR
Definition: mmsystem.h:97

◆ midiDisconnect()

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

Definition at line 1447 of file winmm.c.

1448{
1449 FIXME("(%p, %p, %p): Stub\n", hMidi, hmo, pReserved);
1450 return MMSYSERR_ERROR;
1451}

◆ midiInAddBuffer()

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

Definition at line 1336 of file winmm.c.

1338{
1339 LPWINE_MLD wmld;
1340
1341 TRACE("(%p, %p, %d)\n", hMidiIn, lpMidiInHdr, uSize);
1342
1343 if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1344 return MMSYSERR_INVALHANDLE;
1345
1346 return MMDRV_Message(wmld, MIDM_ADDBUFFER, (DWORD_PTR)lpMidiInHdr, uSize);
1347}
#define MIDM_ADDBUFFER
Definition: mmddk.h:175
#define MMDRV_MIDIIN
Definition: winemm.h:78

Referenced by test_midiIn_device().

◆ midiInClose()

UINT WINAPI midiInClose ( HMIDIIN  hMidiIn)

Definition at line 1276 of file winmm.c.

1277{
1278 LPWINE_MLD wmld;
1279 DWORD dwRet;
1280
1281 TRACE("(%p)\n", hMidiIn);
1282
1283 if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1284 return MMSYSERR_INVALHANDLE;
1285
1286 dwRet = MMDRV_Close(wmld, MIDM_CLOSE);
1287 MMDRV_Free(hMidiIn, wmld);
1288 return dwRet;
1289}
#define MIDM_CLOSE
Definition: mmddk.h:172
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 1209 of file winmm.c.

1210{
1211 MIDIINCAPSW micW;
1212 UINT ret;
1213
1214 if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
1215
1216 ret = midiInGetDevCapsW(uDeviceID, &micW, sizeof(micW));
1217
1218 if (ret == MMSYSERR_NOERROR) {
1219 MIDIINCAPSA micA;
1220 micA.wMid = micW.wMid;
1221 micA.wPid = micW.wPid;
1222 micA.vDriverVersion = micW.vDriverVersion;
1223 WideCharToMultiByte( CP_ACP, 0, micW.szPname, -1, micA.szPname,
1224 sizeof(micA.szPname), NULL, NULL );
1225 micA.dwSupport = micW.dwSupport;
1226 memcpy(lpCaps, &micA, min(uSize, sizeof(micA)));
1227 }
1228 return ret;
1229}
DWORD dwSupport
Definition: mmsystem.h:1139
MMVERSION vDriverVersion
Definition: mmsystem.h:1137
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1138
MMVERSION vDriverVersion
Definition: mmsystem.h:1145
DWORD dwSupport
Definition: mmsystem.h:1147
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1146
UINT WINAPI midiInGetDevCapsW(UINT_PTR uDeviceID, LPMIDIINCAPSW lpCaps, UINT uSize)
Definition: winmm.c:1192

Referenced by test_midiIn_device(), and test_midiOut_device().

◆ midiInGetDevCapsW()

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

Definition at line 1192 of file winmm.c.

1193{
1194 LPWINE_MLD wmld;
1195
1196 TRACE("(%ld, %p, %d);\n", uDeviceID, lpCaps, uSize);
1197
1198 if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
1199
1200 if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIDIIN, TRUE)) == NULL)
1201 return MMSYSERR_INVALHANDLE;
1202
1203 return MMDRV_Message(wmld, MIDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
1204}
#define MIDM_GETDEVCAPS
Definition: mmddk.h:170

Referenced by create_system_ports_list(), and midiInGetDevCapsA().

◆ midiInGetID()

UINT WINAPI midiInGetID ( HMIDIIN  hMidiIn,
UINT lpuDeviceID 
)

Definition at line 1397 of file winmm.c.

1398{
1399 LPWINE_MLD wmld;
1400
1401 TRACE("(%p, %p)\n", hMidiIn, lpuDeviceID);
1402
1403 if (lpuDeviceID == NULL) return MMSYSERR_INVALPARAM;
1404
1405 if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, TRUE)) == NULL)
1406 return MMSYSERR_INVALHANDLE;
1407
1408 *lpuDeviceID = wmld->uDeviceID;
1409
1410 return MMSYSERR_NOERROR;
1411}
UINT uDeviceID
Definition: winemm.h:94

◆ midiInGetNumDevs()

UINT WINAPI midiInGetNumDevs ( void  )

Definition at line 1184 of file winmm.c.

1185{
1186 return MMDRV_GetNum(MMDRV_MIDIIN);
1187}

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 1416 of file winmm.c.

1418{
1419 LPWINE_MLD wmld;
1420
1421 TRACE("(%p, %04X, %08lX, %08lX)\n", hMidiIn, uMessage, dwParam1, dwParam2);
1422
1423 if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1424 return MMSYSERR_INVALHANDLE;
1425
1426 switch (uMessage) {
1427 case MIDM_OPEN:
1428 case MIDM_CLOSE:
1429 FIXME("can't handle OPEN or CLOSE message!\n");
1430 return MMSYSERR_NOTSUPPORTED;
1431 }
1432 return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2);
1433}
#define MIDM_OPEN
Definition: mmddk.h:171
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104

◆ midiInOpen()

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

Definition at line 1234 of file winmm.c.

1236{
1237 HANDLE hMidiIn;
1238 LPWINE_MIDI lpwm;
1239 DWORD dwRet;
1240
1241 TRACE("(%p, %d, %08lX, %08lX, %08X);\n",
1242 lphMidiIn, uDeviceID, dwCallback, dwInstance, dwFlags);
1243
1244 if (lphMidiIn != NULL) *lphMidiIn = 0;
1245
1246 dwRet = WINMM_CheckCallback(dwCallback, dwFlags, FALSE);
1247 if (dwRet != MMSYSERR_NOERROR)
1248 return dwRet;
1249
1250 lpwm = (LPWINE_MIDI)MMDRV_Alloc(sizeof(WINE_MIDI), MMDRV_MIDIIN, &hMidiIn,
1251 &dwFlags, &dwCallback, &dwInstance);
1252
1253 if (lpwm == NULL)
1254 return MMSYSERR_NOMEM;
1255
1256 lpwm->mod.hMidi = hMidiIn;
1257 lpwm->mod.dwCallback = dwCallback;
1258 lpwm->mod.dwInstance = dwInstance;
1259
1260 lpwm->mld.uDeviceID = uDeviceID;
1261 dwRet = MMDRV_Open(&lpwm->mld, MIDM_OPEN, (DWORD_PTR)&lpwm->mod, dwFlags);
1262
1263 if (dwRet != MMSYSERR_NOERROR) {
1264 MMDRV_Free(hMidiIn, &lpwm->mld);
1265 hMidiIn = 0;
1266 }
1267 if (lphMidiIn != NULL) *lphMidiIn = hMidiIn;
1268 TRACE("=> %d hMidi=%p\n", dwRet, hMidiIn);
1269
1270 return dwRet;
1271}
DWORD MMDRV_Open(LPWINE_MLD mld, UINT wMsg, DWORD_PTR dwParam1, DWORD dwFlags)
Definition: lolvldrv.c:183
#define MMSYSERR_NOMEM
Definition: mmsystem.h:103
WINE_MLD mld
Definition: winemm.h:109
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
MMRESULT WINMM_CheckCallback(DWORD_PTR dwCallback, DWORD fdwOpen, BOOL mixer)
Definition: winmm.c:193

Referenced by test_midi_infns(), and test_midiIn_device().

◆ midiInPrepareHeader()

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

Definition at line 1294 of file winmm.c.

1296{
1297 LPWINE_MLD wmld;
1298
1299 TRACE("(%p, %p, %d)\n", hMidiIn, lpMidiInHdr, uSize);
1300
1301 if (lpMidiInHdr == NULL || uSize < sizeof (MIDIHDR))
1302 return MMSYSERR_INVALPARAM;
1303
1304 if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1305 return MMSYSERR_INVALHANDLE;
1306
1307 return MMDRV_Message(wmld, MIDM_PREPARE, (DWORD_PTR)lpMidiInHdr, uSize);
1308}
#define MIDM_PREPARE
Definition: mmddk.h:173

Referenced by test_midiIn_device().

◆ midiInReset()

UINT WINAPI midiInReset ( HMIDIIN  hMidiIn)

Definition at line 1382 of file winmm.c.

1383{
1384 LPWINE_MLD wmld;
1385
1386 TRACE("(%p)\n", hMidiIn);
1387
1388 if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1389 return MMSYSERR_INVALHANDLE;
1390
1391 return MMDRV_Message(wmld, MIDM_RESET, 0L, 0L);
1392}
#define MIDM_RESET
Definition: mmddk.h:178

Referenced by test_midiIn_device().

◆ midiInStart()

UINT WINAPI midiInStart ( HMIDIIN  hMidiIn)

Definition at line 1352 of file winmm.c.

1353{
1354 LPWINE_MLD wmld;
1355
1356 TRACE("(%p)\n", hMidiIn);
1357
1358 if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1359 return MMSYSERR_INVALHANDLE;
1360
1361 return MMDRV_Message(wmld, MIDM_START, 0L, 0L);
1362}
#define MIDM_START
Definition: mmddk.h:176

◆ midiInStop()

UINT WINAPI midiInStop ( HMIDIIN  hMidiIn)

Definition at line 1367 of file winmm.c.

1368{
1369 LPWINE_MLD wmld;
1370
1371 TRACE("(%p)\n", hMidiIn);
1372
1373 if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1374 return MMSYSERR_INVALHANDLE;
1375
1376 return MMDRV_Message(wmld, MIDM_STOP, 0L, 0L);
1377}
#define MIDM_STOP
Definition: mmddk.h:177

◆ midiInUnprepareHeader()

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

Definition at line 1313 of file winmm.c.

1315{
1316 LPWINE_MLD wmld;
1317
1318 TRACE("(%p, %p, %d)\n", hMidiIn, lpMidiInHdr, uSize);
1319
1320 if (lpMidiInHdr == NULL || uSize < sizeof (MIDIHDR))
1321 return MMSYSERR_INVALPARAM;
1322
1323 if (!(lpMidiInHdr->dwFlags & MHDR_PREPARED)) {
1324 return MMSYSERR_NOERROR;
1325 }
1326
1327 if ((wmld = MMDRV_Get(hMidiIn, MMDRV_MIDIIN, FALSE)) == NULL)
1328 return MMSYSERR_INVALHANDLE;
1329
1330 return MMDRV_Message(wmld, MIDM_UNPREPARE, (DWORD_PTR)lpMidiInHdr, uSize);
1331}
#define MIDM_UNPREPARE
Definition: mmddk.h:174
#define MHDR_PREPARED
Definition: mmsystem.h:269
DWORD dwFlags
Definition: mmsystem.h:1155

Referenced by test_midiIn_device().

◆ midiOutCacheDrumPatches()

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

Definition at line 1126 of file winmm.c.

1128{
1129 FIXME("not supported yet\n");
1130 return MMSYSERR_NOTSUPPORTED;
1131}

◆ midiOutCachePatches()

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

Definition at line 1115 of file winmm.c.

1117{
1118 /* not really necessary to support this */
1119 FIXME("not supported yet\n");
1120 return MMSYSERR_NOTSUPPORTED;
1121}

◆ midiOutClose()

UINT WINAPI midiOutClose ( HMIDIOUT  hMidiOut)

Definition at line 978 of file winmm.c.

979{
980 LPWINE_MLD wmld;
981 DWORD dwRet;
982
983 TRACE("(%p)\n", hMidiOut);
984
985 if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
987
988 dwRet = MMDRV_Close(wmld, MODM_CLOSE);
989 MMDRV_Free(hMidiOut, wmld);
990
991 return dwRet;
992}
#define MODM_CLOSE
Definition: mmddk.h:157

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

◆ midiOutGetDevCapsA()

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

Definition at line 832 of file winmm.c.

834{
835 MIDIOUTCAPSW mocW;
836 UINT ret;
837
838 if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
839
840 ret = midiOutGetDevCapsW(uDeviceID, &mocW, sizeof(mocW));
841
842 if (ret == MMSYSERR_NOERROR) {
843 MIDIOUTCAPSA mocA;
844 mocA.wMid = mocW.wMid;
845 mocA.wPid = mocW.wPid;
846 mocA.vDriverVersion = mocW.vDriverVersion;
847 WideCharToMultiByte( CP_ACP, 0, mocW.szPname, -1, mocA.szPname,
848 sizeof(mocA.szPname), NULL, NULL );
849 mocA.wTechnology = mocW.wTechnology;
850 mocA.wVoices = mocW.wVoices;
851 mocA.wNotes = mocW.wNotes;
852 mocA.wChannelMask = mocW.wChannelMask;
853 mocA.dwSupport = mocW.dwSupport;
854 memcpy(lpCaps, &mocA, min(uSize, sizeof(mocA)));
855 }
856 return ret;
857}
MMVERSION vDriverVersion
Definition: mmsystem.h:1113
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1114
MMVERSION vDriverVersion
Definition: mmsystem.h:1125
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1126
UINT WINAPI midiOutGetDevCapsW(UINT_PTR uDeviceID, LPMIDIOUTCAPSW lpCaps, UINT uSize)
Definition: winmm.c:814

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

◆ midiOutGetDevCapsW()

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

Definition at line 814 of file winmm.c.

816{
817 LPWINE_MLD wmld;
818
819 TRACE("(%lu, %p, %u);\n", uDeviceID, lpCaps, uSize);
820
821 if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
822
823 if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIDIOUT, TRUE)) == NULL)
825
826 return MMDRV_Message(wmld, MODM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
827}
#define MODM_GETDEVCAPS
Definition: mmddk.h:155

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

◆ midiOutGetErrorTextA()

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

Definition at line 863 of file winmm.c.

864{
865 UINT ret;
866
867 if (lpText == NULL) ret = MMSYSERR_INVALPARAM;
868 else if (uSize == 0) ret = MMSYSERR_NOERROR;
869 else
870 {
871 LPWSTR xstr = HeapAlloc(GetProcessHeap(), 0, uSize * sizeof(WCHAR));
872 if (!xstr) ret = MMSYSERR_NOMEM;
873 else
874 {
875 ret = midiOutGetErrorTextW(uError, xstr, uSize);
876 if (ret == MMSYSERR_NOERROR)
877 WideCharToMultiByte(CP_ACP, 0, xstr, -1, lpText, uSize, NULL, NULL);
878 HeapFree(GetProcessHeap(), 0, xstr);
879 }
880 }
881 return ret;
882}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
UINT WINAPI midiOutGetErrorTextW(UINT uError, LPWSTR lpText, UINT uSize)
Definition: winmm.c:888
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ midiOutGetErrorTextW()

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

Definition at line 888 of file winmm.c.

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

Referenced by midiOutGetErrorTextA().

◆ midiOutGetID()

UINT WINAPI midiOutGetID ( HMIDIOUT  hMidiOut,
UINT lpuDeviceID 
)

Definition at line 1136 of file winmm.c.

1137{
1138 LPWINE_MLD wmld;
1139
1140 TRACE("(%p, %p)\n", hMidiOut, lpuDeviceID);
1141
1142 if (lpuDeviceID == NULL) return MMSYSERR_INVALPARAM;
1143 if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
1144 return MMSYSERR_INVALHANDLE;
1145
1146 *lpuDeviceID = wmld->uDeviceID;
1147 return MMSYSERR_NOERROR;
1148}

Referenced by test_midiOut_device().

◆ midiOutGetNumDevs()

◆ midiOutGetVolume()

UINT WINAPI midiOutGetVolume ( HMIDIOUT  hMidiOut,
DWORD lpdwVolume 
)

Definition at line 1085 of file winmm.c.

1086{
1087 LPWINE_MLD wmld;
1088
1089 TRACE("(%p, %p);\n", hMidiOut, lpdwVolume);
1090
1091 if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) == NULL)
1092 return MMSYSERR_INVALHANDLE;
1093
1094 return MMDRV_Message(wmld, MODM_GETVOLUME, (DWORD_PTR)lpdwVolume, 0L);
1095}
#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 1054 of file winmm.c.

1056{
1057 LPWINE_MLD wmld;
1058
1059 TRACE("(%p, %p, %d)\n", hMidiOut, lpMidiOutHdr, uSize);
1060
1061 if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
1062 return MMSYSERR_INVALHANDLE;
1063
1064 return MMDRV_Message(wmld, MODM_LONGDATA, (DWORD_PTR)lpMidiOutHdr, uSize);
1065}
#define MODM_LONGDATA
Definition: mmddk.h:161

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 1153 of file winmm.c.

1155{
1156 LPWINE_MLD wmld;
1157
1158 TRACE("(%p, %04X, %08lX, %08lX)\n", hMidiOut, uMessage, dwParam1, dwParam2);
1159
1160 if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL) {
1161 /* HACK... */
1162 if (uMessage == 0x0001) {
1163 *(LPDWORD)dwParam1 = 1;
1164 return 0;
1165 }
1166 if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) != NULL) {
1167 return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2);
1168 }
1169 return MMSYSERR_INVALHANDLE;
1170 }
1171
1172 switch (uMessage) {
1173 case MODM_OPEN:
1174 case MODM_CLOSE:
1175 FIXME("can't handle OPEN or CLOSE message!\n");
1176 return MMSYSERR_NOTSUPPORTED;
1177 }
1178 return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2);
1179}
#define MODM_OPEN
Definition: mmddk.h:156
UINT MMDRV_PhysicalFeatures(LPWINE_MLD mld, UINT uMsg, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
Definition: lolvldrv.c:303
#define LPDWORD
Definition: nt_native.h:46

◆ midiOutOpen()

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

Definition at line 939 of file winmm.c.

941{
942 HMIDIOUT hMidiOut;
943 LPWINE_MIDI lpwm;
944 UINT dwRet;
945
946 TRACE("(%p, %d, %08lX, %08lX, %08X);\n",
947 lphMidiOut, uDeviceID, dwCallback, dwInstance, dwFlags);
948
949 if (lphMidiOut != NULL) *lphMidiOut = 0;
950
951 dwRet = WINMM_CheckCallback(dwCallback, dwFlags, FALSE);
952 if (dwRet != MMSYSERR_NOERROR)
953 return dwRet;
954
955 lpwm = MIDI_OutAlloc(&hMidiOut, &dwCallback, &dwInstance, &dwFlags, 0, NULL);
956
957 if (lpwm == NULL)
958 return MMSYSERR_NOMEM;
959
960 lpwm->mld.uDeviceID = uDeviceID;
961
962 dwRet = MMDRV_Open((LPWINE_MLD)lpwm, MODM_OPEN, (DWORD_PTR)&lpwm->mod, dwFlags);
963
964 if (dwRet != MMSYSERR_NOERROR) {
965 MMDRV_Free(hMidiOut, (LPWINE_MLD)lpwm);
966 hMidiOut = 0;
967 }
968
969 if (lphMidiOut) *lphMidiOut = hMidiOut;
970 TRACE("=> %d hMidi=%p\n", dwRet, hMidiOut);
971
972 return dwRet;
973}
static LPWINE_MIDI MIDI_OutAlloc(HMIDIOUT *lphMidiOut, DWORD_PTR *lpdwCallback, DWORD_PTR *lpdwInstance, LPDWORD lpdwFlags, DWORD cIDs, MIDIOPENSTRMID *lpIDs)
Definition: winmm.c:909

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 997 of file winmm.c.

999{
1000 LPWINE_MLD wmld;
1001
1002 TRACE("(%p, %p, %d)\n", hMidiOut, lpMidiOutHdr, uSize);
1003
1004 if (lpMidiOutHdr == NULL || uSize < sizeof (MIDIHDR))
1005 return MMSYSERR_INVALPARAM;
1006
1007 if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
1008 return MMSYSERR_INVALHANDLE;
1009
1010 return MMDRV_Message(wmld, MODM_PREPARE, (DWORD_PTR)lpMidiOutHdr, uSize);
1011}
#define MODM_PREPARE
Definition: mmddk.h:158

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

◆ midiOutReset()

UINT WINAPI midiOutReset ( HMIDIOUT  hMidiOut)

Definition at line 1070 of file winmm.c.

1071{
1072 LPWINE_MLD wmld;
1073
1074 TRACE("(%p)\n", hMidiOut);
1075
1076 if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
1077 return MMSYSERR_INVALHANDLE;
1078
1079 return MMDRV_Message(wmld, MODM_RESET, 0L, 0L);
1080}
#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 1100 of file winmm.c.

1101{
1102 LPWINE_MLD wmld;
1103
1104 TRACE("(%p, %d);\n", hMidiOut, dwVolume);
1105
1106 if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, TRUE)) == NULL)
1107 return MMSYSERR_INVALHANDLE;
1108
1109 return MMDRV_Message(wmld, MODM_SETVOLUME, dwVolume, 0L);
1110}
#define MODM_SETVOLUME
Definition: mmddk.h:164

Referenced by test_midiOut_device().

◆ midiOutShortMsg()

UINT WINAPI midiOutShortMsg ( HMIDIOUT  hMidiOut,
DWORD  dwMsg 
)

Definition at line 1039 of file winmm.c.

1040{
1041 LPWINE_MLD wmld;
1042
1043 TRACE("(%p, %08X)\n", hMidiOut, dwMsg);
1044
1045 if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
1046 return MMSYSERR_INVALHANDLE;
1047
1048 return MMDRV_Message(wmld, MODM_DATA, dwMsg, 0L);
1049}
#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 1016 of file winmm.c.

1018{
1019 LPWINE_MLD wmld;
1020
1021 TRACE("(%p, %p, %d)\n", hMidiOut, lpMidiOutHdr, uSize);
1022
1023 if (lpMidiOutHdr == NULL || uSize < sizeof (MIDIHDR))
1024 return MMSYSERR_INVALPARAM;
1025
1026 if (!(lpMidiOutHdr->dwFlags & MHDR_PREPARED)) {
1027 return MMSYSERR_NOERROR;
1028 }
1029
1030 if ((wmld = MMDRV_Get(hMidiOut, MMDRV_MIDIOUT, FALSE)) == NULL)
1031 return MMSYSERR_INVALHANDLE;
1032
1033 return MMDRV_Message(wmld, MODM_UNPREPARE, (DWORD_PTR)lpMidiOutHdr, uSize);
1034}
#define MODM_UNPREPARE
Definition: mmddk.h:159

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

◆ midiStreamClose()

MMRESULT WINAPI midiStreamClose ( HMIDISTRM  hMidiStrm)

Definition at line 1775 of file winmm.c.

1776{
1777 WINE_MIDIStream* lpMidiStrm;
1778
1779 TRACE("(%p)!\n", hMidiStrm);
1780
1781 if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL))
1782 return MMSYSERR_INVALHANDLE;
1783
1784 midiStreamStop(hMidiStrm);
1785 MMSYSTEM_MidiStream_PostMessage(lpMidiStrm, WM_QUIT, 0, 0);
1786 HeapFree(GetProcessHeap(), 0, lpMidiStrm);
1787 CloseHandle(lpMidiStrm->hEvent);
1788
1789 return midiOutClose((HMIDIOUT)hMidiStrm);
1790}
#define CloseHandle
Definition: compat.h:739
HANDLE hEvent
Definition: winmm.c:1463
UINT WINAPI midiOutClose(HMIDIOUT hMidiOut)
Definition: winmm.c:978
static BOOL MMSYSTEM_MidiStream_PostMessage(WINE_MIDIStream *lpMidiStrm, WORD msg, DWORD pmt1, DWORD pmt2)
Definition: winmm.c:1757
MMRESULT WINAPI midiStreamStop(HMIDISTRM hMidiStrm)
Definition: winmm.c:2035
static BOOL MMSYSTEM_GetMidiStream(HMIDISTRM hMidiStrm, WINE_MIDIStream **lpMidiStrm, WINE_MIDI **lplpwm)
Definition: winmm.c:1473
#define WM_QUIT
Definition: winuser.h:1623

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 1795 of file winmm.c.

1798{
1799 WINE_MIDIStream* lpMidiStrm;
1800 MMRESULT ret;
1801 MIDIOPENSTRMID mosm;
1802 LPWINE_MIDI lpwm;
1803 HMIDIOUT hMidiOut;
1804
1805 TRACE("(%p, %p, %d, 0x%08lx, 0x%08lx, 0x%08x)!\n",
1806 lphMidiStrm, lpuDeviceID, cMidi, dwCallback, dwInstance, fdwOpen);
1807
1808 if (cMidi != 1 || lphMidiStrm == NULL || lpuDeviceID == NULL)
1809 return MMSYSERR_INVALPARAM;
1810
1811 ret = WINMM_CheckCallback(dwCallback, fdwOpen, FALSE);
1812 if (ret != MMSYSERR_NOERROR)
1813 return ret;
1814
1815 lpMidiStrm = HeapAlloc(GetProcessHeap(), 0, sizeof(WINE_MIDIStream));
1816 if (!lpMidiStrm)
1817 return MMSYSERR_NOMEM;
1818
1819 lpMidiStrm->dwTempo = 500000;
1820 lpMidiStrm->dwTimeDiv = 480; /* 480 is 120 quarter notes per minute *//* FIXME ??*/
1821 lpMidiStrm->dwPositionMS = 0;
1822
1823 mosm.dwStreamID = (DWORD_PTR)lpMidiStrm; // FIXME: not 64 bit safe
1824 /* FIXME: the correct value is not allocated yet for MAPPER */
1825 mosm.wDeviceID = *lpuDeviceID;
1826 lpwm = MIDI_OutAlloc(&hMidiOut, &dwCallback, &dwInstance, &fdwOpen, 1, &mosm);
1827 lpMidiStrm->hDevice = hMidiOut;
1828 *lphMidiStrm = (HMIDISTRM)hMidiOut;
1829
1830 lpwm->mld.uDeviceID = *lpuDeviceID;
1831
1832 ret = MMDRV_Open(&lpwm->mld, MODM_OPEN, (DWORD_PTR)&lpwm->mod, fdwOpen);
1833 lpMidiStrm->hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
1834 lpMidiStrm->wFlags = HIWORD(fdwOpen);
1835
1837 lpMidiStrm, 0, &(lpMidiStrm->dwThreadID));
1838
1839 if (!lpMidiStrm->hThread) {
1840 midiStreamClose((HMIDISTRM)hMidiOut);
1841 return MMSYSERR_NOMEM;
1842 }
1844
1845 /* wait for thread to have started, and for its queue to be created */
1846 {
1847 //DWORD count;
1848
1849 /* (Release|Restore)ThunkLock() is needed when this method is called from 16 bit code,
1850 * (meaning the Win16Lock is set), so that it's released and the 32 bit thread running
1851 * MMSYSTEM_MidiStreamPlayer can acquire Win16Lock to create its queue.
1852 */
1853 //ReleaseThunkLock(&count);
1854 WaitForSingleObject(lpMidiStrm->hEvent, INFINITE);
1855 //RestoreThunkLock(count);
1856 }
1857
1858 TRACE("=> (%u/%d) hMidi=%p ret=%d lpMidiStrm=%p\n",
1859 *lpuDeviceID, lpwm->mld.uDeviceID, *lphMidiStrm, ret, lpMidiStrm);
1860 return ret;
1861}
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
Definition: thread.c:700
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:137
#define INFINITE
Definition: serial.h:102
UINT MMRESULT
Definition: mmsystem.h:962
DWORD dwStreamID
Definition: mmddk.h:407
WORD wDeviceID
Definition: mmddk.h:408
HANDLE hThread
Definition: winmm.c:1455
DWORD dwThreadID
Definition: winmm.c:1456
DWORD dwTempo
Definition: winmm.c:1457
HMIDIOUT hDevice
Definition: winmm.c:1454
DWORD dwTimeDiv
Definition: winmm.c:1458
DWORD dwPositionMS
Definition: winmm.c:1459
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
#define DWORD_PTR
Definition: treelist.c:76
#define HIWORD(l)
Definition: typedefs.h:247
#define THREAD_PRIORITY_TIME_CRITICAL
Definition: winbase.h:281
static DWORD CALLBACK MMSYSTEM_MidiStream_Player(LPVOID pmt)
Definition: winmm.c:1632
MMRESULT WINAPI midiStreamClose(HMIDISTRM hMidiStrm)
Definition: winmm.c:1775

Referenced by test_midiStream().

◆ midiStreamOut()

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

Definition at line 1866 of file winmm.c.

1868{
1869 WINE_MIDIStream* lpMidiStrm;
1871
1872 TRACE("(%p, %p, %u)!\n", hMidiStrm, lpMidiHdr, cbMidiHdr);
1873
1874 if (cbMidiHdr < offsetof(MIDIHDR,dwOffset) || !lpMidiHdr || !lpMidiHdr->lpData
1875 || lpMidiHdr->dwBufferLength < lpMidiHdr->dwBytesRecorded
1876 || lpMidiHdr->dwBytesRecorded % 4 /* player expects DWORD padding */)
1877 return MMSYSERR_INVALPARAM;
1878 /* FIXME: Native additionally checks if the MIDIEVENTs in lpData
1879 * exactly fit dwBytesRecorded. */
1880
1881 if (!(lpMidiHdr->dwFlags & MHDR_PREPARED))
1882 return MIDIERR_UNPREPARED;
1883
1884 if (lpMidiHdr->dwFlags & MHDR_INQUEUE)
1885 return MIDIERR_STILLPLAYING;
1886
1887 if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) {
1889 } else {
1890 lpMidiHdr->dwFlags |= MHDR_ISSTRM;
1891 if (!PostThreadMessageA(lpMidiStrm->dwThreadID,
1892 WINE_MSM_HEADER, cbMidiHdr,
1893 (LPARAM)lpMidiHdr)) {
1894 WARN("bad PostThreadMessageA\n");
1896 }
1897 }
1898 return ret;
1899}
#define WARN(fmt,...)
Definition: precomp.h:61
#define MIDIERR_UNPREPARED
Definition: mmsystem.h:231
#define MHDR_INQUEUE
Definition: mmsystem.h:270
#define MIDIERR_STILLPLAYING
Definition: mmsystem.h:232
#define MHDR_ISSTRM
Definition: mmsystem.h:271
_In_ DWORD _In_ DWORD dwOffset
Definition: ntgdi.h:2033
#define offsetof(TYPE, MEMBER)
DWORD dwBufferLength
Definition: mmsystem.h:1152
DWORD dwBytesRecorded
Definition: mmsystem.h:1153
LPSTR lpData
Definition: mmsystem.h:1151
LONG_PTR LPARAM
Definition: windef.h:208
#define WINE_MSM_HEADER
Definition: winmm.c:1467
BOOL WINAPI PostThreadMessageA(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by playStream(), and test_midiStream().

◆ midiStreamPause()

MMRESULT WINAPI midiStreamPause ( HMIDISTRM  hMidiStrm)

Definition at line 1904 of file winmm.c.

1905{
1906 WINE_MIDIStream* lpMidiStrm;
1908
1909 TRACE("(%p)!\n", hMidiStrm);
1910
1911 if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) {
1913 } else {
1914 if (SuspendThread(lpMidiStrm->hThread) == 0xFFFFFFFF) {
1915 WARN("bad Suspend (%d)\n", GetLastError());
1917 }
1918 }
1919 return ret;
1920}
DWORD WINAPI SuspendThread(IN HANDLE hThread)
Definition: thread.c:642
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by test_midiStream().

◆ midiStreamPosition()

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

Definition at line 1925 of file winmm.c.

1926{
1927 WINE_MIDIStream* lpMidiStrm;
1929
1930 TRACE("(%p, %p, %u)!\n", hMidiStrm, lpMMT, cbmmt);
1931
1932 if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) {
1934 } else if (lpMMT == NULL || cbmmt != sizeof(MMTIME)) {
1936 } else {
1937 switch (lpMMT->wType) {
1938 case TIME_MS:
1939 lpMMT->u.ms = lpMidiStrm->dwPositionMS;
1940 TRACE("=> %d ms\n", lpMMT->u.ms);
1941 break;
1942 case TIME_TICKS:
1943 lpMMT->u.ticks = lpMidiStrm->dwPulses;
1944 TRACE("=> %d ticks\n", lpMMT->u.ticks);
1945 break;
1946 default:
1947 WARN("Unsupported time type %d\n", lpMMT->wType);
1948 lpMMT->wType = TIME_MS;
1950 break;
1951 }
1952 }
1953 return ret;
1954}
#define TIME_TICKS
Definition: mmsystem.h:33
#define TIME_MS
Definition: mmsystem.h:28
DWORD dwPulses
Definition: winmm.c:1460
union mmtime_tag::@3038 u
DWORD ms
Definition: mmsystem.h:967
UINT wType
Definition: mmsystem.h:965
DWORD ticks
Definition: mmsystem.h:970

Referenced by get_position(), and test_position().

◆ midiStreamProperty()

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

Definition at line 1959 of file winmm.c.

1960{
1961 WINE_MIDIStream* lpMidiStrm;
1963
1964 TRACE("(%p, %p, %x)\n", hMidiStrm, lpPropData, dwProperty);
1965
1966 if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) {
1968 } else if ((dwProperty & (MIDIPROP_GET|MIDIPROP_SET)) == 0) {
1970 } else if (dwProperty & MIDIPROP_TEMPO) {
1971 MIDIPROPTEMPO* mpt = (MIDIPROPTEMPO*)lpPropData;
1972
1973 if (sizeof(MIDIPROPTEMPO) != mpt->cbStruct) {
1975 } else if (dwProperty & MIDIPROP_SET) {
1976 lpMidiStrm->dwTempo = mpt->dwTempo;
1977 TRACE("Setting tempo to %d\n", mpt->dwTempo);
1978 } else if (dwProperty & MIDIPROP_GET) {
1979 mpt->dwTempo = lpMidiStrm->dwTempo;
1980 TRACE("Getting tempo <= %d\n", mpt->dwTempo);
1981 }
1982 } else if (dwProperty & MIDIPROP_TIMEDIV) {
1983 MIDIPROPTIMEDIV* mptd = (MIDIPROPTIMEDIV*)lpPropData;
1984
1985 if (sizeof(MIDIPROPTIMEDIV) != mptd->cbStruct) {
1987 } else if (dwProperty & MIDIPROP_SET) {
1988 lpMidiStrm->dwTimeDiv = mptd->dwTimeDiv;
1989 TRACE("Setting time div to %d\n", mptd->dwTimeDiv);
1990 } else if (dwProperty & MIDIPROP_GET) {
1991 mptd->dwTimeDiv = lpMidiStrm->dwTimeDiv;
1992 TRACE("Getting time div <= %d\n", mptd->dwTimeDiv);
1993 }
1994 } else {
1996 }
1997
1998 return ret;
1999}
#define MIDIPROP_TEMPO
Definition: mmsystem.h:287
#define MIDIPROP_TIMEDIV
Definition: mmsystem.h:286
#define MIDIPROP_GET
Definition: mmsystem.h:285
#define MIDIPROP_SET
Definition: mmsystem.h:284

Referenced by test_midiStream().

◆ midiStreamRestart()

MMRESULT WINAPI midiStreamRestart ( HMIDISTRM  hMidiStrm)

Definition at line 2004 of file winmm.c.

2005{
2006 WINE_MIDIStream* lpMidiStrm;
2008
2009 TRACE("(%p)!\n", hMidiStrm);
2010
2011 if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) {
2013 } else {
2014 DWORD ret;
2015
2016 /* since we increase the thread suspend count on each midiStreamPause
2017 * there may be a need for several midiStreamResume
2018 */
2019 do {
2020 ret = ResumeThread(lpMidiStrm->hThread);
2021 } while (ret != 0xFFFFFFFF && ret != 0);
2022 if (ret == 0xFFFFFFFF) {
2023 WARN("bad Resume (%d)\n", GetLastError());
2025 } else {
2026 lpMidiStrm->dwStartTicks = GetTickCount() - lpMidiStrm->dwPositionMS;
2027 }
2028 }
2029 return ret;
2030}
DWORD WINAPI ResumeThread(IN HANDLE hThread)
Definition: thread.c:567
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
DWORD dwStartTicks
Definition: winmm.c:1461

Referenced by midiStreamStop(), and test_midiStream().

◆ midiStreamStop()

MMRESULT WINAPI midiStreamStop ( HMIDISTRM  hMidiStrm)

Definition at line 2035 of file winmm.c.

2036{
2037 WINE_MIDIStream* lpMidiStrm;
2039
2040 TRACE("(%p)!\n", hMidiStrm);
2041
2042 if (!MMSYSTEM_GetMidiStream(hMidiStrm, &lpMidiStrm, NULL)) {
2044 } else {
2045 /* in case stream has been paused... FIXME is the current state correct ? */
2046 midiStreamRestart(hMidiStrm);
2048 }
2049 return ret;
2050}
MMRESULT WINAPI midiStreamRestart(HMIDISTRM hMidiStrm)
Definition: winmm.c:2004
#define WINE_MSM_STOP
Definition: winmm.c:1468

Referenced by midiStreamClose(), and test_midiStream().

◆ MIXER_GetDev()

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

Definition at line 226 of file winmm.c.

227{
228 LPWINE_MIXER lpwm = NULL;
229 UINT uRet = MMSYSERR_NOERROR;
230
231 switch (dwFlags & 0xF0000000ul) {
233 lpwm = (LPWINE_MIXER)MMDRV_Get(hmix, MMDRV_MIXER, TRUE);
234 break;
236 lpwm = (LPWINE_MIXER)MMDRV_Get(hmix, MMDRV_MIXER, FALSE);
237 break;
240 break;
243 break;
246 break;
249 break;
252 break;
255 break;
258 break;
261 break;
264 break;
265 default:
266 WARN("Unsupported flag (%08lx)\n", dwFlags & 0xF0000000ul);
267 lpwm = 0;
268 uRet = MMSYSERR_INVALFLAG;
269 break;
270 }
271 *lplpwm = lpwm;
272 if (lpwm == 0 && uRet == MMSYSERR_NOERROR)
273 uRet = MMSYSERR_INVALPARAM;
274 return uRet;
275}
LPWINE_MLD MMDRV_GetRelated(HANDLE hndl, UINT srcType, BOOL bSrcCanBeID, UINT dstType)
Definition: lolvldrv.c:285
#define MIXER_OBJECTF_MIDIOUT
Definition: mmsystem.h:306
#define MIXER_OBJECTF_MIXER
Definition: mmsystem.h:300
#define MIXER_OBJECTF_AUX
Definition: mmsystem.h:310
#define MIXER_OBJECTF_WAVEOUT
Definition: mmsystem.h:302
#define MIXER_OBJECTF_MIDIIN
Definition: mmsystem.h:308
#define MIXER_OBJECTF_HMIDIOUT
Definition: mmsystem.h:307
#define MIXER_OBJECTF_WAVEIN
Definition: mmsystem.h:304
#define MIXER_OBJECTF_HWAVEIN
Definition: mmsystem.h:305
#define MMSYSERR_INVALFLAG
Definition: mmsystem.h:106
#define MIXER_OBJECTF_HMIDIIN
Definition: mmsystem.h:309
#define MIXER_OBJECTF_HMIXER
Definition: mmsystem.h:301
#define MIXER_OBJECTF_HWAVEOUT
Definition: mmsystem.h:303
#define MMDRV_WAVEIN
Definition: winemm.h:80
struct WINE_MIXER * LPWINE_MIXER
#define MMDRV_WAVEOUT
Definition: winemm.h:81
#define MMDRV_MIXER
Definition: winemm.h:77

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 326 of file winmm.c.

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

Referenced by mixerOpen().

◆ mixerClose()

UINT WINAPI mixerClose ( HMIXER  hMix)

Definition at line 386 of file winmm.c.

387{
388 LPWINE_MLD wmld;
389 DWORD dwRet;
390
391 TRACE("(%p)\n", hMix);
392
393 if ((wmld = MMDRV_Get(hMix, MMDRV_MIXER, FALSE)) == NULL) return MMSYSERR_INVALHANDLE;
394
395 dwRet = MMDRV_Close(wmld, MXDM_CLOSE);
396 MMDRV_Free(hMix, wmld);
397
398 return dwRet;
399}
#define MXDM_CLOSE
Definition: mmddk.h:194

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

◆ mixerGetControlDetailsA()

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

Definition at line 444 of file winmm.c.

446{
448
449 TRACE("(%p, %p, %08x)\n", hmix, lpmcdA, fdwDetails);
450
451 if (lpmcdA == NULL || lpmcdA->cbStruct != sizeof(*lpmcdA))
452 return MMSYSERR_INVALPARAM;
453
454 switch (fdwDetails & MIXER_GETCONTROLDETAILSF_QUERYMASK) {
456 /* can safely use A structure as it is, no string inside */
457 ret = mixerGetControlDetailsW(hmix, lpmcdA, fdwDetails);
458 break;
460 {
461 MIXERCONTROLDETAILS_LISTTEXTA *pDetailsA = lpmcdA->paDetails;
463 int size = max(1, lpmcdA->cChannels) * sizeof(MIXERCONTROLDETAILS_LISTTEXTW);
464 unsigned int i;
465
466 if (lpmcdA->u.cMultipleItems != 0) {
467 size *= lpmcdA->u.cMultipleItems;
468 }
469 pDetailsW = HeapAlloc(GetProcessHeap(), 0, size);
470 lpmcdA->paDetails = pDetailsW;
472 /* set up lpmcd->paDetails */
473 ret = mixerGetControlDetailsW(hmix, lpmcdA, fdwDetails);
474 /* copy from lpmcd->paDetails back to paDetailsW; */
475 if (ret == MMSYSERR_NOERROR) {
476 for (i = 0; i < lpmcdA->u.cMultipleItems * lpmcdA->cChannels; i++) {
477 pDetailsA->dwParam1 = pDetailsW->dwParam1;
478 pDetailsA->dwParam2 = pDetailsW->dwParam2;
479 WideCharToMultiByte( CP_ACP, 0, pDetailsW->szName, -1,
480 pDetailsA->szName,
481 sizeof(pDetailsA->szName), NULL, NULL );
482 pDetailsA++;
483 pDetailsW++;
484 }
485 pDetailsA -= lpmcdA->u.cMultipleItems * lpmcdA->cChannels;
486 pDetailsW -= lpmcdA->u.cMultipleItems * lpmcdA->cChannels;
487 }
488 HeapFree(GetProcessHeap(), 0, pDetailsW);
489 lpmcdA->paDetails = pDetailsA;
491 }
492 break;
493 default:
494 ERR("Unsupported fdwDetails=0x%08x\n", fdwDetails);
495 }
496
497 return ret;
498}
#define ERR(fmt,...)
Definition: precomp.h:57
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
#define MIXER_GETCONTROLDETAILSF_VALUE
Definition: mmsystem.h:412
#define MIXER_GETCONTROLDETAILSF_QUERYMASK
Definition: mmsystem.h:414
#define MIXER_GETCONTROLDETAILSF_LISTTEXT
Definition: mmsystem.h:413
struct tagMIXERCONTROLDETAILS_LISTTEXTA MIXERCONTROLDETAILS_LISTTEXTA
struct tagMIXERCONTROLDETAILS_LISTTEXTW MIXERCONTROLDETAILS_LISTTEXTW
#define MMSYSERR_NOTENABLED
Definition: mmsystem.h:99
CHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1368
WCHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1374
#define max(a, b)
Definition: svc.c:63
UINT WINAPI mixerGetControlDetailsW(HMIXEROBJ hmix, LPMIXERCONTROLDETAILS lpmcdW, DWORD fdwDetails)
Definition: winmm.c:423

Referenced by mixer_test_controlA().

◆ mixerGetControlDetailsW()

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

Definition at line 423 of file winmm.c.

425{
426 LPWINE_MIXER lpwm;
427 UINT uRet = MMSYSERR_NOERROR;
428
429 TRACE("(%p, %p, %08x)\n", hmix, lpmcdW, fdwDetails);
430
431 if ((uRet = MIXER_GetDev(hmix, fdwDetails, &lpwm)) != MMSYSERR_NOERROR)
432 return uRet;
433
434 if (lpmcdW == NULL || lpmcdW->cbStruct != sizeof(*lpmcdW))
435 return MMSYSERR_INVALPARAM;
436
437 return MMDRV_Message(&lpwm->mld, MXDM_GETCONTROLDETAILS, (DWORD_PTR)lpmcdW,
438 fdwDetails);
439}
#define MXDM_GETCONTROLDETAILS
Definition: mmddk.h:197
WINE_MLD mld
Definition: winemm.h:114
static UINT MIXER_GetDev(HMIXEROBJ hmix, DWORD dwFlags, LPWINE_MIXER *lplpwm)
Definition: winmm.c:226

Referenced by GetMuteState(), GetVolumeValue(), mixer_test_controlW(), mixerGetControlDetailsA(), OnInitDialog(), OnMixerControlChange(), printMixerLine(), and Volume_IsMute().

◆ mixerGetDevCapsA()

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

Definition at line 288 of file winmm.c.

289{
290 MIXERCAPSW micW;
291 UINT ret;
292
293 if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
294
295 ret = mixerGetDevCapsW(uDeviceID, &micW, sizeof(micW));
296
297 if (ret == MMSYSERR_NOERROR) {
298 MIXERCAPSA micA;
299 micA.wMid = micW.wMid;
300 micA.wPid = micW.wPid;
301 micA.vDriverVersion = micW.vDriverVersion;
302 WideCharToMultiByte( CP_ACP, 0, micW.szPname, -1, micA.szPname,
303 sizeof(micA.szPname), NULL, NULL );
304 micA.fdwSupport = micW.fdwSupport;
305 micA.cDestinations = micW.cDestinations;
306 memcpy(lpCaps, &micA, min(uSize, sizeof(micA)));
307 }
308 return ret;
309}
DWORD cDestinations
Definition: mmsystem.h:1219
DWORD fdwSupport
Definition: mmsystem.h:1218
MMVERSION vDriverVersion
Definition: mmsystem.h:1216
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1217
DWORD cDestinations
Definition: mmsystem.h:1228
MMVERSION vDriverVersion
Definition: mmsystem.h:1225
DWORD fdwSupport
Definition: mmsystem.h:1227
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1226
UINT WINAPI mixerGetDevCapsW(UINT_PTR uDeviceID, LPMIXERCAPSW lpCaps, UINT uSize)
Definition: winmm.c:314

Referenced by mixer_test_deviceA(), and mixer_testsA().

◆ mixerGetDevCapsW()

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

Definition at line 314 of file winmm.c.

315{
316 LPWINE_MLD wmld;
317
318 if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
319
320 if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_MIXER, TRUE)) == NULL)
322
323 return MMDRV_Message(wmld, MXDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
324}
#define MXDM_GETDEVCAPS
Definition: mmddk.h:192
#define MMSYSERR_BADDEVICEID
Definition: mmsystem.h:98

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

◆ mixerGetID()

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

Definition at line 404 of file winmm.c.

405{
406 LPWINE_MIXER lpwm;
407 UINT uRet = MMSYSERR_NOERROR;
408
409 TRACE("(%p %p %08x)\n", hmix, lpid, fdwID);
410
411 if ((uRet = MIXER_GetDev(hmix, fdwID, &lpwm)) != MMSYSERR_NOERROR)
412 return uRet;
413
414 if (lpid)
415 *lpid = lpwm->mld.uDeviceID;
416
417 return uRet;
418}

Referenced by GetDevNum(), and Volume_FindMixerControl().

◆ mixerGetLineControlsA()

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

Definition at line 503 of file winmm.c.

505{
507 DWORD ret;
508 unsigned int i;
509
510 TRACE("(%p, %p, %08x)\n", hmix, lpmlcA, fdwControls);
511
512 if (lpmlcA == NULL || lpmlcA->cbStruct != sizeof(*lpmlcA) ||
513 lpmlcA->cbmxctrl != sizeof(MIXERCONTROLA))
514 return MMSYSERR_INVALPARAM;
515
516 mlcW.cbStruct = sizeof(mlcW);
517 mlcW.dwLineID = lpmlcA->dwLineID;
518 mlcW.u.dwControlID = lpmlcA->u.dwControlID;
519 mlcW.u.dwControlType = lpmlcA->u.dwControlType;
520
521 /* Debugging on Windows shows for MIXER_GETLINECONTROLSF_ONEBYTYPE only,
522 the control count is assumed to be 1 - This is relied upon by a game,
523 "Dynomite Deluze" */
525 mlcW.cControls = 1;
526 } else {
527 mlcW.cControls = lpmlcA->cControls;
528 }
529 mlcW.cbmxctrl = sizeof(MIXERCONTROLW);
531 mlcW.cControls * mlcW.cbmxctrl);
532
533 ret = mixerGetLineControlsW(hmix, &mlcW, fdwControls);
534
535 if (ret == MMSYSERR_NOERROR) {
536 lpmlcA->dwLineID = mlcW.dwLineID;
537 lpmlcA->u.dwControlID = mlcW.u.dwControlID;
538 lpmlcA->u.dwControlType = mlcW.u.dwControlType;
539
540 for (i = 0; i < mlcW.cControls; i++) {
541 lpmlcA->pamxctrl[i].cbStruct = sizeof(MIXERCONTROLA);
542 lpmlcA->pamxctrl[i].dwControlID = mlcW.pamxctrl[i].dwControlID;
544 lpmlcA->pamxctrl[i].fdwControl = mlcW.pamxctrl[i].fdwControl;
547 lpmlcA->pamxctrl[i].szShortName,
548 sizeof(lpmlcA->pamxctrl[i].szShortName), NULL, NULL );
550 lpmlcA->pamxctrl[i].szName,
551 sizeof(lpmlcA->pamxctrl[i].szName), NULL, NULL );
552 /* sizeof(lpmlcA->pamxctrl[i].Bounds) ==
553 * sizeof(mlcW.pamxctrl[i].Bounds) */
554 memcpy(&lpmlcA->pamxctrl[i].Bounds, &mlcW.pamxctrl[i].Bounds,
555 sizeof(mlcW.pamxctrl[i].Bounds));
556 /* sizeof(lpmlcA->pamxctrl[i].Metrics) ==
557 * sizeof(mlcW.pamxctrl[i].Metrics) */
558 memcpy(&lpmlcA->pamxctrl[i].Metrics, &mlcW.pamxctrl[i].Metrics,
559 sizeof(mlcW.pamxctrl[i].Metrics));
560 }
561 }
562
563 HeapFree(GetProcessHeap(), 0, mlcW.pamxctrl);
564
565 return ret;
566}
#define MIXER_GETLINECONTROLSF_QUERYMASK
Definition: mmsystem.h:411
struct tagMIXERCONTROLW MIXERCONTROLW
#define MIXER_GETLINECONTROLSF_ONEBYTYPE
Definition: mmsystem.h:410
struct tagMIXERCONTROLA MIXERCONTROLA
union tagMIXERCONTROLA::@3044 Metrics
CHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1284
union tagMIXERCONTROLA::@3043 Bounds
CHAR szShortName[MIXER_SHORT_NAME_CHARS]
Definition: mmsystem.h:1283
DWORD dwControlType
Definition: mmsystem.h:1280
DWORD cMultipleItems
Definition: mmsystem.h:1282
WCHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1310
DWORD dwControlType
Definition: mmsystem.h:1306
DWORD cMultipleItems
Definition: mmsystem.h:1308
union tagMIXERCONTROLW::@3048 Metrics
union tagMIXERCONTROLW::@3047 Bounds
WCHAR szShortName[MIXER_SHORT_NAME_CHARS]
Definition: mmsystem.h:1309
LPMIXERCONTROLA pamxctrl
Definition: mmsystem.h:1338
LPMIXERCONTROLW pamxctrl
Definition: mmsystem.h:1350
UINT WINAPI mixerGetLineControlsW(HMIXEROBJ hmix, LPMIXERLINECONTROLSW lpmlcW, DWORD fdwControls)
Definition: winmm.c:571

Referenced by mixer_test_deviceA().

◆ mixerGetLineControlsW()

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

Definition at line 571 of file winmm.c.

573{
574 LPWINE_MIXER lpwm;
575 UINT uRet = MMSYSERR_NOERROR;
576
577 TRACE("(%p, %p, %08x)\n", hmix, lpmlcW, fdwControls);
578
579 if ((uRet = MIXER_GetDev(hmix, fdwControls, &lpwm)) != MMSYSERR_NOERROR)
580 return uRet;
581
582 if (lpmlcW == NULL || lpmlcW->cbStruct != sizeof(*lpmlcW))
583 return MMSYSERR_INVALPARAM;
584
585 return MMDRV_Message(&lpwm->mld, MXDM_GETLINECONTROLS, (DWORD_PTR)lpmlcW,
586 fdwControls);
587}
#define MXDM_GETLINECONTROLS
Definition: mmddk.h:196

Referenced by GetMuteControl(), GetVolumeControl(), mixer_test_deviceW(), mixerGetLineControlsA(), OnInitDialog(), printMixerLine(), and Volume_FindMixerControl().

◆ mixerGetLineInfoA()

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

Definition at line 612 of file winmm.c.

614{
615 MIXERLINEW mliW;
616 UINT ret;
617
618 TRACE("(%p, %p, %08x)\n", hmix, lpmliA, fdwInfo);
619
620 if (lpmliA == NULL || lpmliA->cbStruct != sizeof(*lpmliA))
621 return MMSYSERR_INVALPARAM;
622
623 mliW.cbStruct = sizeof(mliW);
624 switch (fdwInfo & MIXER_GETLINEINFOF_QUERYMASK) {
626 mliW.dwComponentType = lpmliA->dwComponentType;
627 break;
629 mliW.dwDestination = lpmliA->dwDestination;
630 break;
632 mliW.dwLineID = lpmliA->dwLineID;
633 break;
635 mliW.dwDestination = lpmliA->dwDestination;
636 mliW.dwSource = lpmliA->dwSource;
637 break;
639 mliW.Target.dwType = lpmliA->Target.dwType;
640 mliW.Target.wMid = lpmliA->Target.wMid;
641 mliW.Target.wPid = lpmliA->Target.wPid;
642 mliW.Target.vDriverVersion = lpmliA->Target.vDriverVersion;
643 MultiByteToWideChar( CP_ACP, 0, lpmliA->Target.szPname, -1, mliW.Target.szPname, sizeof(mliW.Target.szPname)/sizeof(WCHAR));
644 break;
645 default:
646 WARN("Unsupported fdwControls=0x%08x\n", fdwInfo);
647 return MMSYSERR_INVALFLAG;
648 }
649
650 ret = mixerGetLineInfoW(hmix, &mliW, fdwInfo);
651
652 if(ret == MMSYSERR_NOERROR)
653 {
654 lpmliA->dwDestination = mliW.dwDestination;
655 lpmliA->dwSource = mliW.dwSource;
656 lpmliA->dwLineID = mliW.dwLineID;
657 lpmliA->fdwLine = mliW.fdwLine;
658 lpmliA->dwUser = mliW.dwUser;
659 lpmliA->dwComponentType = mliW.dwComponentType;
660 lpmliA->cChannels = mliW.cChannels;
661 lpmliA->cConnections = mliW.cConnections;
662 lpmliA->cControls = mliW.cControls;
663 WideCharToMultiByte( CP_ACP, 0, mliW.szShortName, -1, lpmliA->szShortName,
664 sizeof(lpmliA->szShortName), NULL, NULL);
665 WideCharToMultiByte( CP_ACP, 0, mliW.szName, -1, lpmliA->szName,
666 sizeof(lpmliA->szName), NULL, NULL );
667 lpmliA->Target.dwType = mliW.Target.dwType;
668 lpmliA->Target.dwDeviceID = mliW.Target.dwDeviceID;
669 lpmliA->Target.wMid = mliW.Target.wMid;
670 lpmliA->Target.wPid = mliW.Target.wPid;
671 lpmliA->Target.vDriverVersion = mliW.Target.vDriverVersion;
672 WideCharToMultiByte( CP_ACP, 0, mliW.Target.szPname, -1, lpmliA->Target.szPname,
673 sizeof(lpmliA->Target.szPname), NULL, NULL );
674 }
675 return ret;
676}
#define MultiByteToWideChar
Definition: compat.h:110
#define MIXER_GETLINEINFOF_LINEID
Definition: mmsystem.h:346
#define MIXER_GETLINEINFOF_TARGETTYPE
Definition: mmsystem.h:348
#define MIXER_GETLINEINFOF_DESTINATION
Definition: mmsystem.h:344
#define MIXER_GETLINEINFOF_COMPONENTTYPE
Definition: mmsystem.h:347
#define MIXER_GETLINEINFOF_SOURCE
Definition: mmsystem.h:345
#define MIXER_GETLINEINFOF_QUERYMASK
Definition: mmsystem.h:349
DWORD dwDestination
Definition: mmsystem.h:1233
CHAR szShortName[MIXER_SHORT_NAME_CHARS]
Definition: mmsystem.h:1242
DWORD dwComponentType
Definition: mmsystem.h:1238
DWORD cControls
Definition: mmsystem.h:1241
DWORD fdwLine
Definition: mmsystem.h:1236
struct tagMIXERLINEA::@3041 Target
DWORD dwLineID
Definition: mmsystem.h:1235
CHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1243
DWORD dwSource
Definition: mmsystem.h:1234
DWORD_PTR dwUser
Definition: mmsystem.h:1237
DWORD cConnections
Definition: mmsystem.h:1240
DWORD cbStruct
Definition: mmsystem.h:1232
DWORD cChannels
Definition: mmsystem.h:1239
DWORD fdwLine
Definition: mmsystem.h:1259
struct tagMIXERLINEW::@3042 Target
DWORD dwDestination
Definition: mmsystem.h:1256
DWORD cControls
Definition: mmsystem.h:1264
DWORD dwSource
Definition: mmsystem.h:1257
DWORD dwLineID
Definition: mmsystem.h:1258
WCHAR szName[MIXER_LONG_NAME_CHARS]
Definition: mmsystem.h:1266
DWORD cChannels
Definition: mmsystem.h:1262
DWORD cConnections
Definition: mmsystem.h:1263
DWORD_PTR dwUser
Definition: mmsystem.h:1260
DWORD cbStruct
Definition: mmsystem.h:1255
DWORD dwComponentType
Definition: mmsystem.h:1261
WCHAR szShortName[MIXER_SHORT_NAME_CHARS]
Definition: mmsystem.h:1265
UINT WINAPI mixerGetLineInfoW(HMIXEROBJ hmix, LPMIXERLINEW lpmliW, DWORD fdwInfo)
Definition: winmm.c:592

Referenced by mixer_test_deviceA().

◆ mixerGetLineInfoW()

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

Definition at line 592 of file winmm.c.

593{
594 LPWINE_MIXER lpwm;
595 UINT uRet = MMSYSERR_NOERROR;
596
597 TRACE("(%p, %p, %08x)\n", hmix, lpmliW, fdwInfo);
598
599 if (lpmliW == NULL || lpmliW->cbStruct != sizeof(*lpmliW))
600 return MMSYSERR_INVALPARAM;
601
602 if ((uRet = MIXER_GetDev(hmix, fdwInfo, &lpwm)) != MMSYSERR_NOERROR)
603 return uRet;
604
605 return MMDRV_Message(&lpwm->mld, MXDM_GETLINEINFO, (DWORD_PTR)lpmliW,
606 fdwInfo);
607}
#define MXDM_GETLINEINFO
Definition: mmddk.h:195

Referenced by GetMuteControl(), GetVolumeControl(), main(), mixer_test_deviceW(), mixerGetLineInfoA(), OnInitDialog(), and Volume_FindMixerControl().

◆ mixerGetNumDevs()

UINT WINAPI mixerGetNumDevs ( void  )

◆ mixerMessage()

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

Definition at line 699 of file winmm.c.

700{
701 LPWINE_MLD wmld;
702
703 TRACE("(%p, %d, %08lx, %08lx): semi-stub?\n",
704 hmix, uMsg, dwParam1, dwParam2);
705
706 if ((wmld = MMDRV_Get(hmix, MMDRV_MIXER, FALSE)) == NULL)
708
709 return MMDRV_Message(wmld, uMsg, dwParam1, dwParam2);
710}

◆ mixerOpen()

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

Definition at line 339 of file winmm.c.

341{
342 HANDLE hMix;
343 LPWINE_MLD wmld;
344 DWORD dwRet;
346
347 TRACE("(%p, %d, %08lx, %08lx, %08x)\n",
348 lphMix, uDeviceID, dwCallback, dwInstance, fdwOpen);
349
350 dwRet = WINMM_CheckCallback(dwCallback, fdwOpen, TRUE);
351 if(dwRet != MMSYSERR_NOERROR)
352 return dwRet;
353
354 mod.dwCallback = (DWORD_PTR)MIXER_WCallback;
355 if ((fdwOpen & CALLBACK_TYPEMASK) == CALLBACK_WINDOW)
356 mod.dwInstance = dwCallback;
357 else
358 mod.dwInstance = 0;
359
360 /* We're remapping to CALLBACK_FUNCTION because that's what old winmm is
361 * documented to do when opening the mixer driver.
362 * FIXME: Native supports CALLBACK_EVENT + CALLBACK_THREAD flags since w2k.
363 * FIXME: The non ALSA drivers ignore callback requests - bug.
364 */
365
366 wmld = MMDRV_Alloc(sizeof(WINE_MIXER), MMDRV_MIXER, &hMix, &fdwOpen,
367 &dwCallback, &dwInstance);
368 wmld->uDeviceID = uDeviceID;
369 mod.hmx = hMix;
370
372
373 if (dwRet != MMSYSERR_NOERROR) {
374 MMDRV_Free(hMix, wmld);
375 hMix = 0;
376 }
377 if (lphMix) *lphMix = hMix;
378 TRACE("=> %d hMixer=%p\n", dwRet, hMix);
379
380 return dwRet;
381}
#define MXDM_OPEN
Definition: mmddk.h:193
static int mod
Definition: i386-dis.c:1288
#define CALLBACK_WINDOW
Definition: mmsystem.h:148
#define CALLBACK_TYPEMASK
Definition: mmsystem.h:146
#define CALLBACK_FUNCTION
Definition: mmsystem.h:150
static void CALLBACK MIXER_WCallback(HMIXEROBJ hmx, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam, DWORD_PTR param2)
Definition: winmm.c:326

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 681 of file winmm.c.

683{
684 LPWINE_MIXER lpwm;
685 UINT uRet = MMSYSERR_NOERROR;
686
687 TRACE("(%p, %p, %08x)\n", hmix, lpmcd, fdwDetails);
688
689 if ((uRet = MIXER_GetDev(hmix, fdwDetails, &lpwm)) != MMSYSERR_NOERROR)
690 return uRet;
691
692 return MMDRV_Message(&lpwm->mld, MXDM_SETCONTROLDETAILS, (DWORD_PTR)lpmcd,
693 fdwDetails);
694}
#define MXDM_SETCONTROLDETAILS
Definition: mmddk.h:198

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 2912 of file winmm.c.

2913{
2914 return GetCurrentThreadId();
2915}
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459

Referenced by START_TEST().

◆ MMSYSTEM_GetMidiStream()

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

Definition at line 1473 of file winmm.c.

1474{
1475 WINE_MIDI* lpwm = (LPWINE_MIDI)MMDRV_Get(hMidiStrm, MMDRV_MIDIOUT, FALSE);
1476
1477 if (lplpwm)
1478 *lplpwm = lpwm;
1479
1480 if (lpwm == NULL) {
1481 return FALSE;
1482 }
1483
1484 *lpMidiStrm = (WINE_MIDIStream*)(ULONG_PTR)lpwm->mod.rgIds.dwStreamID; // FIXME: not 64 bit safe
1485
1486 return *lpMidiStrm != NULL;
1487}
uint32_t ULONG_PTR
Definition: typedefs.h:65

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 1492 of file winmm.c.

1493{
1494 DWORD ret = 0;
1495
1496 if (lpMidiStrm->dwTimeDiv == 0) {
1497 FIXME("Shouldn't happen. lpMidiStrm->dwTimeDiv = 0\n");
1498 } else if (lpMidiStrm->dwTimeDiv > 0x8000) { /* SMPTE, unchecked FIXME? */
1499 int nf = -(char)HIBYTE(lpMidiStrm->dwTimeDiv); /* number of frames */
1500 int nsf = LOBYTE(lpMidiStrm->dwTimeDiv); /* number of sub-frames */
1501 ret = (pulse * 1000) / (nf * nsf);
1502 } else {
1503 ret = (DWORD)((double)pulse * ((double)lpMidiStrm->dwTempo / 1000) /
1504 (double)lpMidiStrm->dwTimeDiv);
1505 }
1506
1507 return ret;
1508}
unsigned char
Definition: typeof.h:29
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
#define DWORD
Definition: nt_native.h:44

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 1513 of file winmm.c.

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

Referenced by MMSYSTEM_MidiStream_Player().

◆ MMSYSTEM_MidiStream_Player()

static DWORD CALLBACK MMSYSTEM_MidiStream_Player ( LPVOID  pmt)
static

Definition at line 1632 of file winmm.c.

1633{
1634 WINE_MIDIStream* lpMidiStrm = pmt;
1635 WINE_MIDI* lpwm;
1636 MSG msg;
1637 DWORD dwToGo;
1638 DWORD dwCurrTC;
1639 LPMIDIHDR lpMidiHdr;
1640 LPMIDIEVENT me;
1641 LPBYTE lpData = 0;
1642
1643 TRACE("(%p)!\n", lpMidiStrm);
1644
1645 if (!lpMidiStrm ||
1646 (lpwm = (LPWINE_MIDI)MMDRV_Get(lpMidiStrm->hDevice, MMDRV_MIDIOUT, FALSE)) == NULL)
1647 goto the_end;
1648
1649 /* force thread's queue creation */
1650 /* Used to be InitThreadInput16(0, 5); */
1651 /* but following works also with hack in midiStreamOpen */
1652 PeekMessageA(&msg, 0, 0, 0, 0);
1653
1654 /* FIXME: this next line must be called before midiStreamOut or midiStreamRestart are called */
1655 SetEvent(lpMidiStrm->hEvent);
1656 TRACE("Ready to go 1\n");
1657 /* thread is started in paused mode */
1658 SuspendThread(lpMidiStrm->hThread);
1659 TRACE("Ready to go 2\n");
1660
1661 lpMidiStrm->dwStartTicks = 0;
1662 lpMidiStrm->dwPulses = 0;
1663
1664 lpMidiStrm->lpMidiHdr = 0;
1665
1666 for (;;) {
1667 lpMidiHdr = lpMidiStrm->lpMidiHdr;
1668 if (!lpMidiHdr) {
1669 /* for first message, block until one arrives, then process all that are available */
1670 GetMessageA(&msg, 0, 0, 0);
1671 do {
1672 if (!MMSYSTEM_MidiStream_MessageHandler(lpMidiStrm, lpwm, &msg))
1673 goto the_end;
1674 } while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE));
1675 lpData = 0;
1676 continue;
1677 }
1678
1679 if (!lpData)
1680 lpData = (LPBYTE)lpMidiHdr->lpData;
1681
1682 me = (LPMIDIEVENT)(lpData + lpMidiHdr->dwOffset);
1683
1684 /* do we have to wait ? */
1685 if (me->dwDeltaTime) {
1686 lpMidiStrm->dwPositionMS += MMSYSTEM_MidiStream_Convert(lpMidiStrm, me->dwDeltaTime);
1687 lpMidiStrm->dwPulses += me->dwDeltaTime;
1688
1689 dwToGo = lpMidiStrm->dwStartTicks + lpMidiStrm->dwPositionMS;
1690
1691 TRACE("%d/%d/%d\n", dwToGo, GetTickCount(), me->dwDeltaTime);
1692 while ((dwCurrTC = GetTickCount()) < dwToGo) {
1693 if (MsgWaitForMultipleObjects(0, NULL, FALSE, dwToGo - dwCurrTC, QS_ALLINPUT) == WAIT_OBJECT_0) {
1694 /* got a message, handle it */
1695 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) {
1696 if (!MMSYSTEM_MidiStream_MessageHandler(lpMidiStrm, lpwm, &msg))
1697 goto the_end;
1698 }
1699 lpData = 0;
1700 } else {
1701 /* timeout, so me->dwDeltaTime is elapsed, can break the while loop */
1702 break;
1703 }
1704 }
1705 }
1706 switch (MEVT_EVENTTYPE(me->dwEvent & ~MEVT_F_CALLBACK)) {
1707 case MEVT_COMMENT:
1708 FIXME("NIY: MEVT_COMMENT\n");
1709 /* do nothing, skip bytes */
1710 break;
1711 case MEVT_LONGMSG:
1712 FIXME("NIY: MEVT_LONGMSG, aka sending Sysex event\n");
1713 break;
1714 case MEVT_NOP:
1715 break;
1716 case MEVT_SHORTMSG:
1717 midiOutShortMsg(lpMidiStrm->hDevice, MEVT_EVENTPARM(me->dwEvent));
1718 break;
1719 case MEVT_TEMPO:
1720 lpMidiStrm->dwTempo = MEVT_EVENTPARM(me->dwEvent);
1721 break;
1722 case MEVT_VERSION:
1723 break;
1724 default:
1725 FIXME("Unknown MEVT (0x%02x)\n", MEVT_EVENTTYPE(me->dwEvent & ~MEVT_F_CALLBACK));
1726 break;
1727 }
1728 if (me->dwEvent & MEVT_F_CALLBACK) {
1729 DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
1730 (HDRVR)lpMidiStrm->hDevice, MM_MOM_POSITIONCB,
1731 lpwm->mod.dwInstance, (LPARAM)lpMidiHdr, 0L);
1732 }
1733 lpMidiHdr->dwOffset += sizeof(MIDIEVENT) - sizeof(me->dwParms);
1734 if (me->dwEvent & MEVT_F_LONG)
1735 lpMidiHdr->dwOffset += (MEVT_EVENTPARM(me->dwEvent) + 3) & ~3;
1736 if (lpMidiHdr->dwOffset >= lpMidiHdr->dwBufferLength) {
1737 /* done with this header */
1738 lpMidiHdr->dwFlags |= MHDR_DONE;
1739 lpMidiHdr->dwFlags &= ~MHDR_INQUEUE;
1740
1741 lpMidiStrm->lpMidiHdr = lpMidiHdr->lpNext;
1742 DriverCallback(lpwm->mod.dwCallback, lpMidiStrm->wFlags,
1743 (HDRVR)lpMidiStrm->hDevice, MM_MOM_DONE,
1744 lpwm->mod.dwInstance, (DWORD_PTR)lpMidiHdr, 0);
1745 lpData = 0;
1746 }
1747 }
1748the_end:
1749 TRACE("End of thread\n");
1750 ExitThread(0);
1751 return 0; /* for removing the warning, never executed */
1752}
VOID WINAPI ExitThread(IN DWORD uExitCode)
Definition: thread.c:365
struct midievent_tag MIDIEVENT
#define MEVT_EVENTPARM(x)
Definition: mmsystem.h:276
#define MEVT_COMMENT
Definition: mmsystem.h:281
#define MEVT_F_LONG
Definition: mmsystem.h:273
#define MEVT_F_CALLBACK
Definition: mmsystem.h:274
#define MEVT_SHORTMSG
Definition: mmsystem.h:277
#define MEVT_TEMPO
Definition: mmsystem.h:278
#define MM_MOM_POSITIONCB
Definition: mmsystem.h:79
#define MEVT_EVENTTYPE(x)
Definition: mmsystem.h:275
#define MEVT_LONGMSG
Definition: mmsystem.h:280
#define MEVT_NOP
Definition: mmsystem.h:279
#define MEVT_VERSION
Definition: mmsystem.h:282
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define WAIT_OBJECT_0
Definition: winbase.h:406
static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream *lpMidiStrm, LPWINE_MIDI lpwm, LPMSG msg)
Definition: winmm.c:1513
UINT WINAPI midiOutShortMsg(HMIDIOUT hMidiOut, DWORD dwMsg)
Definition: winmm.c:1039
static DWORD MMSYSTEM_MidiStream_Convert(WINE_MIDIStream *lpMidiStrm, DWORD pulse)
Definition: winmm.c:1492
#define QS_ALLINPUT
Definition: winuser.h:903
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
#define PM_REMOVE
Definition: winuser.h:1196
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)

Referenced by midiStreamOpen().

◆ MMSYSTEM_MidiStream_PostMessage()

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

Definition at line 1757 of file winmm.c.

1758{
1759 if (PostThreadMessageA(lpMidiStrm->dwThreadID, msg, pmt1, pmt2)) {
1760 //DWORD count;
1761
1762 //ReleaseThunkLock(&count);
1763 WaitForSingleObject(lpMidiStrm->hEvent, INFINITE);
1764 //RestoreThunkLock(count);
1765 } else {
1766 WARN("bad PostThreadMessageA\n");
1767 return FALSE;
1768 }
1769 return TRUE;
1770}

Referenced by midiStreamClose(), and midiStreamStop().

◆ mmTaskBlock()

VOID WINAPI mmTaskBlock ( DWORD  tid)

Definition at line 2885 of file winmm.c.

2886{
2887 MSG msg;
2888
2889 do
2890 {
2891 GetMessageA(&msg, 0, 0, 0);
2892 if (msg.hwnd) DispatchMessageA(&msg);
2893 } while (msg.message != WM_USER);
2894}
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define WM_USER
Definition: winuser.h:1895

◆ mmTaskCreate()

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

Definition at line 2856 of file winmm.c.

2857{
2859 HANDLE hEvent = 0;
2860 struct mm_starter *mms;
2861
2862 mms = HeapAlloc(GetProcessHeap(), 0, sizeof(struct mm_starter));
2863 if (mms == NULL) return TASKERR_OUTOFMEMORY;
2864
2865 mms->cb = cb;
2866 mms->client = client;
2867 if (ph) hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
2868 mms->event = hEvent;
2869
2870 hThread = CreateThread(0, 0, mmTaskRun, mms, 0, NULL);
2871 if (!hThread) {
2872 HeapFree(GetProcessHeap(), 0, mms);
2874 return TASKERR_OUTOFMEMORY;
2875 }
2877 if (ph) *ph = hEvent;
2879 return 0;
2880}
static HANDLE hEvent
Definition: comm.c:54
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
HANDLE hThread
Definition: wizard.c:28
#define TASKERR_OUTOFMEMORY
Definition: mmddk.h:474
static FILE * client
Definition: client.c:41
DWORD client
Definition: winmm.c:2838
LPTASKCALLBACK cb
Definition: winmm.c:2837
HANDLE event
Definition: winmm.c:2839
static DWORD WINAPI mmTaskRun(void *pmt)
Definition: winmm.c:2842

◆ mmTaskRun()

static DWORD WINAPI mmTaskRun ( void pmt)
static

Definition at line 2842 of file winmm.c.

2843{
2844 struct mm_starter mms;
2845
2846 memcpy(&mms, pmt, sizeof(struct mm_starter));
2847 HeapFree(GetProcessHeap(), 0, pmt);
2848 mms.cb(mms.client);
2849 if (mms.event) SetEvent(mms.event);
2850 return 0;
2851}

Referenced by mmTaskCreate().

◆ mmTaskSignal()

BOOL WINAPI mmTaskSignal ( DWORD  tid)

Definition at line 2899 of file winmm.c.

2900{
2901 return PostThreadMessageW(tid, WM_USER, 0, 0);
2902}
static TfClientId tid
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ mmTaskYield()

VOID WINAPI mmTaskYield ( VOID  )

Definition at line 2907 of file winmm.c.

2907{}

◆ 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 2052 of file winmm.c.

2055{
2056 HANDLE handle;
2057 LPWINE_MLD wmld;
2058 DWORD dwRet;
2059 WAVEOPENDESC wod;
2060
2061 TRACE("(%p, %d, %s, %p, %08lX, %08lX, %08X);\n",
2062 lphndl, (int)uDeviceID, (uType==MMDRV_WAVEOUT)?"Out":"In", lpFormat, dwCallback,
2063 dwInstance, dwFlags);
2064
2066 TRACE("WAVE_FORMAT_QUERY requested !\n");
2067
2068 dwRet = WINMM_CheckCallback(dwCallback, dwFlags, FALSE);
2069 if (dwRet != MMSYSERR_NOERROR)
2070 return dwRet;
2071
2072 if (lpFormat == NULL) {
2073 WARN("bad format\n");
2074 return WAVERR_BADFORMAT;
2075 }
2076
2077 if ((dwFlags & WAVE_MAPPED) && (uDeviceID == (UINT)-1)) {
2078 WARN("invalid parameter\n");
2079 return MMSYSERR_INVALPARAM;
2080 }
2081
2082 /* may have a PCMWAVEFORMAT rather than a WAVEFORMATEX so don't read cbSize */
2083 TRACE("wFormatTag=%u, nChannels=%u, nSamplesPerSec=%u, nAvgBytesPerSec=%u, nBlockAlign=%u, wBitsPerSample=%u\n",
2084 lpFormat->wFormatTag, lpFormat->nChannels, lpFormat->nSamplesPerSec,
2085 lpFormat->nAvgBytesPerSec, lpFormat->nBlockAlign, lpFormat->wBitsPerSample);
2086
2087 if ((wmld = MMDRV_Alloc(sizeof(WINE_WAVE), uType, &handle,
2088 &dwFlags, &dwCallback, &dwInstance)) == NULL) {
2089 return MMSYSERR_NOMEM;
2090 }
2091
2092 wod.hWave = handle;
2093 wod.lpFormat = (LPWAVEFORMATEX)lpFormat; /* should the struct be copied iso pointer? */
2094 wod.dwCallback = dwCallback;
2095 wod.dwInstance = dwInstance;
2096 wod.dnDevNode = 0L;
2097
2098 TRACE("cb=%08lx\n", wod.dwCallback);
2099
2100 for (;;) {
2101 if (dwFlags & WAVE_MAPPED) {
2102 wod.uMappedDeviceID = uDeviceID;
2103 uDeviceID = WAVE_MAPPER;
2104 } else {
2105 wod.uMappedDeviceID = -1;
2106 }
2107 wmld->uDeviceID = uDeviceID;
2108
2109 dwRet = MMDRV_Open(wmld, (uType == MMDRV_WAVEOUT) ? WODM_OPEN : WIDM_OPEN,
2110 (DWORD_PTR)&wod, dwFlags);
2111
2112 TRACE("dwRet = %s\n", WINMM_ErrorToString(dwRet));
2113 if (dwRet != WAVERR_BADFORMAT ||
2114 ((dwFlags & (WAVE_MAPPED|WAVE_FORMAT_DIRECT)) != 0) || (uDeviceID == WAVE_MAPPER)) break;
2115 /* if we ask for a format which isn't supported by the physical driver,
2116 * let's try to map it through the wave mapper (except, if we already tried
2117 * or user didn't allow us to use acm codecs or the device is already the mapper)
2118 */
2120 /* we shall loop only one */
2121 }
2122
2123 if ((dwFlags & WAVE_FORMAT_QUERY) || dwRet != MMSYSERR_NOERROR) {
2124 MMDRV_Free(handle, wmld);
2125 handle = 0;
2126 }
2127
2128 if (lphndl != NULL) *lphndl = handle;
2129 TRACE("=> %s hWave=%p\n", WINMM_ErrorToString(dwRet), handle);
2130
2131 return dwRet;
2132}
#define WODM_OPEN
Definition: mmddk.h:110
#define WIDM_OPEN
Definition: mmddk.h:138
struct _WAVEFORMATEX * LPWAVEFORMATEX
#define WAVE_FORMAT_QUERY
Definition: mmsystem.h:188
#define WAVE_MAPPER
Definition: mmsystem.h:187
#define WAVERR_BADFORMAT
Definition: mmsystem.h:176
#define WAVE_MAPPED
Definition: mmsystem.h:190
#define WAVE_FORMAT_DIRECT
Definition: mmsystem.h:191
LPWAVEFORMATEX lpFormat
Definition: mmddk.h:399
DWORD dnDevNode
Definition: mmddk.h:403
HWAVE hWave
Definition: mmddk.h:398
DWORD dwInstance
Definition: mmddk.h:401
DWORD dwCallback
Definition: mmddk.h:400
UINT uMappedDeviceID
Definition: mmddk.h:402
LPCWSTR lpFormat
Definition: trayclock.cpp:32
const char * WINMM_ErrorToString(MMRESULT error)
Definition: winmm.c:110

Referenced by waveInOpen(), and waveOutOpen().

◆ waveInAddBuffer()

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

Definition at line 2717 of file winmm.c.

2719{
2720 LPWINE_MLD wmld;
2721
2722 TRACE("(%p, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize);
2723
2724 if (lpWaveInHdr == NULL) return MMSYSERR_INVALPARAM;
2725 if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
2726 return MMSYSERR_INVALHANDLE;
2727
2728 return MMDRV_Message(wmld, WIDM_ADDBUFFER, (DWORD_PTR)lpWaveInHdr, uSize);
2729}
#define WIDM_ADDBUFFER
Definition: mmddk.h:142

Referenced by audio_wavein::add_buffers_to_driver_(), DSOUND_capture_callback(), IDirectSoundCaptureBufferImpl_Start(), audio_wavein::recording_procedure(), wave_in_test_deviceIn(), WAVE_mciRecord(), WAVE_mciRecordCallback(), and widAddBuffer().

◆ waveInClose()

UINT WINAPI waveInClose ( HWAVEIN  hWaveIn)

Definition at line 2634 of file winmm.c.

2635{
2636 LPWINE_MLD wmld;
2637 DWORD dwRet;
2638
2639 TRACE("(%p)\n", hWaveIn);
2640
2641 if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
2642 return MMSYSERR_INVALHANDLE;
2643
2644 dwRet = MMDRV_Message(wmld, WIDM_CLOSE, 0L, 0L);
2645 if (dwRet != WAVERR_STILLPLAYING)
2646 MMDRV_Free(hWaveIn, wmld);
2647 return dwRet;
2648}
#define WIDM_CLOSE
Definition: mmddk.h:139
#define WAVERR_STILLPLAYING
Definition: mmsystem.h:177

Referenced by audio_wavein::close(), IDirectSoundCaptureBufferImpl_Release(), IDirectSoundCaptureBufferImpl_Start(), wave_in_test_device(), wave_in_test_deviceIn(), WAVE_mciRecord(), and widClose().

◆ waveInGetDevCapsA()

UINT WINAPI waveInGetDevCapsA ( UINT_PTR  uDeviceID,
LPWAVEINCAPSA  lpCaps,
UINT  uSize 
)

Definition at line 2597 of file winmm.c.

2598{
2599 WAVEINCAPSW wicW;
2600 UINT ret;
2601
2602 if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
2603
2604 ret = waveInGetDevCapsW(uDeviceID, &wicW, sizeof(wicW));
2605
2606 if (ret == MMSYSERR_NOERROR) {
2607 WAVEINCAPSA wicA;
2608 wicA.wMid = wicW.wMid;
2609 wicA.wPid = wicW.wPid;
2610 wicA.vDriverVersion = wicW.vDriverVersion;
2611 WideCharToMultiByte( CP_ACP, 0, wicW.szPname, -1, wicA.szPname,
2612 sizeof(wicA.szPname), NULL, NULL );
2613 wicA.dwFormats = wicW.dwFormats;
2614 wicA.wChannels = wicW.wChannels;
2615 memcpy(lpCaps, &wicA, min(uSize, sizeof(wicA)));
2616 }
2617 return ret;
2618}
MMVERSION vDriverVersion
Definition: mmsystem.h:1049
DWORD dwFormats
Definition: mmsystem.h:1051
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1050
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1060
MMVERSION vDriverVersion
Definition: mmsystem.h:1059
DWORD dwFormats
Definition: mmsystem.h:1061
UINT WINAPI waveInGetDevCapsW(UINT_PTR uDeviceID, LPWAVEINCAPSW lpCaps, UINT uSize)
Definition: winmm.c:2573

Referenced by DirectSoundCaptureDevice_Initialize(), wave_in_test_device(), and wave_in_tests().

◆ waveInGetDevCapsW()

UINT WINAPI waveInGetDevCapsW ( UINT_PTR  uDeviceID,
LPWAVEINCAPSW  lpCaps,
UINT  uSize 
)

Definition at line 2573 of file winmm.c.

2574{
2575 LPWINE_MLD wmld;
2576
2577 TRACE("(%lu %p %u)!\n", uDeviceID, lpCaps, uSize);
2578
2579 if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
2580
2581 if (uDeviceID == WAVE_MAPPER)
2582 {
2583 FIXME("Support WAVE_MAPPER\n");
2584 uDeviceID = 0;
2585 }
2586
2587
2588 if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_WAVEIN, TRUE)) == NULL)
2589 return MMSYSERR_BADDEVICEID;
2590
2591 return MMDRV_Message(wmld, WIDM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
2592}
#define WIDM_GETDEVCAPS
Definition: mmddk.h:137

Referenced by CDirectSoundCapture_fnGetCaps(), DirectSoundCaptureEnumerateW(), DSoundEnumerate(), DSPROPERTY_WaveDeviceMappingW(), InitAudioDlg(), KSPropertySetImpl_Get(), register_wavein_devices(), test_wavein(), wave_in_test_device(), wave_in_tests(), waveInGetDevCapsA(), and widGetDevCaps().

◆ waveInGetID()

UINT WINAPI waveInGetID ( HWAVEIN  hWaveIn,
UINT lpuDeviceID 
)

Definition at line 2795 of file winmm.c.

2796{
2797 LPWINE_MLD wmld;
2798
2799 TRACE("(%p, %p);\n", hWaveIn, lpuDeviceID);
2800
2801 if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE;
2802
2803 if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
2804 return MMSYSERR_INVALHANDLE;
2805
2806 *lpuDeviceID = wmld->uDeviceID;
2807 return MMSYSERR_NOERROR;
2808}

Referenced by widMapperStatus().

◆ waveInGetNumDevs()

◆ waveInGetPosition()

UINT WINAPI waveInGetPosition ( HWAVEIN  hWaveIn,
LPMMTIME  lpTime,
UINT  uSize 
)

Definition at line 2779 of file winmm.c.

2781{
2782 LPWINE_MLD wmld;
2783
2784 TRACE("(%p, %p, %u);\n", hWaveIn, lpTime, uSize);
2785
2786 if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
2787 return MMSYSERR_INVALHANDLE;
2788
2789 return MMDRV_Message(wmld, WIDM_GETPOS, (DWORD_PTR)lpTime, uSize);
2790}
#define WIDM_GETPOS
Definition: mmddk.h:146

Referenced by check_position(), wave_in_test_deviceIn(), and widGetPosition().

◆ waveInMessage()

UINT WINAPI waveInMessage ( HWAVEIN  hWaveIn,
UINT  uMessage,
DWORD_PTR  dwParam1,
DWORD_PTR  dwParam2 
)

Definition at line 2813 of file winmm.c.

2815{
2816 LPWINE_MLD wmld;
2817
2818 TRACE("(%p, %u, %ld, %ld)\n", hWaveIn, uMessage, dwParam1, dwParam2);
2819
2820 if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL) {
2821 if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, TRUE)) != NULL) {
2822 return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2);
2823 }
2824 return MMSYSERR_INVALHANDLE;
2825 }
2826
2827 /* from M$ KB */
2828 if (uMessage < DRVM_IOCTL || (uMessage >= DRVM_IOCTL_LAST && uMessage < DRVM_MAPPER))
2829 return MMSYSERR_INVALPARAM;
2830
2831
2832 return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2);
2833}
#define DRVM_IOCTL_LAST
Definition: mmddk.h:69
#define DRVM_IOCTL
Definition: mmddk.h:66
#define DRVM_MAPPER
Definition: mmsys.h:38

Referenced by DirectSoundCaptureDevice_Initialize(), DSPROPERTY_DescriptionW(), FindWinMMDeviceIndex(), GetDeviceID(), test_wavein(), wave_in_test_device(), and wave_in_tests().

◆ waveInOpen()

MMRESULT WINAPI waveInOpen ( HWAVEIN *  lphWaveIn,
UINT  uDeviceID,
LPCWAVEFORMATEX  lpFormat,
DWORD_PTR  dwCallback,
DWORD_PTR  dwInstance,
DWORD  dwFlags 
)

Definition at line 2623 of file winmm.c.

2626{
2627 return WAVE_Open((HANDLE*)lphWaveIn, uDeviceID, MMDRV_WAVEIN, lpFormat,
2628 dwCallback, dwInstance, dwFlags);
2629}
static UINT WAVE_Open(HANDLE *lphndl, UINT uDeviceID, UINT uType, LPCWAVEFORMATEX lpFormat, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD dwFlags)
Definition: winmm.c:2052

Referenced by IDirectSoundCaptureBufferImpl_Create(), audio_wavein::open(), wave_in_test_device(), wave_in_test_deviceIn(), wave_in_tests(), WAVE_mciRecord(), widOpen(), and widOpenHelper().

◆ waveInPrepareHeader()

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

Definition at line 2653 of file winmm.c.

2655{
2656 LPWINE_MLD wmld;
2657 UINT result;
2658
2659 TRACE("(%p, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize);
2660
2661 if (lpWaveInHdr == NULL || uSize < sizeof (WAVEHDR))
2662 return MMSYSERR_INVALPARAM;
2663
2664 if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
2665 return MMSYSERR_INVALHANDLE;
2666
2667 if ((result = MMDRV_Message(wmld, WIDM_PREPARE, (DWORD_PTR)lpWaveInHdr,
2668 uSize)) != MMSYSERR_NOTSUPPORTED)
2669 return result;
2670
2671 if (lpWaveInHdr->dwFlags & WHDR_INQUEUE)
2672 return WAVERR_STILLPLAYING;
2673
2674 lpWaveInHdr->dwFlags |= WHDR_PREPARED;
2675 lpWaveInHdr->dwFlags &= ~WHDR_DONE;
2676 lpWaveInHdr->dwBytesRecorded = 0;
2677
2678 return MMSYSERR_NOERROR;
2679}
#define WIDM_PREPARE
Definition: mmddk.h:140
GLuint64EXT * result
Definition: glext.h:11304
#define WHDR_INQUEUE
Definition: mmsystem.h:197
#define WHDR_PREPARED
Definition: mmsystem.h:194

Referenced by DSOUND_capture_callback(), IDirectSoundCaptureBufferImpl_Start(), audio_wavein::prep_headers_(), wave_in_test_deviceIn(), WAVE_mciRecord(), and widPrepare().

◆ waveInReset()

UINT WINAPI waveInReset ( HWAVEIN  hWaveIn)

Definition at line 2734 of file winmm.c.

2735{
2736 LPWINE_MLD wmld;
2737
2738 TRACE("(%p);\n", hWaveIn);
2739
2740 if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
2741 return MMSYSERR_INVALHANDLE;
2742
2743 return MMDRV_Message(wmld, WIDM_RESET, 0L, 0L);
2744}
#define WIDM_RESET
Definition: mmddk.h:145

Referenced by IDirectSoundCaptureBufferImpl_Release(), IDirectSoundCaptureBufferImpl_Stop(), audio_wavein::stop_recording(), WAVE_mciRecord(), WAVE_mciStop(), and widReset().

◆ waveInStart()

UINT WINAPI waveInStart ( HWAVEIN  hWaveIn)

Definition at line 2749 of file winmm.c.

2750{
2751 LPWINE_MLD wmld;
2752
2753 TRACE("(%p);\n", hWaveIn);
2754
2755 if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
2756 return MMSYSERR_INVALHANDLE;
2757
2758 return MMDRV_Message(wmld, WIDM_START, 0L, 0L);
2759}
#define WIDM_START
Definition: mmddk.h:143

Referenced by IDirectSoundCaptureBufferImpl_Start(), audio_wavein::start_recording(), wave_in_test_deviceIn(), WAVE_mciRecord(), WAVE_mciResume(), and widStart().

◆ waveInStop()

UINT WINAPI waveInStop ( HWAVEIN  hWaveIn)

Definition at line 2764 of file winmm.c.

2765{
2766 LPWINE_MLD wmld;
2767
2768 TRACE("(%p);\n", hWaveIn);
2769
2770 if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
2771 return MMSYSERR_INVALHANDLE;
2772
2773 return MMDRV_Message(wmld,WIDM_STOP, 0L, 0L);
2774}
#define WIDM_STOP
Definition: mmddk.h:144

Referenced by audio_wavein::stop_recording(), wave_in_test_deviceIn(), WAVE_mciPause(), and widStop().

◆ waveInUnprepareHeader()

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

Definition at line 2684 of file winmm.c.

2686{
2687 LPWINE_MLD wmld;
2688 UINT result;
2689
2690 TRACE("(%p, %p, %u);\n", hWaveIn, lpWaveInHdr, uSize);
2691
2692 if (lpWaveInHdr == NULL || uSize < sizeof (WAVEHDR))
2693 return MMSYSERR_INVALPARAM;
2694
2695 if (!(lpWaveInHdr->dwFlags & WHDR_PREPARED))
2696 return MMSYSERR_NOERROR;
2697
2698 if ((wmld = MMDRV_Get(hWaveIn, MMDRV_WAVEIN, FALSE)) == NULL)
2699 return MMSYSERR_INVALHANDLE;
2700
2701 if ((result = MMDRV_Message(wmld, WIDM_UNPREPARE, (DWORD_PTR)lpWaveInHdr,
2702 uSize)) != MMSYSERR_NOTSUPPORTED)
2703 return result;
2704
2705 if (lpWaveInHdr->dwFlags & WHDR_INQUEUE)
2706 return WAVERR_STILLPLAYING;
2707
2708 lpWaveInHdr->dwFlags &= ~WHDR_PREPARED;
2709 lpWaveInHdr->dwFlags |= WHDR_DONE;
2710
2711 return MMSYSERR_NOERROR;
2712}
#define WIDM_UNPREPARE
Definition: mmddk.h:141
#define WHDR_DONE
Definition: mmsystem.h:193
DWORD dwFlags
Definition: mmsystem.h:1018

Referenced by DSOUND_capture_callback(), IDirectSoundCaptureBufferImpl_Start(), audio_wavein::unprep_headers_(), wave_in_test_deviceIn(), WAVE_mciRecord(), and widUnprepare().

◆ waveOutBreakLoop()

UINT WINAPI waveOutBreakLoop ( HWAVEOUT  hWaveOut)

Definition at line 2357 of file winmm.c.

2358{
2359 LPWINE_MLD wmld;
2360
2361 TRACE("(%p);\n", hWaveOut);
2362
2363 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
2364 return MMSYSERR_INVALHANDLE;
2365 return MMDRV_Message(wmld, WODM_BREAKLOOP, 0L, 0L);
2366}
#define WODM_BREAKLOOP
Definition: mmddk.h:125

Referenced by wodBreakLoop().

◆ waveOutClose()

UINT WINAPI waveOutClose ( HWAVEOUT  hWaveOut)

Definition at line 2257 of file winmm.c.

2258{
2259 LPWINE_MLD wmld;
2260 DWORD dwRet;
2261
2262 TRACE("(%p)\n", hWaveOut);
2263
2264 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
2265 return MMSYSERR_INVALHANDLE;
2266
2267 dwRet = MMDRV_Close(wmld, WODM_CLOSE);
2268 if (dwRet != WAVERR_STILLPLAYING)
2269 MMDRV_Free(hWaveOut, wmld);
2270
2271 return dwRet;
2272}
#define WODM_CLOSE
Definition: mmddk.h:111

Referenced by audio_waveout::close(), DirectSoundDevice_Release(), DSOUND_ReopenDevice(), MCIAVI_player(), proc_PlaySound(), stopTestTone(), test_fragmentsize(), test_multiple_waveopens(), wave_in_test_deviceIn(), WAVE_mciPlay(), wave_out_test_device(), wave_out_test_deviceOut(), and wodClose().

◆ waveOutGetDevCapsA()

UINT WINAPI waveOutGetDevCapsA ( UINT_PTR  uDeviceID,
LPWAVEOUTCAPSA  lpCaps,
UINT  uSize 
)

Definition at line 2145 of file winmm.c.

2147{
2148 WAVEOUTCAPSW wocW;
2149 UINT ret;
2150
2151 if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
2152
2153 ret = waveOutGetDevCapsW(uDeviceID, &wocW, sizeof(wocW));
2154
2155 if (ret == MMSYSERR_NOERROR) {
2156 WAVEOUTCAPSA wocA;
2157 wocA.wMid = wocW.wMid;
2158 wocA.wPid = wocW.wPid;
2159 wocA.vDriverVersion = wocW.vDriverVersion;
2160 WideCharToMultiByte( CP_ACP, 0, wocW.szPname, -1, wocA.szPname,
2161 sizeof(wocA.szPname), NULL, NULL );
2162 wocA.dwFormats = wocW.dwFormats;
2163 wocA.wChannels = wocW.wChannels;
2164 wocA.dwSupport = wocW.dwSupport;
2165 memcpy(lpCaps, &wocA, min(uSize, sizeof(wocA)));
2166 }
2167 return ret;
2168}
CHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1028
MMVERSION vDriverVersion
Definition: mmsystem.h:1027
MMVERSION vDriverVersion
Definition: mmsystem.h:1038
WCHAR szPname[MAXPNAMELEN]
Definition: mmsystem.h:1039
UINT WINAPI waveOutGetDevCapsW(UINT_PTR uDeviceID, LPWAVEOUTCAPSW lpCaps, UINT uSize)
Definition: winmm.c:2173

Referenced by DirectSoundDevice_Initialize(), wave_out_test_device(), and wave_out_tests().

◆ waveOutGetDevCapsW()

UINT WINAPI waveOutGetDevCapsW ( UINT_PTR  uDeviceID,
LPWAVEOUTCAPSW  lpCaps,
UINT  uSize 
)

Definition at line 2173 of file winmm.c.

2175{
2176 LPWINE_MLD wmld;
2177
2178 TRACE("(%lu %p %u)!\n", uDeviceID, lpCaps, uSize);
2179
2180 if (lpCaps == NULL) return MMSYSERR_INVALPARAM;
2181
2182 if (uDeviceID == WAVE_MAPPER)
2183 {
2184 FIXME("Support WAVE_MAPPER\n");
2185 uDeviceID = 0;
2186 }
2187
2188 if ((wmld = MMDRV_Get((HANDLE)uDeviceID, MMDRV_WAVEOUT, TRUE)) == NULL)
2189 return MMSYSERR_BADDEVICEID;
2190
2191 return MMDRV_Message(wmld, WODM_GETDEVCAPS, (DWORD_PTR)lpCaps, uSize);
2192}
#define WODM_GETDEVCAPS
Definition: mmddk.h:109

Referenced by DirectSoundEnumerateW(), DSoundEnumerate(), DSPROPERTY_WaveDeviceMappingW(), InitAudioDlg(), KSPropertySetImpl_Get(), register_waveout_devices(), SetDeviceDetails(), test_waveout(), wave_out_test_device(), wave_out_tests(), waveOutGetDevCapsA(), and wodGetDevCaps().

◆ waveOutGetErrorTextA()

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

Definition at line 2198 of file winmm.c.

2199{
2200 UINT ret;
2201
2202 if (lpText == NULL) ret = MMSYSERR_INVALPARAM;
2203 else if (uSize == 0) ret = MMSYSERR_NOERROR;
2204 else
2205 {
2206 LPWSTR xstr = HeapAlloc(GetProcessHeap(), 0, uSize * sizeof(WCHAR));
2207 if (!xstr) ret = MMSYSERR_NOMEM;
2208 else
2209 {
2210 ret = waveOutGetErrorTextW(uError, xstr, uSize);
2211 if (ret == MMSYSERR_NOERROR)
2212 WideCharToMultiByte(CP_ACP, 0, xstr, -1, lpText, uSize, NULL, NULL);
2213 HeapFree(GetProcessHeap(), 0, xstr);
2214 }
2215 }
2216 return ret;
2217}
UINT WINAPI waveOutGetErrorTextW(UINT uError, LPWSTR lpText, UINT uSize)
Definition: winmm.c:2223

Referenced by wave_out_error().

◆ waveOutGetErrorTextW()

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

Definition at line 2223 of file winmm.c.

2224{
2226
2227 if (lpText == NULL) ret = MMSYSERR_INVALPARAM;
2228 else if (uSize == 0) ret = MMSYSERR_NOERROR;
2229 else if (
2230 /* test has been removed because MMSYSERR_BASE is 0, and gcc did emit
2231 * a warning for the test was always true */
2232 (/*uError >= MMSYSERR_BASE && */ uError <= MMSYSERR_LASTERROR) ||
2233 (uError >= WAVERR_BASE && uError <= WAVERR_LASTERROR)) {
2235 uError, lpText, uSize) > 0) {
2237 }
2238 }
2239 return ret;
2240}
#define WAVERR_BASE
Definition: mmsystem.h:85
#define WAVERR_LASTERROR
Definition: mmsystem.h:180

Referenced by waveOutGetErrorTextA().

◆ waveOutGetID()

UINT WINAPI waveOutGetID ( HWAVEOUT  hWaveOut,
UINT lpuDeviceID 
)

Definition at line 2520 of file winmm.c.

2521{
2522 LPWINE_MLD wmld;
2523
2524 TRACE("(%p, %p);\n", hWaveOut, lpuDeviceID);
2525
2526 if (lpuDeviceID == NULL) return MMSYSERR_INVALHANDLE;
2527
2528 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
2529 return MMSYSERR_INVALHANDLE;
2530
2531 *lpuDeviceID = wmld->uDeviceID;
2532 return 0;
2533}

Referenced by wodMapperStatus().

◆ waveOutGetNumDevs()

◆ waveOutGetPitch()

UINT WINAPI waveOutGetPitch ( HWAVEOUT  hWaveOut,
LPDWORD  lpdw 
)

Definition at line 2429 of file winmm.c.

2430{
2431 LPWINE_MLD wmld;
2432
2433 TRACE("(%p, %p);\n", hWaveOut, lpdw);
2434
2435 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
2436 return MMSYSERR_INVALHANDLE;
2437 return MMDRV_Message(wmld, WODM_GETPITCH, (DWORD_PTR)lpdw, 0L);
2438}
#define WODM_GETPITCH
Definition: mmddk.h:119

◆ waveOutGetPlaybackRate()

UINT WINAPI waveOutGetPlaybackRate ( HWAVEOUT  hWaveOut,
LPDWORD  lpdw 
)

Definition at line 2457 of file winmm.c.

2458{
2459 LPWINE_MLD wmld;
2460
2461 TRACE("(%p, %p);\n", hWaveOut, lpdw);
2462
2463 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
2464 return MMSYSERR_INVALHANDLE;
2465 return MMDRV_Message(wmld, WODM_GETPLAYBACKRATE, (DWORD_PTR)lpdw, 0L);
2466}
#define WODM_GETPLAYBACKRATE
Definition: mmddk.h:123

◆ waveOutGetPosition()

UINT WINAPI waveOutGetPosition ( HWAVEOUT  hWaveOut,
LPMMTIME  lpTime,
UINT  uSize 
)

Definition at line 2413 of file winmm.c.

2415{
2416 LPWINE_MLD wmld;
2417
2418 TRACE("(%p, %p, %u);\n", hWaveOut, lpTime, uSize);
2419
2420 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
2421 return MMSYSERR_INVALHANDLE;
2422
2423 return MMDRV_Message(wmld, WODM_GETPOS, (DWORD_PTR)lpTime, uSize);
2424}
#define WODM_GETPOS
Definition: mmddk.h:118

Referenced by check_position(), test_fragmentsize(), and wodGetPosition().

◆ waveOutGetVolume()

UINT WINAPI waveOutGetVolume ( HWAVEOUT  hWaveOut,
LPDWORD  lpdw 
)

Definition at line 2485 of file winmm.c.

2486{
2487 LPWINE_MLD wmld;
2488
2489 TRACE("(%p, %p);\n", hWaveOut, lpdw);
2490
2491 if (lpdw == NULL) {
2492 WARN("invalid parameter\n");
2493 return MMSYSERR_INVALPARAM;
2494 }
2495
2496 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) == NULL)
2497 return MMSYSERR_INVALHANDLE;
2498
2499 return MMDRV_Message(wmld, WODM_GETVOLUME, (DWORD_PTR)lpdw, 0L);
2500}
#define WODM_GETVOLUME
Definition: mmddk.h:121

Referenced by PrimaryBufferImpl_GetPan(), PrimaryBufferImpl_GetVolume(), PrimaryBufferImpl_SetPan(), PrimaryBufferImpl_SetVolume(), wave_out_test_deviceOut(), and wodGetVolume().

◆ waveOutMessage()

UINT WINAPI waveOutMessage ( HWAVEOUT  hWaveOut,
UINT  uMessage,
DWORD_PTR  dwParam1,
DWORD_PTR  dwParam2 
)

Definition at line 2538 of file winmm.c.

2540{
2541 LPWINE_MLD wmld;
2542
2543 TRACE("(%p, %u, %ld, %ld)\n", hWaveOut, uMessage, dwParam1, dwParam2);
2544
2545 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL) {
2546 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) != NULL) {
2547 return MMDRV_PhysicalFeatures(wmld, uMessage, dwParam1, dwParam2);
2548 }
2549 WARN("invalid handle\n");
2550 return MMSYSERR_INVALHANDLE;
2551 }
2552
2553 /* from M$ KB */
2554 if (uMessage < DRVM_IOCTL || (uMessage >= DRVM_IOCTL_LAST && uMessage < DRVM_MAPPER)) {
2555 WARN("invalid parameter\n");
2556 return MMSYSERR_INVALPARAM;
2557 }
2558
2559 return MMDRV_Message(wmld, uMessage, dwParam1, dwParam2);
2560}

Referenced by DSOUND_ReopenDevice(), DSPROPERTY_DescriptionW(), FindWinMMDeviceIndex(), GetDeviceID(), test_waveout(), Volume_FindMixerControl(), wave_out_test_device(), and wave_out_tests().

◆ waveOutOpen()

MMRESULT WINAPI waveOutOpen ( LPHWAVEOUT  lphWaveOut,
UINT  uDeviceID,
LPCWAVEFORMATEX  lpFormat,
DWORD_PTR  dwCallback,
DWORD_PTR  dwInstance,
DWORD  dwFlags 
)

◆ waveOutPause()

UINT WINAPI waveOutPause ( HWAVEOUT  hWaveOut)

Definition at line 2371 of file winmm.c.

2372{
2373 LPWINE_MLD wmld;
2374
2375 TRACE("(%p);\n", hWaveOut);
2376
2377 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
2378 return MMSYSERR_INVALHANDLE;
2379 return MMDRV_Message(wmld, WODM_PAUSE, 0L, 0L);
2380}
#define WODM_PAUSE
Definition: mmddk.h:115

Referenced by DSOUND_PrimaryOpen(), DSOUND_PrimaryStop(), MCIAVI_mciPause(), audio_waveout::pause(), WAVE_mciPause(), wave_out_test_deviceOut(), and wodPause().

◆ waveOutPrepareHeader()

UINT WINAPI waveOutPrepareHeader ( HWAVEOUT  hWaveOut,
WAVEHDR lpWaveOutHdr,
UINT  uSize 
)

Definition at line 2277 of file winmm.c.

2279{
2280 LPWINE_MLD wmld;
2281 UINT result;
2282
2283 TRACE("(%p, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
2284
2285 if (lpWaveOutHdr == NULL || uSize < sizeof (WAVEHDR))
2286 return MMSYSERR_INVALPARAM;
2287
2288 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
2289 return MMSYSERR_INVALHANDLE;
2290
2291 if ((result = MMDRV_Message(wmld, WODM_PREPARE, (DWORD_PTR)lpWaveOutHdr,
2292 uSize)) != MMSYSERR_NOTSUPPORTED)
2293 return result;
2294
2295 if (lpWaveOutHdr->dwFlags & WHDR_INQUEUE)
2296 return WAVERR_STILLPLAYING;
2297
2298 lpWaveOutHdr->dwFlags |= WHDR_PREPARED;
2299 lpWaveOutHdr->dwFlags &= ~WHDR_DONE;
2300
2301 return MMSYSERR_NOERROR;
2302}
#define WODM_PREPARE
Definition: mmddk.h:112

Referenced by DSOUND_PrimaryOpen(), MCIAVI_OpenAudio(), playTestTone(), audio_waveout::prep_headers_(), proc_PlaySound(), test_fragmentsize(), wave_in_test_deviceIn(), WAVE_mciPlay(), wave_out_test_deviceOut(), and wodPrepare().

◆ waveOutReset()

UINT WINAPI waveOutReset ( HWAVEOUT  hWaveOut)

Definition at line 2385 of file winmm.c.

2386{
2387 LPWINE_MLD wmld;
2388
2389 TRACE("(%p);\n", hWaveOut);
2390
2391 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
2392 return MMSYSERR_INVALHANDLE;
2393 return MMDRV_Message(wmld, WODM_RESET, 0L, 0L);
2394}
#define WODM_RESET
Definition: mmddk.h:117

Referenced by DSOUND_PrimaryClose(), MCIAVI_mciStop(), MCIAVI_player(), MULTIMEDIA_PlaySound(), playTestTone(), proc_PlaySound(), audio_waveout::stop(), stopTestTone(), WAVE_mciPlay(), WAVE_mciStop(), wave_out_test_deviceOut(), and wodReset().

◆ waveOutRestart()

UINT WINAPI waveOutRestart ( HWAVEOUT  hWaveOut)

Definition at line 2399 of file winmm.c.

2400{
2401 LPWINE_MLD wmld;
2402
2403 TRACE("(%p);\n", hWaveOut);
2404
2405 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
2406 return MMSYSERR_INVALHANDLE;
2407 return MMDRV_Message(wmld, WODM_RESTART, 0L, 0L);
2408}
#define WODM_RESTART
Definition: mmddk.h:116

Referenced by DSOUND_PrimaryPlay(), MCIAVI_mciResume(), audio_waveout::play(), WAVE_mciResume(), wave_out_test_deviceOut(), and wodRestart().

◆ waveOutSetPitch()

UINT WINAPI waveOutSetPitch ( HWAVEOUT  hWaveOut,
DWORD  dw 
)

Definition at line 2443 of file winmm.c.

2444{
2445 LPWINE_MLD wmld;
2446
2447 TRACE("(%p, %08x);\n", hWaveOut, dw);
2448
2449 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
2450 return MMSYSERR_INVALHANDLE;
2451 return MMDRV_Message(wmld, WODM_SETPITCH, dw, 0L);
2452}
#define WODM_SETPITCH
Definition: mmddk.h:120
REFIID LPVOID DWORD_PTR dw
Definition: atlbase.h:40

◆ waveOutSetPlaybackRate()

UINT WINAPI waveOutSetPlaybackRate ( HWAVEOUT  hWaveOut,
DWORD  dw 
)

Definition at line 2471 of file winmm.c.

2472{
2473 LPWINE_MLD wmld;
2474
2475 TRACE("(%p, %08x);\n", hWaveOut, dw);
2476
2477 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
2478 return MMSYSERR_INVALHANDLE;
2479 return MMDRV_Message(wmld, WODM_SETPLAYBACKRATE, dw, 0L);
2480}
#define WODM_SETPLAYBACKRATE
Definition: mmddk.h:124

◆ waveOutSetVolume()

UINT WINAPI waveOutSetVolume ( HWAVEOUT  hWaveOut,
DWORD  dw 
)

Definition at line 2505 of file winmm.c.

2506{
2507 LPWINE_MLD wmld;
2508
2509 TRACE("(%p, %08x);\n", hWaveOut, dw);
2510
2511 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, TRUE)) == NULL)
2512 return MMSYSERR_INVALHANDLE;
2513
2514 return MMDRV_Message(wmld, WODM_SETVOLUME, dw, 0L);
2515}
#define WODM_SETVOLUME
Definition: mmddk.h:122

Referenced by PrimaryBufferImpl_SetPan(), PrimaryBufferImpl_SetVolume(), wave_out_test_deviceOut(), and wodSetVolume().

◆ waveOutUnprepareHeader()

UINT WINAPI waveOutUnprepareHeader ( HWAVEOUT  hWaveOut,
LPWAVEHDR  lpWaveOutHdr,
UINT  uSize 
)

Definition at line 2307 of file winmm.c.

2309{
2310 LPWINE_MLD wmld;
2311 UINT result;
2312
2313 TRACE("(%p, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
2314
2315 if (lpWaveOutHdr == NULL || uSize < sizeof (WAVEHDR))
2316 return MMSYSERR_INVALPARAM;
2317
2318 if (!(lpWaveOutHdr->dwFlags & WHDR_PREPARED)) {
2319 return MMSYSERR_NOERROR;
2320 }
2321
2322 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
2323 return MMSYSERR_INVALHANDLE;
2324
2325 if ((result = MMDRV_Message(wmld, WODM_UNPREPARE, (DWORD_PTR)lpWaveOutHdr,
2326 uSize)) != MMSYSERR_NOTSUPPORTED)
2327 return result;
2328
2329 if (lpWaveOutHdr->dwFlags & WHDR_INQUEUE)
2330 return WAVERR_STILLPLAYING;
2331
2332 lpWaveOutHdr->dwFlags &= ~WHDR_PREPARED;
2333 lpWaveOutHdr->dwFlags |= WHDR_DONE;
2334
2335 return MMSYSERR_NOERROR;
2336}
#define WODM_UNPREPARE
Definition: mmddk.h:113

Referenced by DSOUND_PrimaryClose(), DSOUND_PrimaryOpen(), MCIAVI_player(), proc_PlaySound(), audio_waveout::unprep_headers_(), wave_in_test_deviceIn(), WAVE_mciPlay(), wave_out_test_deviceOut(), and wodUnprepare().

◆ waveOutWrite()

UINT WINAPI waveOutWrite ( HWAVEOUT  hWaveOut,
LPWAVEHDR  lpWaveOutHdr,
UINT  uSize 
)

Definition at line 2341 of file winmm.c.

2343{
2344 LPWINE_MLD wmld;
2345
2346 TRACE("(%p, %p, %u);\n", hWaveOut, lpWaveOutHdr, uSize);
2347
2348 if ((wmld = MMDRV_Get(hWaveOut, MMDRV_WAVEOUT, FALSE)) == NULL)
2349 return MMSYSERR_INVALHANDLE;
2350
2351 return MMDRV_Message(wmld, WODM_WRITE, (DWORD_PTR)lpWaveOutHdr, uSize);
2352}
#define WODM_WRITE
Definition: mmddk.h:114

Referenced by DSOUND_WaveQueue(), MCIAVI_PlayAudioBlocks(), audio_waveout::play(), audio_waveout::playing_procedure(), playTestTone(), proc_PlaySound(), test_fragmentsize(), wave_in_test_deviceIn(), WAVE_mciPlay(), wave_out_test_deviceOut(), and wodWrite().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( winmm  )

◆ WINMM_CheckCallback()

MMRESULT WINMM_CheckCallback ( DWORD_PTR  dwCallback,
DWORD  fdwOpen,
BOOL  mixer 
)

Definition at line 193 of file winmm.c.

194{
195 switch (fdwOpen & CALLBACK_TYPEMASK) {
196 case CALLBACK_NULL: /* dwCallback need not be NULL */
197 break;
198 case CALLBACK_WINDOW:
199 if (dwCallback && !IsWindow((HWND)dwCallback))
200 return MMSYSERR_INVALPARAM;
201 break;
202
204 /* a NULL cb is acceptable since w2k, MMSYSERR_INVALPARAM earlier */
205 if (mixer)
206 return MMSYSERR_INVALFLAG; /* since w2k, MMSYSERR_NOTSUPPORTED earlier */
207 break;
208 case CALLBACK_THREAD:
209 case CALLBACK_EVENT:
210 if (mixer) /* FIXME: mixer supports THREAD+EVENT since w2k */
211 return MMSYSERR_NOTSUPPORTED; /* w9X */
212 break;
213 default:
214 WARN("Unknown callback type %d\n", HIWORD(fdwOpen));
215 }
216 return MMSYSERR_NOERROR;
217}
#define CALLBACK_THREAD
Definition: mmsystem.h:151
#define CALLBACK_EVENT
Definition: mmsystem.h:152
#define CALLBACK_NULL
Definition: mmsystem.h:147
BOOL WINAPI IsWindow(_In_opt_ HWND)

Referenced by midiInOpen(), midiOutOpen(), midiStreamOpen(), mixerOpen(), and WAVE_Open().

◆ WINMM_CheckForMMSystem()

BOOL WINMM_CheckForMMSystem ( void  )

Definition at line 86 of file winmm.c.

87{
88 /* 0 is not checked yet, -1 is not present, 1 is present */
89 static int loaded /* = 0 */;
90
91 if (loaded == 0)
92 {
93 HANDLE h = GetModuleHandleA("kernel32");
94 loaded = -1;
95 if (h)
96 {
97 pGetModuleHandle16 = (void*)GetProcAddress(h, "GetModuleHandle16");
98 pLoadLibrary16 = (void*)GetProcAddress(h, (LPCSTR)35); /* ordinal for LoadLibrary16 */
99 if (pGetModuleHandle16 && pLoadLibrary16 &&
100 (pGetModuleHandle16("MMSYSTEM.DLL") || pLoadLibrary16("MMSYSTEM.DLL")))
101 loaded = 1;
102 }
103 }
104 return loaded > 0;
105}
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
BOOL loaded
Definition: xmlview.c:54
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by OpenDriver().

◆ WINMM_CreateIData()

static BOOL WINMM_CreateIData ( HINSTANCE  hInstDLL)
static

Definition at line 58 of file winmm.c.

59{
60 hWinMM32Instance = hInstDLL;
63 return TRUE;
64}
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
HANDLE psLastEvent
Definition: winmm.c:51
CRITICAL_SECTION WINMM_cs
Definition: winmm.c:53

Referenced by DllMain().

◆ WINMM_DeleteIData()

static void WINMM_DeleteIData ( void  )
static

Definition at line 69 of file winmm.c.

70{
72
73 /* FIXME: should also free content and resources allocated
74 * inside WINMM_IData */
77}
void TIME_MMTimeStop(void)
Definition: time.c:271
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

Referenced by DllMain().

◆ WINMM_ErrorToString()

const char * WINMM_ErrorToString ( MMRESULT  error)

Definition at line 110 of file winmm.c.

111{
112#define ERR_TO_STR(dev) case dev: return #dev
113 static char unknown[32];
114 switch (error) {
144 }
145 sprintf(unknown, "Unknown(0x%08x)", error);
146 return unknown;
147#undef ERR_TO_STR
148}
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
#define error(str)
Definition: mkdosfs.c:1605
#define MMSYSERR_HANDLEBUSY
Definition: mmsystem.h:108
#define MMSYSERR_BADDB
Definition: mmsystem.h:110
#define MIDIERR_INVALIDSETUP
Definition: mmsystem.h:236
#define MIDIERR_NODEVICE
Definition: mmsystem.h:235
#define MMSYSERR_NODRIVER
Definition: mmsystem.h:102
#define MMSYSERR_DELETEERROR
Definition: mmsystem.h:114
#define MMSYSERR_NODRIVERCB
Definition: mmsystem.h:116
#define MMSYSERR_VALNOTFOUND
Definition: mmsystem.h:115
#define MMSYSERR_WRITEERROR
Definition: mmsystem.h:113
#define MMSYSERR_ALLOCATED
Definition: mmsystem.h:100
#define MMSYSERR_READERROR
Definition: mmsystem.h:112
#define MMSYSERR_KEYNOTFOUND
Definition: mmsystem.h:111
#define WAVERR_UNPREPARED
Definition: mmsystem.h:178
#define WAVERR_SYNC
Definition: mmsystem.h:179
#define MMSYSERR_INVALIDALIAS
Definition: mmsystem.h:109
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define ERR_TO_STR(dev)

Referenced by MMDRV_ExitPerType(), MMDRV_InitPerType(), MMDRV_Message(), and WAVE_Open().

Variable Documentation

◆ hWinMM32Instance

◆ psLastEvent

HANDLE psLastEvent

Definition at line 51 of file winmm.c.

Referenced by MULTIMEDIA_PlaySound(), PlaySound_Free(), WINMM_CreateIData(), and WINMM_DeleteIData().

◆ WINMM_cs