@@ -26,7 +26,6 @@ static DWORD DrvMajor = 0, DrvMinor = 0, DrvBuild = 0, DrvRevision = 0;
2626// OM funcs
2727static LARGE_INTEGER frequency = { 0 }; // QPC Frequency
2828static HMODULE OM = NULL ; // OM lib
29- static BOOL IsCallbackWindow = FALSE; // WMMC
3029static DWORD_PTR OMUser ; // Dummy pointer, used for KDMAPI Output
3130static HMIDI OMDummy = 0x10001 ; // Dummy pointer, used for KDMAPI Output
3231static VOID (WINAPI * SCE )(DWORD , DWORD , DWORD ) = 0 ; // SendCustomEvent
@@ -374,20 +373,19 @@ MMRESULT WINAPI KDMAPI_midiOutOpen(LPHMIDIOUT lphmo, UINT uDeviceID, DWORD_PTR d
374373 WMMC = (void * )dwCallback ;
375374 WMMCI = dwCallbackInstance ;
376375
377- IsCallbackWindow = (dwFlags == CALLBACK_WINDOW );
378- if (WMMC ) WMMC ((* lphmo ), IsCallbackWindow ? MM_MOM_OPEN : MOM_OPEN , WMMCI , 0 , 0 );
376+ if (WMMC ) WMMC ((* lphmo ), MM_MOM_OPEN , WMMCI , 0 , 0 );
379377 }
380378
381379 return MMSYSERR_NOERROR ;
382380}
383381
384382MMRESULT WINAPI KDMAPI_midiOutClose (HMIDIOUT hMidiOut ) {
385383#ifdef _DAWRELEASE
386- if (hMidiOut = = OMDummy ) return MMOutClose (hMidiOut );
384+ if (hMidiOut ! = OMDummy ) return MMOutClose (hMidiOut );
387385#endif
388386 // Close OM
389387 if (!TOMS ()) return MMSYSERR_INVALHANDLE ;
390- if (WMMC ) WMMC (hMidiOut , IsCallbackWindow ? MM_MOM_CLOSE : MOM_CLOSE , WMMCI , 0 , 0 );
388+ if (WMMC ) WMMC (hMidiOut , MM_MOM_OPEN , WMMCI , 0 , 0 );
391389 hMidiOut = (HMIDI )0 ;
392390 return MMSYSERR_NOERROR ;
393391}
@@ -427,7 +425,7 @@ MMRESULT WINAPI KDMAPI_midiOutLongMsg(HMIDIOUT hMidiOut, MIDIHDR* lpMidiOutHdr,
427425 MMRESULT Ret = SDLD (lpMidiOutHdr );
428426
429427 // Inform the app that the driver successfully received the long message (Required for vanBasco to work), and return the MMRESULT
430- if (WMMC ) WMMC (hMidiOut , IsCallbackWindow ? MM_MOM_DONE : MOM_DONE , WMMCI , lpMidiOutHdr , lpMidiOutHdr -> dwBufferLength );
428+ if (WMMC ) WMMC (hMidiOut , MM_MOM_DONE , WMMCI , lpMidiOutHdr , lpMidiOutHdr -> dwBufferLength );
431429
432430 return Ret ;
433431}
@@ -552,7 +550,7 @@ MMRESULT WINAPI KDMAPI_midiStreamOpen(LPHMIDISTRM lphStream, LPUINT puDeviceID,
552550 return retval ;
553551 }
554552 }
555- #else
553+ #endif
556554 * lphStream = OMDummy ;
557555
558556 MIDIOUTCAPSW myCapsW = { 0 };
@@ -569,7 +567,6 @@ MMRESULT WINAPI KDMAPI_midiStreamOpen(LPHMIDISTRM lphStream, LPUINT puDeviceID,
569567
570568 // Everything is oki-doki
571569 return retval ;
572- #endif
573570}
574571
575572MMRESULT WINAPI KDMAPI_midiStreamClose (HMIDISTRM hStream ) {
@@ -618,7 +615,7 @@ MMRESULT WINAPI KDMAPI_midiStreamStop(HMIDISTRM hStream) {
618615
619616MMRESULT WINAPI KDMAPI_midiStreamProperty (HMIDISTRM hStream , LPBYTE lppropdata , DWORD dwProperty ) {
620617#ifdef _DAWRELEASE
621- if (hStream = = OMDummy ) return MMStreamProperty (hStream , lppropdata , dwProperty );
618+ if (hStream ! = OMDummy ) return MMStreamProperty (hStream , lppropdata , dwProperty );
622619#endif
623620 // Pass the prop. data to modMessage
624621 return mM (0 , MODM_PROPERTIES , OMUser , lppropdata , dwProperty );
0 commit comments