Re: Question regarding MapViewOfFile



Windows Embedded CE 6.0 behaviour is 'more correct': you call MapViewOfFile
with read access and IsBadWritePtr
returns TRUE; look for 'Memory Mapped Files' in this this blog post to see
differences between %.0 and 6.0:
http://blogs.msdn.com/ce_base/archive/2006/11/14/application-compatibility-in-windows-ce-6-0.aspx.



--

Luca Calligaris
www.eurotech.it

"akjuturub04" <akjuturub04@xxxxxxxxx> ha scritto nel messaggio
news:9b2cc0e8-5306-4c25-be17-6d0a75fd6020@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi all,

I am working on HP WBTs. I noticed a question regarding behavior of
MapViewOfFile in WinCE 6 and WinCE 5. I wrote a small program.

hMap = CreateFileMapping( INVALID_HANDLE_VALUE,
NULL,
PAGE_READWRITE,
0,
10,
NULL );
pMap = MapViewOfFile( hMap, FILE_MAP_READ, 0, 0, 0 );
read = IsBadReadPtr(pMap,10);
write = IsBadWritePtr(pMap,10);
_stprintf(a,L"read : %d, write : %d ",read,write);


MessageBox(NULL,a, TEXT("Hello World"), MB_OKCANCEL |
MB_SETFOREGROUND | MB_TOPMOST);

When the above prog is run on a WinCE 6, the MessageBox displays :
read : 0, write : 1

and when the run on WinCE 5, the MessageBox displays :
read : 0, write : 0

Can some one kindly explain the above behavior? Thanks in advance.

Regards,
Amruth Kumar Juturu


.