CloseNtmsSession function

[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(
  HANDLE hSession
);

Parameters

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

   
Windows version Windows XP [desktop apps only] Windows Server 2003 [desktop apps only]
Target Platform Windows
Header ntmsapi.h
Library Ntmsapi.lib
DLL Ntmsapi.dll

See Also

OpenNtmsSession

Session Management Functions