|
Boost Users : |
From: Elisha Berns (e.berns_at_[hidden])
Date: 2005-08-26 02:17:51
Hi again,
Odd, today I have only had PROBLEMS with boost. I guess it's just one
of those days. Anyways, the open_impl() method for
iostreams::mapped_file_source just doesn't open any mappings for files.
I realize that it is reused by the mapped_file class, but that is what
seems to cloud the design, flow and working of it as it needs to please
everyone here, and it doesn't. It always throws in this location:
pimpl_->mapped_handle_ =
::CreateFileMappingA( pimpl_->handle_, NULL,
readonly ? PAGE_READONLY : PAGE_READWRITE,
0, 0, p.path.c_str() );
if (pimpl_->mapped_handle_ == NULL) {
detail::cleanup_and_throw(*pimpl_, "couldn't create mapping");
}
However, if I use just the raw Win32 APIs all works fine:
HANDLE hFile = CreateFile(szFile,
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_READONLY,
NULL);
if ( hFile == INVALID_HANDLE_VALUE )
return;
HANDLE hFileMapping = CreateFileMapping(hFile, NULL,
PAGE_READONLY, 0, 0, NULL);
if ( hFileMapping == 0 )
{
CloseHandle(hFile);
return;
}
void* pView = ::MapViewOfFile(hFileMapping, FILE_MAP_READ, 0, 0,
0);
if ( pView == 0 )
{
CloseHandle(hFileMapping);
CloseHandle(hFile);
return;
}
Anyways, here my desire is to use the boost libraries as an insulation
layer to enable writing cross-platform C++, but obviously if it doesn't
work that idea doesn't go too far. So I really hope this gets
addressed.
Many thanks,
Elisha Berns
e.berns_at_[hidden]
tel. (310) 556 - 8332
fax (310) 556 - 2839
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net