RmJoinSession function (restartmanager.h)

Joins a secondary installer to an existing Restart Manager session. This function must be called with a session key that can only be obtained from the primary installer that started the session. A valid session key is required to use any of the Restart Manager functions. After a secondary installer joins a session, it can call the RmRegisterResources function to register resources.

Syntax

DWORD RmJoinSession(
  [out] DWORD          *pSessionHandle,
  [in]  const WCHAR [] strSessionKey
);

Parameters

[out] pSessionHandle

A pointer to the handle of an existing Restart Manager Session.

[in] strSessionKey

A null-terminated string that contains the session key of an existing session.

Return value

This is the most recent error received. The function can return one of the system error codes that are defined in Winerror.h.

Value Meaning
ERROR_SUCCESS
0
The function completed successfully.
ERROR_SESSION_CREDENTIAL_CONFLICT
1219
The session key cannot be validated.
ERROR_SEM_TIMEOUT
121
A Restart Manager function could not obtain a Registry write mutex in the allotted time. A system restart is recommended because further use of the Restart Manager is likely to fail.
ERROR_BAD_ARGUMENTS
22
One or more arguments are not correct. This error value is returned by the Restart Manager function if a NULL pointer or 0 is passed in a parameter that requires a non-null and non-zero value.
ERROR_WRITE_FAULT
29
An operation was unable to read or write to the registry.
ERROR_MAX_SESSIONS_REACHED
353
The maximum number of sessions has been reached.
ERROR_OUTOFMEMORY
14
A Restart Manager operation could not complete because not enough memory was available.

Remarks

The RmJoinSession function joins a secondary installer to an existing Restart Manager session. This is typically an installer that does not control the user interface and can run either in-process or out-of-process of the primary installer. Only the primary installer can call the RmStartSession function and this is typically the application that controls the user interface or that controls the installation sequence of multiple patches in an update.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header restartmanager.h
Library Rstrtmgr.lib
DLL Rstrtmgr.dll

See also

RmEndSession

RmStartSession