MASM - HeapAlloc throws exception

360 views Asked by At

I'm here again. I'm using masm .dll in c# application, but now my code throws 'System.AccessViolationException' in line: INVOKE HeapAlloc, edx, 0, <size> Can you tell me what cause problem?

Here is my ASM code:

invoke GetProcessHeap
mov edx, eax
INVOKE HeapAlloc, edx, 0,  dlText
mov tab, eax
INVOKE HeapAlloc, edx, 0,  dlText
mov wynik, eax
1

There are 1 answers

0
Asker On

I found the cause of error. I was using edx instead of ebx ;)