MAPILOGOFF callback function (mapi.h)

[The use of this function is discouraged. It may be altered or unavailable in subsequent versions of Windows.]

The MAPILogoff function ends a session with the messaging system.


MAPILOGOFF Mapilogoff;

ULONG Mapilogoff(
  [in] LHANDLE lhSession,
  [in] ULONG_PTR ulUIParam,
       FLAGS flFlags,
       ULONG ulReserved


[in] lhSession

Handle for the Simple MAPI session to be terminated. Session handles are returned by the MAPILogon function and invalidated by MAPILogoff. The value of the lhSession parameter must represent a valid session; it cannot be zero.

[in] ulUIParam

Parent window handle or zero, indicating that if a dialog box is displayed, it is application modal. If the ulUIParam parameter contains a parent window handle, it is of type HWND (cast to a ULONG_PTR). If no dialog box is displayed during the call, ulUIParam is ignored.


Reserved; must be zero.


Reserved; must be zero.

Return value

This function returns one of the following values.

Return code Description
The flFlags parameter is invalid or one or more unspecified errors occurred.
There was insufficient memory to proceed. The session was not terminated.
An invalid session handle was used for the lhSession parameter. The session was not terminated.
The call succeeded and the session was terminated.


Target Platform Windows
Header mapi.h

See also


Simple MAPI