Originally Posted by thinktink
Is there a way I can directly access/call/use that CRITICAL_SECTION object outside of ::SendMessageW(winampHWnd,...) mechanism? I need to be able to call these functions directly for speed reasons (and to minimize thread dead-locks) for a particular chain of functions that call it repeatedly.
The critical section is required because many plugins implement a cache of the most recently queried file's metadata, and do so in an unsafe way.
There is a Wasabi API called api_metadata. I think it's in the SDK somewhere. That essentially calls into the same function that the SendMessage(IPC_GET_EXTENDED_FILE_INFOW) API does, but without the SendMessage overhead. ml_local uses it for metadata reading, for example.
There's also an old Winamp3 API (and available in winamp 5 for compatibility reasons) that can be used for thread-safe metadata reading without hitting the critical section, but only in_mp3 and in_wmvdrm implement it. I can dig up details on it if you need.
For Winamp-for-Android (And the formerly in-progress Winamp 6 project), there is a much better metadata API, if only ...