I'm sure this is very late for the OP, but maybe it will help someone else:
As Alan said, on CE 5.0, each process is limited to 32MB of address space. However, you can get around that and allocate large blocks of memory by using the Windows VirtualAlloc and VirtualFree funtions. To allocate memory in the shared memory space (which has 1 GB of address space in CE... more than enough for the i.MX31,) use the following 2 calls to VirtualAlloc():
byte* buff = (byte*)VirtualAlloc(NULL, <number of bytes to alloc>, MEM_RESERVE, PAGE_NOACCESS);
if (buff != NULL) // check to make sure the first call succeeded before making second call!
{
buff = (byte*) VirtualAlloc(buff, <number of bytes to alloc>, MEM_COMMIT, PAGE_READWRITE);
}
Note that the last 2 parameters MUST be the values shown here for the memory to be correctly allocated outside of the process' memory space. Also, the buffer size must be at least 2 MB in order for it to be allocated outside of the process' space, IIRC. Here's the MSDN documention for the functions:
VirtualAlloc:
http://msdn.microsoft.com...ibrary/aa450975.aspx
VirtualFree:
http://msdn.microsoft.com...ibrary/aa450979.aspx
Note that to do this inside a .NET CF application, you will need to P/Invoke these functions. The P/Invoke declarations are as follows:
[DllImport("coredll.dll")]
public static extern bool VirtualFree(void* lpAddress, uint dwSize, VirtualFreeFlags flags);
[DllImport("coredll.dll")]
public static extern void* VirtualAlloc(void* lpAddress, uint dwSize, VirtualAllocType type, VirtualAllocFlags flags);
public enum VirtualFreeFlags : uint
{
MEM_DECOMMIT = 0x4000,
MEM_RELEASE = 0x8000
}
public enum VirtualAllocType : uint
{
MEM_COMMIT = 0x1000,
MEM_RESERVE = 0x2000,
MEM_RESET = 0x80000,
MEM_TOP_DOWN = 0x100000
}
public enum VirtualAllocFlags : uint
{
PAGE_NOACCESS = 0x01,
PAGE_READONLY = 0x02,
PAGE_READWRITE = 0x04,
PAGE_EXECUTE = 0x10,
PAGE_EXECUTE_READ = 0x20,
PAGE_EXECUTE_READWRITE = 0x40,
PAGE_EXECUTE_WRITECOPY = 0x80,
PAGE_GUARD = 0x100,
PAGE_NOCACHE = 0x200
}