UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:ntmsapi.OpenNtmsSessionW |
OpenNtmsSessionW function (ntmsapi.h) |
The OpenNtmsSession function sets up a session with a RSM server. (Unicode) |
|
fs\openntmssession.htm |
fs |
5a323911-e99c-4f81-9580-0feac2f0a54e |
12/05/2018 |
OpenNtmsSession, OpenNtmsSession function [Files], OpenNtmsSessionA, OpenNtmsSessionW, _zaw_openntmssession, base.openntmssession, fs.openntmssession, ntmsapi/OpenNtmsSession, ntmsapi/OpenNtmsSessionA, ntmsapi/OpenNtmsSessionW |
ntmsapi.h |
Windows |
Windows XP [desktop apps only] |
Windows Server 2003 [desktop apps only] |
OpenNtmsSessionW (Unicode) and OpenNtmsSessionA (ANSI) |
Ntmsapi.lib |
Ntmsapi.dll |
Windows |
19H1 |
|
|
|
|
|
|
[Removable Storage Manager is no longer available as of Windows 7 and Windows Server 2008 R2.]
The OpenNtmsSession function sets up a session with a RSM server.
RSM server name. If this parameter is NULL, the current computer name is used.
Unique character string that identifies the application. This name identifies resources and operator requests. This parameter is optional and may be NULL.
Reserved; must be zero.
If OpenNtmsSession succeeds, it returns a handle that uniquely identifies this session. If the function fails, it returns INVALID_HANDLE_VALUE. To retrieve more information, call the GetLastError function. This function can return one of the following values.
Value | Meaning |
---|---|
|
The computer name format that was specified was not in a valid format. |
|
One of the parameter values was not valid. |
|
The network is not started or not available. |
|
Unable to connect to the RSM service. |
|
RSM service has not started. The application should wait and retry. |
|
The function was successful. |
|
RSM cannot open a session. |
|
The service is using an older version of RSM than your application. |
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.
When OpenNtmsSession returns, the application can perform RSM operations.
Sessions are thread-safe but cannot be passed among processes.
Note
The ntmsapi.h header defines OpenNtmsSession as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.