ESC to close map in combat - taint

it seems blizzard have decided to block addons from closing ui panels in combat.

-- We no longer allow addons to show or hide UI panels in combat.
local function CheckProtectedFunctionsAllowed()

fine, i dont use the uipanels, or try to close them. what i do do, because its a bag mod, is raw hook (replace) the CloseBag, and CloseAllBags, functions so i can stop blizzard from closing them all the time.

unfortunately blizzards internal code when you hit escape calls securecall("CloseAllWindows") which i presume is calling CloseAllBags, which taints the execution path (because its now my code not theirs), and as soon as it gets to the bit where it tries to close a uipanel (the map frame for example) it checks and sees the path is tainted and barfs, but at least it barfs nicely, just a text warning, not the blocked popup, but obviously doesnt close the panel.

i cant see a workaround for this? unless i no longer hook the close functions. and im guessing its going to impact every bag mod.

if blizzard are going to lock stuff down then i really wish they add pre/post calls to these things, like theyve done for the tooltips, so we dont need to hook them and we can safely abort the action without causing tainting in the pre call.

11/19 10:03:43.469  Execution tainted by ArkInventory while reading ArkInventory - Interface/AddOns/ArkInventory/Core/ArkInventoryStorage.lua:339 ?()
11/19 10:03:43.469      Interface/AddOns/ArkInventory/Libs/CallBackHandler/CallbackHandler-1.0.lua:119
11/19 10:03:43.469      xpcall()
11/19 10:03:43.469      Interface/AddOns/ArkInventory/Libs/CallBackHandler/CallbackHandler-1.0.lua:29 Dispatch()
11/19 10:03:43.469      Interface/AddOns/ArkInventory/Libs/CallBackHandler/CallbackHandler-1.0.lua:64 Fire()
11/19 10:03:43.469      Interface/AddOns/ArkInventory/Externals/Ace3/AceEvent/AceEvent-3.0.lua:120
11/19 10:03:43.469  Execution tainted by ArkInventory while reading ArkInventory - Interface/AddOns/ArkInventory/Core/ArkInventoryStorage.lua:340 ?()
11/19 10:03:43.469      Interface/AddOns/ArkInventory/Libs/CallBackHandler/CallbackHandler-1.0.lua:119
11/19 10:03:43.469      xpcall()
11/19 10:03:43.469      Interface/AddOns/ArkInventory/Libs/CallBackHandler/CallbackHandler-1.0.lua:29 Dispatch()
11/19 10:03:43.469      Interface/AddOns/ArkInventory/Libs/CallBackHandler/CallbackHandler-1.0.lua:64 Fire()
11/19 10:03:43.469      Interface/AddOns/ArkInventory/Externals/Ace3/AceEvent/AceEvent-3.0.lua:120
11/19 10:03:46.124  Execution tainted by ArkInventory while reading CloseAllBags - Interface/FrameXML/UIParent.lua:3372
11/19 10:03:46.124      securecall()
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:4022 ToggleGameMenu()
11/19 10:03:46.124      TOGGLEGAMEMENU:1
11/19 10:03:46.124  Execution tainted by ArkInventory while reading CloseBag - Interface/FrameXML/ContainerFrame.lua:1977
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:3372
11/19 10:03:46.124      securecall()
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:4022 ToggleGameMenu()
11/19 10:03:46.124      TOGGLEGAMEMENU:1
11/19 10:03:46.124  Execution tainted by ArkInventory while reading CloseBag - Interface/FrameXML/ContainerFrame.lua:1977
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:3372
11/19 10:03:46.124      securecall()
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:4022 ToggleGameMenu()
11/19 10:03:46.124      TOGGLEGAMEMENU:1
11/19 10:03:46.124  Execution tainted by ArkInventory while reading CloseBag - Interface/FrameXML/ContainerFrame.lua:1977
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:3372
11/19 10:03:46.124      securecall()
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:4022 ToggleGameMenu()
11/19 10:03:46.124      TOGGLEGAMEMENU:1
11/19 10:03:46.124  Execution tainted by ArkInventory while reading CloseBag - Interface/FrameXML/ContainerFrame.lua:1977
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:3372
11/19 10:03:46.124      securecall()
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:4022 ToggleGameMenu()
11/19 10:03:46.124      TOGGLEGAMEMENU:1
11/19 10:03:46.124  Execution tainted by ArkInventory while reading CloseBag - Interface/FrameXML/ContainerFrame.lua:1977
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:3372
11/19 10:03:46.124      securecall()
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:4022 ToggleGameMenu()
11/19 10:03:46.124      TOGGLEGAMEMENU:1
11/19 10:03:46.124  Execution tainted by ArkInventory while reading INTERFACE_ACTION_BLOCKED_SHOWN - Interface/FrameXML/UIParent.lua:5234 DisplayInterfaceActionBlockedMessage()
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:3131 CheckProtectedFunctionsAllowed()
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:3167 HideUIPanel()
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:3335 CloseWindows()
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:3373
11/19 10:03:46.124      securecall()
11/19 10:03:46.124      Interface/FrameXML/UIParent.lua:4022 ToggleGameMenu()
11/19 10:03:46.124      TOGGLEGAMEMENU:1
1 Like

Maybe I’m missing something:

/run hooksecurefunc(ContainerFrame1, "Hide", function(self) if not InCombatLockdown() then ShowUIPanel(self) end end)

or are you wanting to keep the bags open in combat?

I guess you could posthook all the bag open / close functions, remember their state, and re-open the bags again whenever a non-user-input closes the bags?

hooking the container frame close wont help as they probably wont be visible so wont trigger.

its a bag replacement mod so presume the blizzard bag frames will never be shown

keeping my bag open when you enter combat is an option the user can enable. im not actually touching the container frames because ive blocked them from ever showing in the first place so my frame can be shown instead.

same thing for the close, i’ve taken control of that as its the only was to know when the game wants the bags closed which it does by calling one of the CloseBag functions. im just making sure that my frame is closed only when the user wants it to be closed.

my frame can optionally be added to the list of special frames to close on escape - and it still closes if you do (that part appears to be unsecure).

to stop the uipanels from being closed in combat by user code blizzard went and locked down CloseAllWIndows but that does more than just close uipanels. they could have locked down (and they already did) all of the uipanel functions, so im not sure why this extra step was needed.

i could but that would flicker (both mine and the default frames) and potentially be visually irritating for some users. it could also re-sort as well if the user has sort on open set.

If you post hook the same function that opened it, it should close it again before the frame even renders.

i just double checked what im doing in the close functions on the presumption that i could move it elsewhere but its nothing but debug output so i presume i’ve already moved whatever was in there to somewhere else and left the debug behind because it wasnt causing any issues.

so i can stop replacing the close functions and my mod will no longer cause taint issues there.

hopefully it might help someone else if they run into the issue.

1 Like