this sux

mov FileCount,0
mov ecx,5
inc FileCount
inc ecx
PrintDec ecx

invoke FindNextFile,hNFile,ADDR W32FD
.IF eax!=0
jmp @B
mov ebx,FileCount
PrintDec ebx
invoke FindClose,hNFile

Or maby sth is wrong with my code
Posted on 2003-05-31 08:35:18 by AceEmbler
it doesn't 'suck', it's normal :)

APIs are not supposed to preserve you ECX, so they can change it. If you use ECX in a loop or whatever you're supposed to preserve it for the duration of the API call (push ecx before call, pop ecx after call)

push ecx
invoke FindNextFile,hNFile,ADDR W32FD
pop ecx
Posted on 2003-05-31 08:44:43 by Hiroshimator
api do not preserve eax,ecx and edx. Bear in mind when doing coding. :)
Posted on 2003-05-31 09:09:53 by roticv