EnumerateNtmsObject function (ntmsapi.h)
[Removable Storage Manager is no longer available as of Windows 7 and Windows Server 2008 R2.]
The EnumerateNtmsObject function enumerates the RSM objects contained in the lpContainerId parameter.
Syntax
DWORD EnumerateNtmsObject(
[in] HANDLE hSession,
[in] const LPNTMS_GUID lpContainerId,
[out] LPNTMS_GUID lpList,
[in, out] LPDWORD lpdwListSize,
[in] DWORD dwType,
[in] DWORD dwOptions
);
Parameters
[in] hSession
Handle to the session returned by the OpenNtmsSession function.
[in] lpContainerId
Unique identifier of the RSM object container whose objects are to be enumerated. This parameter can be the GUID of a library, media pool, partition ID, physical media, or logical media. To enumerate all objects of the type specified by the dwType parameter, regardless of the container, set this parameter to NULL. For more information about the object-container relationship, see NtmsObjectsTypes.
[out] lpList
Buffer for the array of libraries, drives, media or other RSM object IDs.
[in, out] lpdwListSize
Pointer to a variable that specifies the maximum number of IDs the function can return through the lpList parameter. At return time, the number of IDs in lpList is returned in lpdwListSize.
[in] dwType
Type of objects to be enumerated in the lpContainerId container. If lpContainerId is NULL, all objects of this type supported by RSM are enumerated. This parameter can be one of the following values from the NtmsObjectsTypes enumeration type.
[in] dwOptions
Enumeration options. This is applicable only when dwType is NTMS_MEDIA_POOL.
Windows XP: This parameter is reserved and must be set to zero.
Return value
This function returns one of the following values.
Value | Meaning |
---|---|
|
The lpdwListSize pointer is missing, or lpContainerId is not a valid container for the object type specified by dwType. |
|
The buffer size specified by lpdwListSize is too small for all the objects found. The function truncates the list and returns the actual size in lpdwListSize. |
|
The session handle is missing or is not valid. |
|
An allocation failure occurred during processing. |
|
The GUID specified by lpContainerId is not the GUID of any container object in the database. |
|
The function was successful. If lpContainerId contains no objects of the type specified by dwType, the function returns ERROR_SUCCESS and a lpdwListSize of zero. |
Remarks
Security functions are also available to get and set specific access rights on RSM objects.
If the available number of IDs specified in the lpdwListSize parameter is greater than the current buffer size, lpdwListSize returns the number of IDs required. The application should then allocate a larger buffer and try again.
Since it is possible for IDs to be added by another process, it is possible for a subsequent function with a resized list to get an error indicating that the list is too small.
If the lpContainerId parameter is set to NULL, RSM enumerates top-level objects (such as libraries).
If more than one object is listed, the object may be enumerated from more than one container. The NULL container is the highest-level container and enumerates all objects in a system. For example, you can enumerate media in a particular library or all media in the system.
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 |