This project has moved and is read-only. For the latest updates, please go here.

Error initializing buffers when built using Visual Studio 2013

Topics: Possible Bug
Aug 28, 2014 at 11:52 PM
I was using an older version of the library with no problems, but when I built a new machine and tried to compile and run versus the latest version using Visual Studio 2013 under Windows 8.1 64-bit I get an error when I run the app.
The same code built using Visual Studio 2010 under Windows 7 64-bit works fine.
The sample CannedBytes.Midi.MidiFilePlayer fails in the same way.

The problem is with the call to BufferManager.Initialize()

The native call NativeMethods.midiOutPrepareHeader() returns 11 (MMSYSERR_INVALPARAM). This error code is documented as:
"The specified address is invalid or the given stream buffer is greater than 64K."

I stepped into the native code, and it looks like (my assembly reading skills are very rusty) the check for the buffer being less than 64K is failing, and it looks to be looking in the wrong place in the stack. This seems to point to a P/Invoke error but I don't see any problem.

Has anyone else successfully compiled and run using Visual Studio 2013, preferably under Windows 8+?

Any ideas what the problem could be?
Aug 30, 2014 at 7:07 AM
I have not come across this issue and you are the first to report it.
I will look into it.

Aug 30, 2014 at 7:08 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.