IWSDOutboundAttachment::Close method (wsdattachment.h)

Closes the current attachment MIME data stream.

Syntax

HRESULT Close();

Return value

Possible return values include, but are not limited to, the following:

Return code Description
S_OK
Method completed successfully. All data in the attachment stream was successfully transferred.
HRESULT_FROM_WIN32(ERROR_INVALID_OPERATION)

Close was called before Write was called. You must call Write before closing the attachment stream.

STG_S_BLOCK
Internal buffers were not available. The data in the attachment stream was not successfully transferred.

Remarks

Close is used to indicate that the application has no more data to transmit in the current attachment stream. The return value can indicate an error in a previous Write operation or an issue closing the connection.

Close may block while waiting for a previous Write operation to complete. Close may block for up to 30 seconds (per HTTP transmission timeouts) while waiting for a previous Write operation to complete.

The Close method may return successfully after a failed Close attempt that returned STG_S_BLOCK. A subsequent success indicates that the internal buffers were freed for use after the initial failed attempt. When STG_S_BLOCK is received by an application, the application can either call Close again or terminate the data transfer using the Abort method.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header wsdattachment.h (include Wsdapi.h)
DLL Wsdapi.dll

See also

IWSDInboundAttachment

IWSDOutboundAttachment

IWSDOutboundAttachment::Abort

IWSDOutboundAttachment::Write