var<br> hwd, FSize, hMap: Cardinal;<br> pData: PChar;<br> bu: array[0..1024]of Char;<br> i: integer;<br>begin<br> hwd:= CreateFile('C:/TrustMe.dat', GENERIC_READ or GENERIC_WRITE,FILE_SHARE_READ or FILE_SHARE_WRITE, nil,<br> OPEN_EXISTING, 0, 0);<br> if hwd = INVALID_HANDLE_VALUE then RaiseLastWin32Error<br> else try<br> FSize:= GetFileSize(hwd, nil);<br> hMap:= CreateFileMapping(hwd,nil,PAGE_READONLY,0,FSize,nil);<br> if hMap = 0 then RaiseLastWin32Error<br> else try<br> pData:= MapViewOfFile(hMap, FILE_MAP_READ,0,0,FSize);<br> if pData = nil then RaiseLastWin32Error<br> else try<br> ZeroMemory(@bu[0], SizeOf(bu));<br> MoveMemory(@bu[0], pData, 1024);<br> for i:= 0 to 1024 do<br> bu:= bu xor 1022;<br> finally<br> UnMapViewOfFile(pData);<br> end;<br> finally<br> CloseHandle(hMap);<br> end;<br> finally<br> CloseHandle(hwd);<br> end;<br>end;