Hi,
I am having trouble with the following macro while releasing COM interfaces:
SafeRelease(%ppt) MACRO
mov ecx,[%ppt]
test ecx, ecx
jz >
mov eax,[ecx]
add eax, 8
call [eax]
:
endm
Here is the portion of the CoInvoke macro after parameters have been pushed:
push [%pInterface]
mov eax, [%pInterface]
mov eax,[eax]
add eax, %Method
call [eax]
This is code taken directly from the GoAsm headers (minus the x64 portion). When I use the SafeRelease macro GoAsm throws this error:
There was a backward short jump to nowhere:-
jz 1
If I use the actual fragment (and not the macro) GoAsm does not throw an error, and the listing itself appears to contain what it should. I have not yet tested to see if it actually works.
The other question I have is why the contents of the interface ptr are pushed onto the stack in the CoInvoke macro but not in the SafeRelease macro. Both are calling a COM method, right? When calling a Release method, should the pointer be cleared afterwards? It doesn't seem like SafeRelease does that.
Does anybody have any ideas?
Thank you.