CopyMemory, MoveMemory, ZeroMemory lazarus / 43-Android ---------------------------------------------------------------------- roeug · 2012-10-22 10:55 How make CopyMemory, MoveMemory, ZeroMemory available in porting from Win? ---------------------------------------------------------------------- Leledumbo · 2012-10-22 11:18 Use the respective Pascal (platform independent ones): CopyMemory -> Move(,,);MoveMemory -> doesn't really exist, do you really need to?ZeroMemory -> FillByte(,,0); ---------------------------------------------------------------------- Laksen · 2012-10-22 13:20 Quote from: Leledumbo on October 22, 2012, 01:18:29 pmUse the respective Pascal (platform independent ones): CopyMemory -> Move(,,);MoveMemory -> doesn't really exist, do you really need to?ZeroMemory -> FillByte(,,0);It's the other way around. MoveMemory is the equivalent of the Pascal Move function. CopyMemory has no equivalent and is inherently unsafe, and should be replaced with Move ---------------------------------------------------------------------- roeug · 2012-10-24 06:25 Thanks (Could find myself -  was in hurry) Another question: File routines? In windows they were CreateFile GetFileSize CreateFileMapping MapViewOfFile UnmapViewOfFile CloseHandle( THandle from CreateFileMapping) SetFilePointer +AccessMode Where can I find analogs in lazarus ?  TMemoryStream - ok ---------------------------------------------------------------------- Leledumbo · 2012-10-24 12:14 QuoteAnother question: File routines?Classic: http://www.freepascal.org/docs-html/rtl/system/filefunctions.html Modern: http://www.freepascal.org/docs- html/rtl/sysutils/ioroutines.html OOP: http://www.freepascal.org/docs-html/rtl/classes/tfilestream.html ---------------------------------------------------------------------- Laksen · 2012-10-24 13:25 File mapping is very platform specific. On windows you have MapViewOfFile, while on a POSIX system you can use mmap. I don't know if anyone has made a crossplatform unit for that, but it should be possible. Otherwise you can fall back on streams