I run into problems during the ‘bypasspersistence’ tests in the validator.exe.
It uses PresetFile::savePreset() to save the parameters.
I have verified that my state is save correctly (memory debugger) during setState().
Then later uses PresetFile::loadPreset() (vstpresetfile.cpp: 144) to retrieve them again (and test if the bypass parameter has a correct value).
As far as I could track it down the PresetFile::readChunkList() is the call that reads the entire stream - the first call loadPreset makes.
Later, the PresetFile::restoreControllerState() (vstpresetfile.cpp: 544) call creates a ReadOnlyBStream around the stream with correct offset (and length). But it does not reposition the stream to the start of its offset (which would fix the issue). Then calls into the plugin with IEditController::setState() with the stream position at the end - which fails in my plugin.
Bug or am I doing it wrong?