Code: Select all
Interface tmpI
p1()
p2()
p3()
p4()
EndInterface
Procedure Dummy()
Static c
c + 1
Debug Str(c)+"!"
EndProcedure
*VarI = AllocateMemory(SizeOf(tmpI))
PokeI(*VarI + OffsetOf(tmpI\p1()), @Dummy())
PokeI(*VarI + OffsetOf(tmpI\p2()), @Dummy())
PokeI(*VarI + OffsetOf(tmpI\p3()), @Dummy())
PokeI(*VarI + OffsetOf(tmpI\p4()), @Dummy())
*pVarI.tmpI = @*VarI
*pVarI\p1()
*pVarI\p2()
*pVarI\p3()
*pVarI\p4()
CallDebugger
I mean the values given when you stop the mouse over *pVarI.
They are something like p1 = 26783256, p2 = 407603, p3 = 4, p4 = 1 but they should be all the same because they all point to Dummy().
The problem is that the debugger has no information about if "tmpI" is a structure or an interface but structure fields are saved directly at the pointed memory - pointer to interfaces point to an pointer which points to the procedureaddresses.