Hello, am I right that HMIDI and HMIDIIN, HMIDIOUT shouldn't be interchangeable? Would save some conversions. License: LGPL, X11 Changelog: Michael Stefaniuc <mstefani@redhat.com> Convert HMIDI to a void* bye michael -- Michael Stefaniuc Tel.: +49-711-96437-199 System Administration Fax.: +49-711-96437-111 Red Hat GmbH Email: mstefani@redhat.com Hauptstaetterstr. 58 http://www.redhat.de/ D-70178 Stuttgart
Index: dlls/winmm/lolvldrv.c =================================================================== RCS file: /home/wine/wine/dlls/winmm/lolvldrv.c,v retrieving revision 1.29 diff -u -r1.29 lolvldrv.c --- dlls/winmm/lolvldrv.c 3 Jul 2002 21:10:44 -0000 1.29 +++ dlls/winmm/lolvldrv.c 31 Jul 2002 19:31:58 -0000 @@ -693,7 +693,7 @@ *(LPDWORD)((char*)ptr + sizeof(LPMIDIOPENDESC)) = *lpdwUser; mod16 = (LPMIDIOPENDESC16)((LPSTR)ptr + sizeof(LPMIDIOPENDESC) + 2*sizeof(DWORD)); - mod16->hMidi = mod32->hMidi; + mod16->hMidi = LOWORD(mod32->hMidi); mod16->dwCallback = mod32->dwCallback; mod16->dwInstance = mod32->dwInstance; mod16->dnDevNode = mod32->dnDevNode; Index: dlls/winmm/mmsystem.c =================================================================== RCS file: /home/wine/wine/dlls/winmm/mmsystem.c,v retrieving revision 1.63 diff -u -r1.63 mmsystem.c --- dlls/winmm/mmsystem.c 29 Jul 2002 23:29:23 -0000 1.63 +++ dlls/winmm/mmsystem.c 31 Jul 2002 19:32:00 -0000 @@ -2188,7 +2188,7 @@ *lphMidiOut = hMidiOut; if (lpwm) { - lpwm->mod.hMidi = hMidiOut; + lpwm->mod.hMidi = (HMIDI) hMidiOut; lpwm->mod.dwCallback = *lpdwCallback; lpwm->mod.dwInstance = *lpdwInstance; lpwm->mod.dnDevNode = 0; @@ -2739,7 +2739,7 @@ if (lpwm == NULL) return MMSYSERR_NOMEM; - lpwm->mod.hMidi = hMidiIn; + lpwm->mod.hMidi = (HMIDI) hMidiIn; lpwm->mod.dwCallback = dwCallback; lpwm->mod.dwInstance = dwInstance; Index: dlls/winmm/mciseq/mcimidi.c =================================================================== RCS file: /home/wine/wine/dlls/winmm/mciseq/mcimidi.c,v retrieving revision 1.16 diff -u -r1.16 mcimidi.c --- dlls/winmm/mciseq/mcimidi.c 31 May 2002 23:40:57 -0000 1.16 +++ dlls/winmm/mciseq/mcimidi.c 31 Jul 2002 19:32:00 -0000 @@ -817,7 +817,7 @@ wmm->dwStatus = MCI_MODE_NOT_READY; if (oldstat == MCI_MODE_PAUSE) - dwRet = midiOutReset(wmm->hMidi); + dwRet = midiOutReset((HMIDIOUT)wmm->hMidi); while (wmm->dwStatus != MCI_MODE_STOP) Sleep(10); @@ -962,7 +962,7 @@ MIDI_mciReadNextEvent(wmm, mmt); /* FIXME == 0 */ } - dwRet = midiOutOpen(&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL); + dwRet = midiOutOpen((LPHMIDIOUT)&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL); /* dwRet = midiInOpen(&wmm->hMidi, MIDIMAPPER, 0L, 0L, CALLBACK_NULL);*/ if (dwRet != MMSYSERR_NOERROR) { return dwRet; @@ -1142,7 +1142,7 @@ break; default: if (doPlay) { - dwRet = midiOutShortMsg(wmm->hMidi, mmt->dwEventData); + dwRet = midiOutShortMsg((HMIDIOUT)wmm->hMidi, mmt->dwEventData); } else { switch (LOBYTE(LOWORD(mmt->dwEventData)) & 0xF0) { case MIDI_NOTEON: @@ -1150,7 +1150,7 @@ dwRet = 0; break; default: - dwRet = midiOutShortMsg(wmm->hMidi, mmt->dwEventData); + dwRet = midiOutShortMsg((HMIDIOUT)wmm->hMidi, mmt->dwEventData); } } } @@ -1163,9 +1163,9 @@ } } - midiOutReset(wmm->hMidi); + midiOutReset((HMIDIOUT)wmm->hMidi); - dwRet = midiOutClose(wmm->hMidi); + dwRet = midiOutClose((HMIDIOUT)wmm->hMidi); /* to restart playing at beginning when it's over */ wmm->dwPositionMS = 0; @@ -1212,7 +1212,7 @@ midiHdr.dwBufferLength = 1024; midiHdr.dwUser = 0L; midiHdr.dwFlags = 0L; - dwRet = midiInPrepareHeader(wmm->hMidi, &midiHdr, sizeof(MIDIHDR)); + dwRet = midiInPrepareHeader((HMIDIIN)wmm->hMidi, &midiHdr, sizeof(MIDIHDR)); TRACE("After MIDM_PREPARE \n"); wmm->dwStatus = MCI_MODE_RECORD; /* FIXME: there is no buffer added */ @@ -1220,12 +1220,12 @@ TRACE("wmm->dwStatus=%p %d\n", &wmm->dwStatus, wmm->dwStatus); midiHdr.dwBytesRecorded = 0; - dwRet = midiInStart(wmm->hMidi); + dwRet = midiInStart((HMIDIIN)wmm->hMidi); TRACE("midiInStart => dwBytesRecorded=%lu\n", midiHdr.dwBytesRecorded); if (midiHdr.dwBytesRecorded == 0) break; } TRACE("Before MIDM_UNPREPARE \n"); - dwRet = midiInUnprepareHeader(wmm->hMidi, &midiHdr, sizeof(MIDIHDR)); + dwRet = midiInUnprepareHeader((HMIDIIN)wmm->hMidi, &midiHdr, sizeof(MIDIHDR)); TRACE("After MIDM_UNPREPARE \n"); if (midiHdr.lpData != NULL) { HeapFree(GetProcessHeap(), 0, midiHdr.lpData); @@ -1255,7 +1255,7 @@ /* stop all notes */ unsigned chn; for (chn = 0; chn < 16; chn++) - midiOutShortMsg(wmm->hMidi, 0x78B0 | chn); + midiOutShortMsg((HMIDIOUT)(wmm->hMidi), 0x78B0 | chn); wmm->dwStatus = MCI_MODE_PAUSE; } if (lpParms && (dwFlags & MCI_NOTIFY)) { Index: dlls/winmm/midimap/midimap.c =================================================================== RCS file: /home/wine/wine/dlls/winmm/midimap/midimap.c,v retrieving revision 1.13 diff -u -r1.13 midimap.c --- dlls/winmm/midimap/midimap.c 31 May 2002 23:40:57 -0000 1.13 +++ dlls/winmm/midimap/midimap.c 31 Jul 2002 19:32:00 -0000 @@ -281,7 +281,7 @@ DWORD t; if (mom->ChannelMap[i] && mom->ChannelMap[i]->loaded > 0) { - t = midiOutClose(mom->ChannelMap[i]->hMidi); + t = midiOutClose((HMIDIOUT)mom->ChannelMap[i]->hMidi); if (t == MMSYSERR_NOERROR) { mom->ChannelMap[i]->loaded = 0; @@ -311,9 +311,12 @@ if (mom->ChannelMap[chn] && mom->ChannelMap[chn]->loaded > 0) { mh.dwFlags = 0; - midiOutPrepareHeader(mom->ChannelMap[chn]->hMidi, &mh, sizeof(mh)); - ret = midiOutLongMsg(mom->ChannelMap[chn]->hMidi, &mh, sizeof(mh)); - midiOutUnprepareHeader(mom->ChannelMap[chn]->hMidi, &mh, sizeof(mh)); + midiOutPrepareHeader((HMIDIOUT)mom->ChannelMap[chn]->hMidi, &mh, + sizeof(mh)); + ret = midiOutLongMsg((HMIDIOUT)mom->ChannelMap[chn]->hMidi, &mh, + sizeof(mh)); + midiOutUnprepareHeader((HMIDIOUT)mom->ChannelMap[chn]->hMidi, &mh, + sizeof(mh)); if (ret != MMSYSERR_NOERROR) break; } } @@ -342,7 +345,8 @@ case 0xE0: if (mom->ChannelMap[chn]->loaded == 0) { - if (midiOutOpen(&mom->ChannelMap[chn]->hMidi, mom->ChannelMap[chn]->uDevID, + if (midiOutOpen((LPHMIDIOUT)&mom->ChannelMap[chn]->hMidi, + mom->ChannelMap[chn]->uDevID, 0L, 0L, CALLBACK_NULL) == MMSYSERR_NOERROR) mom->ChannelMap[chn]->loaded = 1; else @@ -366,14 +370,16 @@ dwParam &= ~0x0000FF00; dwParam |= mom->ChannelMap[chn]->lpbPatch[patch]; } - ret = midiOutShortMsg(mom->ChannelMap[chn]->hMidi, dwParam); + ret = midiOutShortMsg((HMIDIOUT)mom->ChannelMap[chn]->hMidi, + dwParam); } break; case 0xF0: for (chn = 0; chn < 16; chn++) { if (mom->ChannelMap[chn]->loaded > 0) - ret = midiOutShortMsg(mom->ChannelMap[chn]->hMidi, dwParam); + ret = midiOutShortMsg((HMIDIOUT)mom->ChannelMap[chn]->hMidi, + dwParam); } break; default: @@ -430,7 +436,7 @@ { if (mom->ChannelMap[chn] && mom->ChannelMap[chn]->loaded > 0) { - ret = midiOutReset(mom->ChannelMap[chn]->hMidi); + ret = midiOutReset((HMIDIOUT)mom->ChannelMap[chn]->hMidi); if (ret != MMSYSERR_NOERROR) break; } } Index: include/mmsystem.h =================================================================== RCS file: /home/wine/wine/include/mmsystem.h,v retrieving revision 1.51 diff -u -r1.51 mmsystem.h --- include/mmsystem.h 31 May 2002 23:06:48 -0000 1.51 +++ include/mmsystem.h 31 Jul 2002 19:32:02 -0000 @@ -34,7 +34,7 @@ DECLARE_OLD_HANDLE(HWAVE); DECLARE_OLD_HANDLE(HWAVEIN); DECLARE_OLD_HANDLE(HWAVEOUT); -DECLARE_OLD_HANDLE(HMIDI); +DECLARE_HANDLE(HMIDI); DECLARE_OLD_HANDLE(HMIDIIN); DECLARE_OLD_HANDLE(HMIDIOUT); DECLARE_OLD_HANDLE(HMIDISTRM);
Attachment:
pgp00022.pgp
Description: PGP signature