BeginNtmsDeviceChangeDetection function (ntmsapi.h)

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

The BeginNtmsDeviceChangeDetection function allows the application to begin a device change detection session.

Syntax

DWORD BeginNtmsDeviceChangeDetection(
  [in]  HANDLE   hSession,
  [out] LPHANDLE lpDetectHandle
);

Parameters

[in] hSession

Handle to the session returned by the OpenNtmsSession function.

[out] lpDetectHandle

Pointer to variable that receives the device change detection handle.

Return value

This function returns one of the following values.

Value Meaning
ERROR_INVALID_HANDLE
The value of the hSession parameter is not a valid session handle.
ERROR_SUCCESS
The operator request has been canceled.

Remarks

After calling BeginNtmsDeviceChangeDetection, the application can set the stand-alone libraries for which media change detection is required using the SetNtmsDeviceChangeDetection function. The Removable Storage Manager continues to detect changes for the devices specified until the change detection session is closed using the EndNtmsDeviceChangeDetection function.

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

Change Detection Functions

EndNtmsDeviceChangeDetection

SetNtmsDeviceChangeDetection