Fixed a bug.

This commit is contained in:
Thuy Nguyen 1999-02-24 10:52:26 +00:00 committed by Alexandre Julliard
parent 6d2e1735f9
commit 582cf8f6f4
1 changed files with 19 additions and 31 deletions

View File

@ -621,6 +621,7 @@ static void * BIGBLOCKFILE_GetMappedView(
MappedPage * current;
MappedPage * newMappedPage;
DWORD hioffset, lowoffset;
DWORD numBytesToMap;
/* use correct list
*/
@ -660,22 +661,16 @@ static void * BIGBLOCKFILE_GetMappedView(
/* actually map the page
*/
if (This->filesize.LowPart <= PAGE_SIZE)
{
newMappedPage->lpBytes = MapViewOfFile(This->hfilemap,
desired_access,
hioffset, lowoffset,
This->filesize.LowPart);
}
if (((pagenum + 1) * PAGE_SIZE) > This->filesize.LowPart)
numBytesToMap = This->filesize.LowPart - (pagenum * PAGE_SIZE);
else
{
DWORD numBytesToMap = This->filesize.LowPart - (pagenum*PAGE_SIZE);
newMappedPage->lpBytes = MapViewOfFile(This->hfilemap,
desired_access,
hioffset,
lowoffset,
numBytesToMap);
}
numBytesToMap = PAGE_SIZE;
newMappedPage->lpBytes = MapViewOfFile(This->hfilemap,
desired_access,
hioffset,
lowoffset,
numBytesToMap);
return newMappedPage->lpBytes;
}
@ -704,23 +699,16 @@ static void * BIGBLOCKFILE_GetMappedView(
/* actually map the page
*/
if (This->filesize.LowPart <= PAGE_SIZE)
{
newMappedPage->lpBytes = MapViewOfFile(This->hfilemap,
desired_access,
hioffset,
lowoffset,
This->filesize.LowPart);
}
if (((pagenum + 1) * PAGE_SIZE) > This->filesize.LowPart)
numBytesToMap = This->filesize.LowPart - (pagenum * PAGE_SIZE);
else
{
DWORD numBytesToMap = This->filesize.LowPart - (pagenum*PAGE_SIZE);
newMappedPage->lpBytes = MapViewOfFile(This->hfilemap,
desired_access,
hioffset,
lowoffset,
numBytesToMap);
}
numBytesToMap = PAGE_SIZE;
newMappedPage->lpBytes = MapViewOfFile(This->hfilemap,
desired_access,
hioffset,
lowoffset,
numBytesToMap);
return newMappedPage->lpBytes;
}