I think the thing I find most difficult about asm programming is string manipulation. So I'd appreciate some advice on how to 'break apart' the receive buffer (lpszReturnBuffer param) from the GetPrivateProfileSectionNames function.


lpszReturnBuffer
Points to a buffer that receives the section names associated with the named file. The buffer is filled with one or more null-terminated strings; the last string is followed by a second null character.


thanks
Posted on 2001-11-11 14:19:58 by Will
Hi 4oh4

One way to do it:


GetAppName proc uses esi,lpBuff:DWORD,nInx:DWORD

mov esi,lpBuff
mov eax,nInx
.while eax
.break if byte ptr [esi]==0
push eax
invoke lstrlen,esi
inc eax
add esi,eax
pop eax
dec eax
.endw
mov eax,esi
ret

GetAppName endp


The proc will return a pointer in eax to item nInx.

KetilO
Posted on 2001-11-11 15:21:17 by KetilO
So with an index starting at 0 (nInx), eax would return that string from the array lpBuff?

That looks easy enough. I'll give that a shot.


thanks
Posted on 2001-11-11 15:46:42 by Will