XFOR: IStream::Stat( ) Returns E_NOTIMPL in MCIS 2.0

ID: q195046


The information in this article applies to:


SYMPTOMS

When you write an SMTP event sink for use with Microsoft Commercial Internet System (MCIS) 2.0, you can use the IStream::Stat() interface to return the size of the message. The following code segment demonstrates this:


HRESULT STDMETHODCALLTYPE CSmtpRules::OnDelivery(IMsg *pMsg)
{
   IStream *pStream;
   HRESULT hr;
   hr = pMsg->GetInterfaceA("Msg Stream", IID_IStream, (IUnknown**)
    &pStream);
   if (SUCCEEDED(hr))
   {
      STATSTG stg;
      if (S_OK == pStream->Stat(&stg, STATFLAG_NONAME))
      {
         sprintf(buffer, "Data size: %d - %d\r\n",
         stg.cbSize.LowPart,
         stg.cbSize.HighPart);
      }
      else
   // report error
} 

However, the Istream::Stat() call will return E_NOTIMPL.


CAUSE

This interface was not implemented in versions of Smtpsvc.dll prior to version 1877.11.

If you want to implement this feature, you must use this version or later and modify your code to call pStream->Stat(&statStg,STATFLAG_NONAME), and then retrieve the size information out of statStg.cbSize. This method cannot be used to retrieve file names, as files are only created after the sinks are called. After using pStream, you must call pStream->Release( ), or the message will be left in the queue after delivery.


RESOLUTION

To resolve this problem, obtain the latest service pack for Windows NT 4.0 or the individual fix. For information on obtaining the latest service pack, please go to:

For information on obtaining the individual fix, contact Microsoft Product Support Services. For a complete list of Microsoft Product Support Services phone numbers and information on support costs, please go to the following address on the World Wide Web:
http://www.microsoft.com/support/supportnet/overview/overview.asp

NOTE: If this product was already installed on your computer when you purchased it from the Original Equipment Manufacturer (OEM) and you need this fix, please call the Pay Per Incident number listed on the above Web site. If you contact Microsoft to obtain this fix, and if it is determined that you only require the fix you requested, no fee will be charged. However, if you request additional technical support, and if your no-charge technical support period has expired, or if you are not eligible for standard no-charge technical support, you may be charged a non-refundable fee.

For more information about eligibility for no-charge technical support, see the following article in the Microsoft Knowledge Base:
Q154871 Determining If You Are Eligible for No-Charge Technical Support


STATUS

Microsoft has confirmed this to be a problem in Microsoft Commercial Internet System version 2.0.

Additional query words:


Keywords          : prodmcis2 prodIMS nt4sp5fix 
Version           : winnt:2.0
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: July 2, 1999