Giriş
İmzası şöyle.
Elimizde şöyle bir kod olsun.
İmzası şöyle.
WriteFile(HANDLE hFile,
LPCVOID lpBuffer,
DWORD nNumberOfBytesToWrite,
LPDWORD lpNumberOfBytesWritten,
LPOVERLAPPED lpOverlapped
);
Açıklaması şöyleDon't use the WIN API WriteFile to try and securely delete. Instead use a secure delete tool like SysInternals sdelete.Örnek
If you just use WriteFile the operating system/file system has the option of writing the new data (e.g., a bunch of null bytes or whatever) to a new block on the disk and then updating the master file table to point to the new block not the old block. You will not be assured that you have overwritten the original file data (unless you use WriteFile to, say, write a file as large as the entire disk).
Elimizde şöyle bir kod olsun.
typedef struct
{
int len;
char data[1];
}Message;
Şöyle yaparız.OVERLAPPED osWriteS = { 0 };
osWriteS.Offset = 0;
osWriteS.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
DWORD bytesSent;
if (WriteFile(serialPortHandle,message.data,message.len,&bytesSent, &osWriteS) == false)
{
_cprintf("bytes sent before overlap: %x\n", bytesSent);
...
}
Hiç yorum yok:
Yorum Gönder