Platform SDK: MAPI |
The IMsgStore::SetLockState method locks or unlocks a message. This method is called only by the MAPI spooler.
HRESULT SetLockState( LPMESSAGE lpMessage, ULONG ulLockState );
The IMsgStore::SetLockState method locks or unlocks a message. SetLockState can only be called by the MAPI spooler while it is sending the message.
Usually, when the MAPI spooler calls SetLockState to lock a message, it only locks the oldest message — that is, the next message queued for the MAPI spooler to send. If the oldest message in the queue is waiting for a temporarily unavailable transport provider, and the next message in the queue uses a different transport provider, the MAPI spooler can begin processing the later message. It begins processing by locking that message using SetLockState.
After the MAPI spooler has called SetLockState with the ulLockState parameter set to MSG_LOCKED, calls to IMsgStore::AbortSubmit to cancel the message's transmission must fail.
Call the message's IMAPIProp::SaveChanges method in your SetLockState implementation so that any changes made to the message before the SetLockState call was received are saved.