What the quickest method to clear out a buffer.

ASSUME buffer is used for storing strings.

Any help or examples appreciated.
Posted on 2003-01-04 18:01:07 by IwasTitan
RtlZeroMemory

Cheers,
Jimmy
Posted on 2003-01-04 18:33:42 by JimmyClif
I use these two, I think Qages may be the fastest but have seen a few strange things once under difference situations
but bitRake is fail proof and fast. I clean a 1000000 byte buffer in a split second i guest Both need to be tested because i
would like to know also. Qages cleanbuff should be looked into for speed i think.


;................................... ; Qages cleanbuff
; mov eax, offset r_BUFFER_RESOLUTION
; xor ebx,ebx
; mov BYTE PTR ,0
; @@:
; inc ebx
; mov BYTE PTR ,0
; cmp ebx,9 ;;;SIZEOF r_BUFFER_RESOLUTION -1
; jne @B


; ....................... bitRake cleanbuff
; xor eax,eax
; mov edi, offset r_BUFFER_RESOLUTION
; mov ecx,9
; rep stosb
Posted on 2003-01-04 18:33:47 by cmax
If you use it only for zero terminated string and with zero terminated string function you can simply "erase" the string by putting a null character at the beginning of it...

That is not a real erasing, that just make believe the string functions that the string is *empty*.
Posted on 2003-01-04 19:30:02 by JCP
Thanx all for rapid replies.

:alright:
Posted on 2003-01-04 20:14:07 by IwasTitan