Quick question. I haven't tried it yet, but does RtlZeroMemory only work with dwords? I tried something like this...

Buffer db 1024 dup (?)

invoke RtlZeroMemory, addr Buffer, sizeof Buffer. ;<------- didn't work

so i tried

invoke RtlZeroMemory, addr Buffer, 1024 ; <------ still didn't work.

Is that because the API will only set dword buffers with zero's? Do i need to do

Buffer db 1024 dup (0)

If i'm doing this all wrong. What should i use to completly erase the info in Buffer and prep it for new info?

All help is appreciated.

Thanks as always,:alright:
Posted on 2001-11-20 21:35:58 by Nokturnal
The function has no way of knowing what the buffer consists of - only what size you state it is.
Posted on 2001-11-20 21:47:44 by bitRAKE
Well thanks for the reply BitRake. But like the old saying goes..."If your not part of the solution, your part of the problem." Problem is, you just confused me even more. How does that help me my friend? Anyone else care to take a shot at it? lol...
Posted on 2001-11-20 22:57:56 by Nokturnal

Its a pretty much "suck it and see" world, easiest way to answer your question is to test it. Try writing a DWORD to receive the data and see if it works. :)


Posted on 2001-11-20 23:46:13 by hutch--
Nokturnal, is Buffer inside a ".data?" or a ".data", or is it outside
a segment definition? (I guess masm should bitch if it's outside...)

And when you say ";<------- didn't work", what do you mean?
Assembly, link, or run-time error? Be more specific :).
Posted on 2001-11-20 23:51:10 by f0dder
Nokturnal, I suppose you want some code. Problem is that I was at work when I posted. Your question (& comment :)) demonstrates a fundamental lack of understanding - your perception of what is known during runtime is in error. IMHO. Only the assembler 'knows' that a data type is of that type, and some assemblers don't even make that distinction. Is this any more help to you - I'd hate to be causing you any problems. :)

p.s. I haven't tried it either. :) I use rep stosd, or GMEM_ZEROINIT

Buffer db 1024 dup (?)


lea edi,Buffer
mov ecx,(SIZEOF Buffer)/4
xor eax,eax
rep stosd

Size_of_Buffer EQU 1024
pBuffer dd ?


invoke GlobalAlloc, GPTR, Size_of_Buffer
mov pBuffer,eax
Now it seems the only thing I missed was your original question?
...the quick one. :)
Posted on 2001-11-21 00:27:37 by bitRAKE
Thanks guys. BitRake, Hutch, & F0dder. You must understand that i started learning assembly when i picked up the MASM32 package. Crazy eh? So you can imagen, when i don't understand something, it's because i'm not a *true* assembly coder like most. I learn by trial and error. This is because i don't have the patiants to truely learn the assembly lang, simply because as i've been told, it has evolved into so much more on the win32 platform. Even though i really should understand the basic funamentals of the lang. I know enough to get me by. It's just the little things that throw me off from time to time. None the less. I tested and found my error. Good old human error ;). Too bad it's not that simple all the time.

Take care & thanks again,
Posted on 2001-11-21 01:40:05 by Nokturnal
May be you should use "ZeroMemory" instead of "RtlZeroMemory". As far as I know some of the "Rtl" functions dont work in Win9x.
Posted on 2001-11-21 03:31:36 by japheth

#define MoveMemory RtlMoveMemory
#define CopyMemory RtlCopyMemory
#define FillMemory RtlFillMemory
#define ZeroMemory RtlZeroMemory

So, the "short names" are just equates for the "long names", and
they do exist under win9x. At least they're in my w98se kernel32.dll :).
Posted on 2001-11-21 09:33:32 by f0dder

you know what's really confusing me? i use the function RtlZeroMemory without any problems with BYTE and DWORD buffers. what could be noks problem, if the same code doesn't work for him??

nok, i'll send you some code by e-mail this evening (it's now 13:00 here). or meet me in about 5 hours since the time of that posting in icq....

Posted on 2001-11-22 05:56:53 by NOP-erator