Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MapViewOfFIle

Status
Not open for further replies.

softpro

Programmer
Dec 14, 2001
1
IN
i am trying to write a program for file upload. If the file size is > 64K then it is to be mapped in chunks of 64K and transferred in chunks of 1000 bytes till the whole file is
transferred.

Now the problem is if the file is < 64K it gets uploaded but if it is > 64K then it fails. The first 64K bytes get mapped but after that the MapViewOfFile fails. WHat could be the reason. The function is something like ...

if ((h_file_map = CreateFileMapping(s_curr_file_xfer_data.xfer_file_handle, NULL, PAGE_READONLY, 0, 0,NULL)) == NULL)
{

// ...

}


if ((l_ptr_mapped_view = MapViewOfFile(h_file_map,FILE_MAP_READ,0, l_start_addr,
FILE_VIEW_SZ )) == NULL)
{
//FILE_VIEW_SZ = 64K
&quot;Failure in mapping view for file &quot;
// ...
}

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top