I created a mapped file, and mapview of a file as follows

hMap=CreateFileMapping(hFile, 0, PAGE_READWRITE, 0,0,0);
lpBaseAddr=(LPBYTE)MapViewOfFile(hMap,FILE_MAP_WRITE,0,0,0);
pImgHdr=Checksummapfile(lpBaseAddr,nFileSize,&dwOldSum,&dwNewSum);


The third line in debuging produces error of Access Violation.
Could someone who knows about this offers me some guidance please ?

Thank you.