Hi,
I've seen RtlZeroMemory written like this:
RtlZeroMemory(buffer,LEN(buffer))
and this:
RtlZeroMemory(&buffer,LEN(buffer))
Does it make a difference to have the '&' in there. Or, more correctly, what is the difference?
Brian
the declaration of rtlzeromemory says that the first parameter is a pointer to memory and the second parameter is the length of that memory
when you see it like this
RtlZeroMemory(buffer,LEN(buffer))
buffer has been defined as either a STRING,ISTRING,WSTRING, or some structure type
that's because all of those type of variables are passed as pointers
when you see it like this
RtlZeroMemory(&buffer,LEN(buffer))
buffer has been declared as something other than the above like
int buffer
float buffer
etc
since those types are passed by value you have to use the & to force the variable to be passed by reference to the memory location (POINTER)
hope that makes sense
That makes great sense, Larry - thank you
Brian