Steven Noonan 2008-05-13 13:31:36 PDT
authorSam Lantinga
Sat, 26 Sep 2009 09:19:14 +0000
changeset 397f90d7e671d18
parent 396 de5061390913
child 398 15acba767487
Steven Noonan 2008-05-13 13:31:36 PDT

I've just recently tested my application compiled for x86_64 (AMD64, x64,
whatever you want to call it). Unfortunately there's one flaw in SDL_mixer
which causes a pointer truncation and subsequent memory access violation and
crash.
native_midi/native_midi_win32.c
     1.1 --- a/native_midi/native_midi_win32.c	Sat Sep 26 09:16:01 2009 +0000
     1.2 +++ b/native_midi/native_midi_win32.c	Sat Sep 26 09:19:14 2009 +0000
     1.3 @@ -158,17 +158,17 @@
     1.4    song->MusicLoaded=1;
     1.5  }
     1.6  
     1.7 -void CALLBACK MidiProc( HMIDIIN hMidi, UINT uMsg, DWORD dwInstance,
     1.8 -                        DWORD dwParam1, DWORD dwParam2 )
     1.9 +void CALLBACK MidiProc( HMIDIIN hMidi, UINT uMsg, DWORD_PTR dwInstance,
    1.10 +                        DWORD_PTR dwParam1, DWORD_PTR dwParam2 )
    1.11  {
    1.12      switch( uMsg )
    1.13      {
    1.14      case MOM_DONE:
    1.15 -      if ((currentsong->MusicLoaded) && ((DWORD)dwParam1 == (DWORD)&currentsong->MidiStreamHdr))
    1.16 +      if ((currentsong->MusicLoaded) && (dwParam1 == (DWORD_PTR)&currentsong->MidiStreamHdr))
    1.17          BlockOut(currentsong);
    1.18        break;
    1.19      case MOM_POSITIONCB:
    1.20 -      if ((currentsong->MusicLoaded) && ((DWORD)dwParam1 == (DWORD)&currentsong->MidiStreamHdr))
    1.21 +      if ((currentsong->MusicLoaded) && (dwParam1 == (DWORD_PTR)&currentsong->MidiStreamHdr))
    1.22          currentsong->MusicPlaying=0;
    1.23        break;
    1.24      default:
    1.25 @@ -181,7 +181,7 @@
    1.26    MMRESULT merr;
    1.27    HMIDISTRM MidiStream;
    1.28  
    1.29 -  merr=midiStreamOpen(&MidiStream,&MidiDevice,1,(DWORD)&MidiProc,0,CALLBACK_FUNCTION);
    1.30 +  merr=midiStreamOpen(&MidiStream,&MidiDevice,(DWORD)1,(DWORD_PTR)MidiProc,(DWORD_PTR)0,CALLBACK_FUNCTION);
    1.31    if (merr!=MMSYSERR_NOERROR)
    1.32      MidiStream=0;
    1.33    midiStreamClose(MidiStream);