Share via


IMsgStore::SetLockState

Applies to: Office 2010 | Outlook 2010 | Visual Studio

Locks or unlocks a message. This method is called only by the MAPI spooler.

HRESULT SetLockState(
  LPMESSAGE lpMessage,
  ULONG ulLockState  
);

Parameters

  • lpMessage
    [in] A pointer to the message to lock or unlock.

  • ulLockState
    [in] A value that indicates whether the message should be locked or unlocked. One of the following values is valid:

    • MSG_LOCKED
      The message should be locked.

    • MSG_UNLOCKED
      The message should be unlocked.

Return Value

  • S_OK
    The lock state of the message was successfully set.

Remarks

The IMsgStore::SetLockState method locks or unlocks a message. SetLockState can be called only by the MAPI spooler while it is sending the message.

Usually, when the MAPI spooler calls SetLockState to lock a message, it locks only 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 by using SetLockState.

Notes to Implementers

After the MAPI spooler has called SetLockState with the ulLockState parameter set to MSG_LOCKED, calls to the IMsgStore::AbortSubmit method to cancel the message's transmission must fail.

Call the message's IMAPIProp::SaveChanges method in your SetLockState implementation so that any changes that were made to the message before the SetLockState call was received are saved.

See Also

Reference

IMsgStore::AbortSubmit

IMsgStore::FinishedMsg

IMsgStore : IMAPIProp