OpenNtmsNotification function (ntmsapi.h)

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

The OpenNtmsNotification function opens a channel to receive RSM object change notifications for objects of the specified type.

Syntax

HANDLE OpenNtmsNotification(
  [in] HANDLE hSession,
  [in] DWORD  dwType
);

Parameters

[in] hSession

Handle to the session returned by the OpenNtmsSession function.

[in] dwType

RSM object type for notification. For a list of values, see NtmsObjectsTypes.

Return value

The OpenNtmsNotification function returns a notification handle that you pass to the WaitForNtmsNotification or CloseNtmsNotification functions.

For extended error information, call the GetLastError function. This function can return one of the following values.

Value Meaning
ERROR_ACCESS_DENIED
NTMS_USE_ACCESS to the computer is denied. Other security errors are also possible, but they would indicate a security subsystem error.

Windows XP:  No access rights are required.

ERROR_DATABASE_FAILURE
The database query or update failed.
ERROR_INVALID_HANDLE
The value specified in the hSession parameter is NULL or is not valid.
ERROR_NOT_CONNECTED
Unable to connect to the RSM service.
ERROR_SUCCESS
The function was successful.
INVALID_HANDLE_VALUE
The function failed.

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

CloseNtmsNotification

Database Notification Functions

WaitForNtmsNotification