[Mono-dev] MapViewOfFile - I think there is a bug

Paul F. Johnson paul at all-the-johnsons.co.uk
Wed Sep 28 07:30:41 EDT 2005


According to MSDN, MapViewOfFile should be

LPVOID MapViewOfFile(
  HANDLE hFileMappingObject,
  DWORD dwDesiredAccess,
  DWORD dwFileOffsetHigh,
  DWORD dwFileOffsetLow,
  SIZE_T dwNumberOfBytesToMap

I have some code which looks like this

dataView = MapViewOfFile(dataMap, FILE_MAP_WRITE, 0, 0, (UIntPtr)BUFFERLEN);

This won't compile (can't convert from int to System.UIntPtr). As I
understand it though, if I remove (UIntPtr) from before BUFFERLEN, this
should then happily compile. However, it doesn't. 

dataMap is an IntPtr

Is this something that needs to go into Bugzilla?


"Logic, my dear Zoe, is merely the ability to be wrong with authority" -
Dr Who

More information about the Mono-devel-list mailing list