V
Vinh Nguyen Van
Dear Alex Yakhnin
I has downloaded your source code for Memory Mapped File.
I create a sample:
private static void Test(string fileName)
{
MemoryMappedFileStream mStream = new
MemoryMappedFileStream(fileName, "a", 64,
MemoryProtection.PageReadOnly);
byte[] bff = new byte[10];
mStream.Read(bff, 0, 10);
Console.WriteLine();
}
I debug from source code, I see that:
IntPtr hFile = MemoryMappedFileHelper.CreateFileForMapping(fileName,
Win32FileAccess.GENERIC_READ | Win32FileAccess.GENERIC_WRITE,
Win32FileShare.FILE_SHARE_READ | Win32FileShare.FILE_SHARE_WRITE,
IntPtr.Zero, Win32FileMode.OPEN_ALWAYS,
Win32FileAttributes.FILE_ATTRIBUTE_NORMAL, IntPtr.Zero);
uint lastError = MemoryMappedFileHelper.GetLastError();
lastError = 183
When I continue my app to get some bytes from mapped memory, my app
close automatically.
I develop on C#, NetFX 2.0, pocket pc 2003.
Help me please.
Thanks
I has downloaded your source code for Memory Mapped File.
I create a sample:
private static void Test(string fileName)
{
MemoryMappedFileStream mStream = new
MemoryMappedFileStream(fileName, "a", 64,
MemoryProtection.PageReadOnly);
byte[] bff = new byte[10];
mStream.Read(bff, 0, 10);
Console.WriteLine();
}
I debug from source code, I see that:
IntPtr hFile = MemoryMappedFileHelper.CreateFileForMapping(fileName,
Win32FileAccess.GENERIC_READ | Win32FileAccess.GENERIC_WRITE,
Win32FileShare.FILE_SHARE_READ | Win32FileShare.FILE_SHARE_WRITE,
IntPtr.Zero, Win32FileMode.OPEN_ALWAYS,
Win32FileAttributes.FILE_ATTRIBUTE_NORMAL, IntPtr.Zero);
uint lastError = MemoryMappedFileHelper.GetLastError();
lastError = 183
When I continue my app to get some bytes from mapped memory, my app
close automatically.
I develop on C#, NetFX 2.0, pocket pc 2003.
Help me please.
Thanks