Reputation: 507
Where exactly does the address space get blocked for the MMF in the process of creating and mapping the MMF in Windows CE. Is it during the creation of MMF or when the view is getting mapped? Will the creation succeed only if there is a contiguous space of x (specified during creation) in virtual address space?
Secondly, is it possible to map a part of file in win CE like we do in win32. If I create a MMF with 0x8000 bytes and map a view of the file giving an offset of 0x5000 and size of 0x7000, the mapping is failed. It says INVALID_PARAMETER. Although the mapping is allowed when sum of offset and size of the view is less than 0x8000. Does it always get mapped from beginning of the file?
Upvotes: 0
Views: 850
Reputation: 7843
In Windows Mobile 6.x (CE 5.0), Memory mapped files are stored in the Large Memory Area above 0x42000000 in the virtual address space.
Yes, you need contiguous space to successfully allocate a MMF.
0x5000 + 0x7000 = 0xC000. That's larger than the allocated space of 0x8000 bytes.
-PaulH
Edit
Also, the offset must be a multiple of your system's allocation granularity. Use GetSystemInfo
to find that value. On one device I have, for instance, it is 0xa11 bytes.
Upvotes: 1