OpenNtmsSession

[This is preliminary documentation and subject to change.]

The OpenNtmsSession function sets up a session with a RSM server.

HANDLE WINAPI OpenNtmsSession(
  LPCTSTR lpServer,
  LPCTSTR lpApplication,
  DWORD dwOptions
);
 

Parameters

lpServer
Specifies a character string that points to the RSM server name. If this parameter is NULL, the current computer is used.
lpApplication
Specifies a unique character string that identifies the application. This name identifies resources and operator requests.
dwOptions
Reserved. The application should pass 0.

Return Values

ERROR_INVALID_COMPUTERNAME
An invalid computer name format was supplied.
ERROR_INVALID_PARAMETER
Invalid parameters were supplied.
ERROR_NO_NETWORK
The network is not started or not available.
ERROR_NOT_CONNECTED
Unable to connect to the RSM service.
ERROR_NOT_READY
RSM service has not started.
ERROR_SUCCESS
The function was successful.
INVALID_HANDLE_VALUE
RSM cannot open a session.
RPC_S_NO_INTERFACES
If you build your application on a newer version of RSM than the service is using

Remarks

The OpenNtmsSession function returns a session handle used with other RSM functions, establishes a connection with the RSM database, and initializes the RSM subsystem for the application.

The OpenNtmsSession function returns a handle that uniquely identifies this session, or it returns INVALID_HANDLE_VALUE if RSM cannot open a session. Other RSM functions use this session handle to perform operations.

If INVALID_HANDLE_VALUE returns, you can call the Win32 GetLastError function to retrieve the error code.

When OpenNtmsSession returns, the application can perform RSM operations.

Sessions are thread-safe but cannot be passed among processes.

If you build your application on a newer version of RSM than the service is using, RPC_S_NO_INTERFACES returns when you call OpenNtmsSession.

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in ntmsapi.h.
  Import Library: Use ntmsapi.lib.

See Also

Session Management Functions, CloseNtmsSession