Handling active PST file increate when streaming the large contents of a message property
Hi,
The size of the active PST File increases when I'm streaming the large
contents of a messages property, is possible to prevent it? I'm currently
using Outlook 2003 SP2 or SP3 and the stream for the property is opened as
"read-only" within an extension. For example -
#define PR_MY_PROPERTY PROP_TAG (PT_BINARY, (0x6800))
STDMETHODIMP CExtImpl::OnRead(IExchExtCallback* pexcb)
{
.
pexcb->GetObject(&pMDB, (LPMAPIPROP FAR *)&pMessage);
LPSTREAM pProperty;
pMessage->OpenProperty(PR_MY_PROPERTY, (LPIID)&IID_IStream,
0, 0, (LPUNKNOWN *) &pProperty );
STATSTG streamInfo;
pProperty->Stat(&streamInfo, STATFLAG_NONAME);
pProperty->Read(pBuff, streamInfo.cbSize.LowPart, &ulBytesRead);
pProperty->Release();
..
}
The size increate of the PST file is related to how much is read and not the
opening of the stream (i.e. if the property is opened and then released
there is no apparent increase). In the original code I open the stream for
the message property which can be of any size (1K to 900K bytes) and read it
(without errors) in 2K blocks. This however has the same effect as reading
the whole contents of the property once into a buffer (pBuff dynamically
created to be large enough to hold streamInfo.cbSize.LowPart), as shown in
the example.
Many thanks for any ideas or suggestion.
Mark..
date: Tue, 15 Jul 2008 15:51:59 +0100
author: Mark Kitson