Sign in to follow this  
Followers 0
Ejoc

DllStructCreate

1 post in this topic

Is there a destructor being called to free a DllStruct if the variable returned from DllStructCreate is set to equal another DllStructCreate? I'm trying to create a link listed, which should be possible using DllStructCreate, but something is not working as I'm expecting it too:

$sNode          = "int;int;int;ptr" 
$node       = DllStructCreate($sNode)
If @Error Then
    MsgBox(0,"","node = DllStructCreate(sNode)")
EndIf
$node_ptr   = DllStructGetPtr($node)
DllStructSetData($node,1,1)
DllStructSetData($node,4,0)
$NodeHead_ptr   = $node_ptr
$NodeHead   = DllStructCreate($sNode,$NodeHead_ptr)
If @Error Then
    MsgBox(0,"","NodeHead = DllStructCreate(sNode,NodeHead_ptr)")
EndIf
MsgBox(0,"",    "node(" & $node_ptr & ") = " & DllStructGetData($node,1) & " " & DllStructGetData($node,4) & @CRLF & _
        "NodeHead(" & $NodeHead_ptr & ") = " & DllStructGetData($NodeHead,1) & " " & DllStructGetData($NodeHead,4))


$node       = DllStructCreate($sNode)
If @Error Then
    MsgBox(0,"","node = DllStructCreate(sNode)")
EndIf
$node_ptr   = DllStructGetPtr($node)
DllStructSetData($node,1,2)
DllStructSetData($node,4,0)
$NodeHead   = DllStructCreate($sNode,$NodeHead_ptr)
If @Error Then
    MsgBox(0,"","NodeHead = DllStructCreate(sNode,NodeHead_ptr)")
EndIf
DllStructSetData($NodeHead,4,$node_ptr)
MsgBox(0,"",    "node(" & $node_ptr & ") = " & DllStructGetData($node,1) & " " & DllStructGetData($node,4) & @CRLF & _
        "NodeHead(" & $NodeHead_ptr & ") = " & DllStructGetData($NodeHead,1) & " " & DllStructGetData($NodeHead,4))


$node       = DllStructCreate($sNode)
If @Error Then
    MsgBox(0,"","node = DllStructCreate(sNode)")
EndIf
$node_ptr   = DllStructGetPtr($node)
DllStructSetData($node,1,3)
DllStructSetData($node,4,0)
$NodeHead   = DllStructCreate($sNode,$NodeHead_ptr)
If @Error Then
    MsgBox(0,"","NodeHead = DllStructCreate(sNode,NodeHead_ptr)")
EndIf

MsgBox(0,"",    "node(" & $node_ptr & ") = " & DllStructGetData($node,1) & " " & DllStructGetData($node,4) & @CRLF & _
        "NodeHead(" & $NodeHead_ptr & ") = " & DllStructGetData($NodeHead,1) & " " & DllStructGetData($NodeHead,4))

Results:

node(6099336) = 1 0

NodeHead(6099336) = 1 0

-As Expected

node(6101672) = 2 0

NodeHead(6099336) = 1 6101672

-As Expected

node(6101112) = 3 0

NodeHead(6099336) = 153 5832864

-Not Expected


Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0