WaitForNtmsNotification function (ntmsapi.h)

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

The WaitForNtmsNotification function waits for the next object change notification.

Syntax

DWORD WaitForNtmsNotification(
  [in]  HANDLE                         hNotification,
  [out] LPNTMS_NOTIFICATIONINFORMATION lpNotificationInformation,
  [in]  DWORD                          dwTimeout
);

Parameters

[in] hNotification

Notification handle returned by the OpenNtmsNotification function.

[out] lpNotificationInformation

Pointer to an NTMS_NOTIFICATIONINFORMATION structure that receives the notification information.

[in] dwTimeout

Maximum number of milliseconds to wait. If you specify a value of INFINITE, this function will not time-out.

Return value

This function returns one of the following values.

Value Meaning
ERROR_DATABASE_FAILURE
The database query or update failed.
ERROR_INVALID_HANDLE
The value specified in the hNotification parameter is NULL or is not valid.
ERROR_NO_DATA
Notification pipe failed. Attempt to set up notification again.
ERROR_NOT_CONNECTED
Unable to connect to the RSM service.
ERROR_TIMEOUT
The time-out event expired.
ERROR_SUCCESS
The function was successfully executed.

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

NTMS_NOTIFICATIONINFORMATION

OpenNtmsNotification