Função ZeroMemory

Delphi

28/10/2004

Pessoal... achei isto:

...clear a Varaible from RAM? If you want to erase a variable, that no other program can read it out of the memory anymore, just use this function: ZeroMemory(Addr(yourVar), SizeOf(yourVar)); ZeroMemory(Addr(yourStr), Length(yourStr)); // ZeroMemory(Address of the variable, Size of the variable); Very usefull, if you asked for a password and you want, that nobody other can get it.


Será q após utilizar uma variável eu posso aplicar:
[i:bcf8768609]
ZeroMemory(Addr(yourVar), SizeOf(yourVar));
[/i:bcf8768609]
... com intenção de liberar memória? ... seria isto?

agradecido


Nerdex

Nerdex

Curtidas 0

Respostas

Nerdex

Nerdex

28/10/2004

Fiz um simples teste:
i:=100;
ZeroMemory(Addr(i), SizeOf(i));
label1.caption:=inttostr(i); //resulta zero!

O ´zero´ é MEMÓRIA zerada realmente?


GOSTEI 0
Aroldo Zanela

Aroldo Zanela

28/10/2004

Colega,

The ZeroMemory function fills a block of memory with zeros.



VOID ZeroMemory(

PVOID Destination, // address of block to fill with zeros
DWORD Length // size, in bytes, of block to fill with zeros
);


Parameters

Destination

Points to the starting address of the block of memory to fill with zeros.

Length

Specifies the size, in bytes, of the block of memory to fill with zeros.



Return Values

This function has no return value.


GOSTEI 0
POSTAR