View Single Post
04-13-13, 01:30 PM   #12
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
There are three main categories of protected functions, and some functions may fall into multiple categories, or may behave differently under different circumstances.

1. Functions that are completely protected, and can only be called by Blizzard code. There is probably no point in including functions like CastSpellByName that are always in this category, since they cannot be used by addons.

2. Functions that can only be called by addons out of combat, like CancelPlayerBuff.

3. Functions that require a hardware event, but do not require a secure code path, like ReportPlayer.

Some functions, like CancelPlayerBuff, are both restricted to non-combat usage and require a hardware event.

Functions that fall into Category 1 only under some circumstances should probably be included, with notes. For example, AcceptBattlefieldPort cannot be called to leave a battleground queue through a tainted code path, which is why users of my addon Broker_LFG cannot leave battleground queues while the addon is enabled -- the menu is tainted because it's opened from the Broker plugin instead of the minimap icon.

The main problem is that the "PROTECTED" label is used for all of these functions, even though what it actually means can differ greatly. You'd have to go through them one by one and figure out what kind of protection applies to each function.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote