BTW, when some error happened invoking API function the error number stored in ecx. This can avoid us to use GetLastError :)
Posted on 2002-09-19 13:27:08 by masquer

BTW, when some error happened invoking API function the error number stored in ecx. This can avoid us to use GetLastError :)


Really ?

That's good to know. Thanks a lot for that info.

(Question is now: What does GetLastError do besides copying ecx to eax?)
Posted on 2002-09-19 14:00:44 by JimmyClif


(Question is now: What does GetLastError do besides copying ecx to eax?)




GetLastError proc near
mov eax, large fs:18h
mov eax, [eax+34h]
retn
GetLastError endp


For sure we can do it faster :)
Posted on 2002-09-19 22:51:24 by masquer

Yeah, that's pretty much the understanding I got gliptic. Basically, your functions should treat ebx, esi and edi just like they treat ebp.


Okay,
It didn't sound that way when I read the post.
Posted on 2002-09-20 08:17:47 by gliptic
No problem at all.

More explanation = good. :)
Posted on 2002-09-20 12:37:15 by Thanatos
In compilers, we make a distinction between callee-saved registers and caller-saved registers.

Callee-saved registers -- saved by the called function (e.g., callbacks, API) if used
EBX, ESI, EDI, EBP

Caller-saved registers -- saved by caller if it needs the values after function return
EAX, ECX, EDX
Posted on 2002-09-20 15:24:40 by tenkey