News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

File Mapping

Started by Antihaxer, March 14, 2009, 04:52:56 PM

Previous topic - Next topic

Antihaxer

I am using file mapping to get text from a file and I am having problems with the file mapping over writing my other variables in my program.  How would I fix this?  Below is my current code.
invoke CreateFile,addr FilePath,GENERIC_READ,0,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0
mov hFile,eax
invoke GetFileSize,hFile,0
mov FileSize,eax
invoke CreateFileMapping,hFile,0,PAGE_READONLY,0,0,0
mov hMap,eax
invoke MapViewOfFile,hMap,FILE_MAP_READ,0,0,0
mov hMapView,eax
invoke UnmapViewOfFile,hMapView
invoke CloseHandle,hMap
invoke CloseHandle,hFile

Antihaxer


ecube

can you post the fix please, so others can benefit, thanks,

Antihaxer

Quote from: E^cube on March 14, 2009, 10:20:32 PM
can you post the fix please, so others can benefit, thanks,
I thought the file being mapped was fucking up my buffers, but it was actually another code segment that was doing it.  The code I posted works perfectly fine.