I am looking to block plug-in hosts like those that can be loaded in daws as plugins and that can load other plugins. It’s easy to do using this JUCE: PluginHostType Class Reference
but I am not only looking to block app’s and exe, but plugins that are hosts themselves also.
I’m curious what is the reasoning for such “user hostile” behaviour? If I bought a plugin and was arbitrarily blocked from using it however I see fit, unless it was very clearly stated in the pre-sales literature1 that such restrictions are in place I’d be asking for a refund.
1 : people don’t even read the pre-sales literature half the time anyway, get ready for angry support emails.
I’m afraid not, but my gut instinct is that what you’re attempting will not be possible.
I suspect the only way you could test this is by using one of the offending plugin-hosting plugins yourself and DBG the output of PluginHostType::getHostDescription().
That function just creates a string based on the HostType enum, which is itself based on the path of the host.
Generally I don’t think there’s a way to know which dll in a process has loaded your dll. As far the OS is concerned all these calls came from the same process (the DAW executable).
If your goal is to prevent tools like PluginDoctor from loading your plugin, then any block you put in place will not prevent a user from analyzing your plugin. All a user has to do to bypass any block is to simply use the hardware mode in PluginDoctor, which lets them route audio through any DAW that supports your plugin.
If you could successfully block your plugin from being loaded in specific hosts, I would expect to get lots of support tickets from customers saying your plugin is broken, possibly requesting refunds.
The first thing that comes in my mind is to make a function that returns a bool, checking all the allowed host types. Then, in your processBlock, you use that function to enable the process or return the original input (or silence or noise, for example).
Ps: i feel a great The Office reference in your user name