Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: metadb_index_client questions (Read 1620 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

metadb_index_client questions

Hey there!
I'm trying to to implement custom metadb_index_client, but for some reason `metadb_index_manager::get()->add();` fails with invalid argument exception during it's initialization.

The code was mostly (99.99%) copy-pasted from marc2003's foo_jscript_panel (which does not share this problem). The only thing that was changed is GUID for the metadb_index_client to avoid possible collision.
The code in question: https://github.com/TheQwertiest/foo-jscript-panel/blob/master/foo_spider_monkey_panel/stats.h#L46

Any help would be greatly appreciated!

... summons @Peter ...

Re: metadb_index_client questions

Reply #1
init_stages::before_config_read seems awfully early in the process for most services to be available.
The definition of objects with static storage duration in your stats.h seems a bit sketchy as you include that header in multiple translation units and as such, have duplicate registrations of objects.
Stay sane, exile.

Re: metadb_index_client questions

Reply #2
init_stages::before_config_read seems awfully early in the process for most services to be available.
Welp, the code is mostly identical to the official sample:
https://github.com/zao/foo_wave_seekbar/blob/9138c3a79f3a7ed55a6bc6f915c40742a0372631/foobar2000/foo_sample/rating.cpp#L92

Do you know if there is a better example?

The definition of objects with static storage duration in your stats.h seems a bit sketchy as you include that header in multiple translation units and as such, have duplicate registrations of objects.
Yes, this is most likely the cause, thanks!

Re: metadb_index_client questions

Reply #3
Ah, didn't know that was taken directly from foo_sample.
Note that my foo_wave_seekbar repository may not be up to date with the current SDK, but it's assumedly Good Enough.
Stay sane, exile.