IMAPISupport::StoreLogoffTransports

The IMAPISupport::StoreLogoffTransports method requests the orderly release of a message store.

Quick Info

See IMAPISupport : IUnknownA6YDUA.

HRESULT StoreLogoffTransports(

    ULONG FAR * lpulFlags

 

   )

 

 

Parameters

lpulFlags

[in, out] Bitmask of flags that controls how message store logoff occurs. On input, all flags for this parameter are mutually exclusive; only one flag can be set per call and the following flags can are valid:

LOGOFF_ABORT

Any transport provider activity for this store should be stopped before logoff. Control is returned to the client after the activity is stopped and the MAPI spooler has logged off the store. If any transport activity is taking place, the logoff does not occur and no change in MAPI spooler or transport provider behavior occurs. If there is currently no activity, the MAPI spooler releases the store.

LOGOFF_NO_WAIT

The MAPI spooler should release the store and return control to the client immediately after all outbound mail that is ready to be sent is sent. If the message store has the default Inbox, any in-process message is received and then further reception is disabled.

LOGOFF_ORDERLY

The MAPI spooler should release the store and return control to the client immediately after any pending messages have finished processing. No new messages should be processed.

LOGOFF_PURGE

Works the same as the LOGOFF_NO_WAIT flag. The LOGOFF_PURGE flag returns control to the caller after completion.

LOGOFF_QUIET

The logoff should not occur if any transport provider activity is taking place. The type of activity taking place is returned as a flag on output.

 

On output, the MAPI spooler can return more than one flag and the following flags can be set:

LOGOFF_COMPLETE

The logoff can complete. All resources associated with the store have been released, and the object has been invalidated. The MAPI spooler has performed or will perform all requests. Only the message store s IUnknown::Release method should be called at this point.

LOGOFF_INBOUND

A message is currently coming into the store from one or more transport providers.

LOGOFF_OUTBOUND

A message is currently being sent from the store by one or more transport providers.

LOGOFF_OUTBOUND_QUEUE

There are currently messages in the outbound queue for the store.

 

Return Values

S_OK

The logoff procedure was successful.

 

Remarks

The IMAPISupport::StoreLogoffTransports method is implemented for message store provider support objects. Message store providers call StoreLogoffTransports to give client applications some control over how MAPI handles transport provider activity as a message store is closing.

If another process has the store to be logged off open for the same profile, MAPI ignores a call to StoreLogoffTransports and returns the flag LOGOFF_COMPLETE in lpulFlags.

The behavior of the store provider following the return from StoreLogoffTransports should be based on the value of lpulFlags, which indicates system status and conveys client instructions on logoff behavior.

Notes to Callers

StoreLogoffTransports is typically called from a store provider s IMsgStore::StoreLogoffGBW50P method. However, it can also be called from the IUnknown::Release method of the message store. Implement the Release method of your message store so that you can check whether or not a call to StoreLogoffTransports has occurred. If not, call it with the LOGOFF_ABORT flag set.

The lpulFlags parameter is set to a flag that indicates how the client requires the message store to be shut down. Determine the appropriate setting for ulFlags based on the setting of the corresponding parameter in the call to IMsgStore::StoreLogoffGBW50P method. That is, if a client called your StoreLogoff method with ulFlags set to LOGOFF_ORDERLY, you should call StoreLogoffTransports with ulFlags set to LOGOFF_ORDERLY.

For more information about the message store logoff process, see Shutting Down a Message Store ProviderIZCBU9.

See Also

IMsgStore::StoreLogoff, IXPLogon::FlushQueues