Hi,
I think I have found a problem with the PropertyHandler which dBpoweramp installs. This is causing a knock-on problem in another app that I've been investigating.
I hope I've provided the right level of detail. Let me know if you need anything clarified or if it looks like we're doing something wrong in our code.
Cheers,
Leo
I think I have found a problem with the PropertyHandler which dBpoweramp installs. This is causing a knock-on problem in another app that I've been investigating.
- Background:
The other app is a file manager which includes a metadata/attributes editor. When updating a file's properties, the app first tries the installed IPropertyStore handler, if any. Then, for any remaining properties which the handler rejected, it falls back on a custom storage method.
This way the properties are stored in a way that everything on the system can see where possible, and where not possible we still allow people to use the full set of properties within our app.
- What goes wrong:
With dbPa installed, the IPropertyStore we get for .MP3 files succeeds when we do a SetValue on the Keywords property. (If dbPa is not installed, the default handler returns STG_E_ACCESSDENIED here and we fall-back on our custom storage method.)
After dbPa's handler accepts the value, calling Commit to save the change also returns success.
However, if we then create a new IPropertyStore for the updated file and use GetValue on the same property, an empty property value is returned instead of the value we had just saved.
(If we try calling GetValue on the original IPropertyStore instance, before calling commit, the proper value is returned. So it seems like the SetValue method is keeping the new data in memory, but it is not being correctly saved to disk (and/or loaded from disk). I don't know if the bug is that SetValue accepts a property it shouldn't or that the load/save code doesn't persist the value properly. From our point of view, fixing either would make things work.)
- Test exe and source code
I've written a minimal command-line tool which can be used to reproduce the problem. VS2008 C++ source code, and compiled x86 and x64 exes, are here:
The exes require Vista or above.
If you are on 64-bit Windows, use the 64-bit exe. (It seems on a 64-bit OS dBpa only installs a 64-bit PropertyHandler, leaving 32-bit exes unaffected.)
Run the appropriate exe from a command-line with the full path (not just the name) of an MP3 file as the only argument.
With dBpa installed it will print something like this:
Code:> dBpaPropBug_64bit.exe C:\Test\15-Silent.mp3 File "C:\Test\15-Silent.mp3" GetValue 1 type: 4127 GetValue 2 type: 0
With dBpa not installed (or just reset HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\PropertySystem\PropertyHandlers\.mp3 to normal):
Code:> dBpaPropBug_64bit.exe C:\Test\15-Silent.mp3 File "C:\Test\15-Silent.mp3" SetValue 1 fail: 80030005 GetValue 2 type: 0
I hope I've provided the right level of detail. Let me know if you need anything clarified or if it looks like we're doing something wrong in our code.
Cheers,
Leo
Comment