CloseNtmsSession function (ntmsapi.h)

[Removable Storage Manager is no longer available as of Windows 7 and Windows Server 2008 R2.]

The CloseNtmsSession function closes the specified RSM session.

Syntax

DWORD CloseNtmsSession(
  [in] HANDLE hSession
);

Parameters

[in] hSession

Handle to the session returned by the OpenNtmsSession function.

Return value

This function returns one of the following values.

Value Meaning
ERROR_CONNECTION_UNAVAIL
Connection to the RSM server or domain is not available.
ERROR_INVALID_HANDLE
The value specified in the hSession parameter is NULL or is not a valid session handle.

Remarks

The CloseNtmsSession function releases all resources. Use of a closed session handle returns an error code.

If a call to the CloseNtmsSession function occurs while an application has an outstanding synchronous request (for example, a mount or dismount request), the request is unwound and canceled.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header ntmsapi.h
Library Ntmsapi.lib
DLL Ntmsapi.dll

See also

OpenNtmsSession

Session Management Functions