I now know that this is not vise:
INVOKE SomeApi,eax
(Gives a GPF on Win2k)
But is this always safe:
INVOKE SomeApi,(POINT ptr ).x
Does anyone know the rules here?
:confused:
INVOKE SomeApi,eax
(Gives a GPF on Win2k)
But is this always safe:
INVOKE SomeApi,(POINT ptr ).x
Does anyone know the rules here?
:confused:
As far i can know, there is absolutely no possibility for
any problem with this. If 'invoke' does what it is supposed
to do, this mean:
- push this Parameter
- push this other one
- ...
- call the jumps table Adress of this Function.
Whatever you push is pushed. No matter if it is an immediate,
a Value in memory, an address or a Register. There is no way
for the called function to know where the value on the stack
comes from. This is nothing else than a number written on the
Stack.
I hav many
> call 'THISDLL.ThatFunction' eax
in SpAsm, and i never encouted problems with this under 2000.
So, your 'eax error' comes from something else (before).
betov.
________________________________
Thanks for supporting M$ software, keep on the good work.
Bill Gates.
any problem with this. If 'invoke' does what it is supposed
to do, this mean:
- push this Parameter
- push this other one
- ...
- call the jumps table Adress of this Function.
Whatever you push is pushed. No matter if it is an immediate,
a Value in memory, an address or a Register. There is no way
for the called function to know where the value on the stack
comes from. This is nothing else than a number written on the
Stack.
I hav many
> call 'THISDLL.ThatFunction' eax
in SpAsm, and i never encouted problems with this under 2000.
So, your 'eax error' comes from something else (before).
betov.
________________________________
Thanks for supporting M$ software, keep on the good work.
Bill Gates.
Masm somtimes gives the errormessage:
Register overwritten by invoke
Are you shure eax is not used for adress calculations in
Masm because doing this solved the problem:
mov val,eax
invoke SomeApi,val
KetilO
Register overwritten by invoke
Are you shure eax is not used for adress calculations in
Masm because doing this solved the problem:
mov val,eax
invoke SomeApi,val
KetilO
KetilO,
MASM uses eax register for address calculation on
only when you use ADDR operator for variable
defined in stack ( May be a param or local ). In
that case it will give you the error message. In
other situation using eax register in the invoke
will do no harm.
MASM uses eax register for address calculation on
only when you use ADDR operator for variable
defined in stack ( May be a param or local ). In
that case it will give you the error message. In
other situation using eax register in the invoke
will do no harm.
_________________________________________
"...Masm because doing this solved the problem:
mov val,eax
invoke SomeApi,val"
_________________________________________
... This would be highly surprising... Are you sure you are
sending a value?
If yes, write:
nop
nop
nop
invoke SomeApi, eax
and run a disassembler to see what was really done...
betov.
"...Masm because doing this solved the problem:
mov val,eax
invoke SomeApi,val"
_________________________________________
... This would be highly surprising... Are you sure you are
sending a value?
If yes, write:
nop
nop
nop
invoke SomeApi, eax
and run a disassembler to see what was really done...
betov.
I just looked into the problem, and yes you are right.
I had also added "uses ebx" and completly forgot that
I did. So my confident in Masm doing things right is restored.
Thanks for your replies.
I had also added "uses ebx" and completly forgot that
I did. So my confident in Masm doing things right is restored.
Thanks for your replies.