Platform SDK: Removable Storage Manager

SetNtmsDeviceChangeDetection

The SetNtmsDeviceChangeDetection function sets one or more target devices for change detection. The device can be specified directly by passing NTMS_LIBRARY object GUIDs or indirectly by passing NTMS_PHYSICAL_MEDIA or NTMS_MEDIA_TYPE GUIDs. When using the indirect specification, all stand-alone libraries that could contain the media or media type are detected. All devices specified continue to be detected until the DetectHandle is closed using EndNtmsDeviceChangeDetection. This function can also be used as a refresh by providing a NULL DetectHandle. In this case, RSM signals a single poll of all target devices provided by lpObjectId and thereby schedule classification of any changed media in those devices. This is typically used by a UI when opening a leaf node or implementing a Refresh option.

DWORD WINAPI SetNtmsDeviceChangeDetection(
  HANDLE hSession,
  HANDLE hDetectHandle,
  LPNTMS_GUID lpObjectId,
  DWORD dwType,
  DWORD dwCount
);

Parameters

hSession
The handle generated by the OpenNtmsSession function.
hDetectHandle
Device change detection handle or NULL for a single poll.
lpObjectId
One or more NTMS_LIBRARY, NTMS_PHYSICAL_MEDIA or NTMS_MEDIA_TYPE object identifiers used to specify the target devices for change detection. All of the identifiers must be the same type.
dwType
Type of object identifiers. Must be NTMS_LIBRARY, NTMS_PHYSICAL_MEDIA or NTMS_MEDIA_TYPE.
dwCount
Number of object identifiers.

Return Values

Value Meaning
ERROR_INVALID_HANDLE Invalid Session or Detection Handle.
ERROR_INVALID_PARAMETER Invalid Object type.
ERROR_INVALID_LIBRARY Specified Library not Found.
ERROR_INVALID_MEDIA Specified Media or Type not found.
ERROR_SUCCESS The operator request has been canceled.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Ntmsapi.h.
  Library: Use Ntmsapi.lib.

See Also

EndNtmsDeviceChangeDetection, BeginNtmsDeviceChangeDetection