Try to use the below method it create file mapping with large size and update the contents.
DWORD nSize = GetFileSize( hFile, &nSizeH );
int nRequiredSize = nSize + nAddedSize; HANDLE hMapping = CreateFileMapping( hFile, 0, PAGE_READWRITE, 0,nRequiredSize,0 );
CHAR* pData = (CHAR*)MapViewOfFile( hMapping, FILE_MAP_ALL_ACCESS, 0,0, 0 );
UnmapViewOfFile(pData);
CloseHandle(hMapping);