Code: Select all
ahk := ComObject("AutoHotkey2.Script")
threadid := ahk.NewThread("Persistent`na := 0 ")
Sleep 100
ahk.ahkAssign(threadid, 'a', [55])
c++source
https://github.com/thqby/AutoHotkey_H/blob/v2.0-beta.3-COM/source/COMServer.cpp#L197
An object outside a dll module enters the dll module of the same thread through the com interface, and then
ThreadLocalStoragePointer of the DLL module has been replaced with another thread, and then calls
QueryInterface, and the thread local variables are overwritten. But unable to find the source of this rewritten thread local variable from the known threads.
Perhaps the new thread local variable from the exe module in the thread corresponding to the current ThreadLocalStoragePointer.