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

Article translations Article translations
Article ID: 195046 - View products that this article applies to.
This article was previously published under Q195046
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

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 software update. For information on obtaining the latest service pack, please go to:
  • 152734 how to obtain the latest windows nt 4.0 service pack
For information on obtaining the individual software update, 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://support.microsoft.com/contactus/?ws=support

Status

Microsoft has confirmed that this is a problem in Microsoft Commercial Internet System version 2.0.

Properties

Article ID: 195046 - Last Review: November 2, 2013 - Revision: 2.0
Applies to
  • Microsoft Commercial Internet System 2.0
Keywords: 
kbnosurvey kbarchive kbbug kbfix kbqfe KB195046

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com