Skip to content

Latest commit

 

History

History
198 lines (161 loc) · 4.78 KB

nf-ntmsapi-openntmssessionw.md

File metadata and controls

198 lines (161 loc) · 4.78 KB
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)
OpenNtmsSession
OpenNtmsSession function [Files]
OpenNtmsSessionW
_zaw_openntmssession
base.openntmssession
fs.openntmssession
ntmsapi/OpenNtmsSession
ntmsapi/OpenNtmsSessionW
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
OpenNtmsSessionW
ntmsapi/OpenNtmsSessionW
c++
APIRef
kbSyntax
DllExport
Ntmsapi.dll
OpenNtmsSession
OpenNtmsSessionA
OpenNtmsSessionW

OpenNtmsSessionW function

-description

[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.

-parameters

-param lpServer [in]

RSM server name. If this parameter is NULL, the current computer name is used.

-param lpApplication [in]

Unique character string that identifies the application. This name identifies resources and operator requests. This parameter is optional and may be NULL.

-param dwOptions

Reserved; must be zero.

-returns

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
ERROR_INVALID_COMPUTERNAME
The computer name format that was specified was not in a valid format.
ERROR_INVALID_PARAMETER
One of the parameter values was not valid.
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. The application should wait and retry.
ERROR_SUCCESS
The function was successful.
INVALID_HANDLE_VALUE
RSM cannot open a session.
RPC_S_NO_INTERFACES
The service is using an older version of RSM than your application.

-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.

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.

-see-also

CloseNtmsSession

Session Management Functions