GetNtmsUIOptionsA function (ntmsapi.h)

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

The GetNtmsUIOptions function obtains the list of computer names to which the specified type of user interface is being directed for the given object. A call to GetNtmsUIOptions returns the list of destinations for the instance determined by the lpObjectId and dwType parameters.

If there are no destinations in the list for the specified instance, the function returns ERROR_SUCCESS along with a list length of zero.


DWORD GetNtmsUIOptionsA(
  [in]      HANDLE            hSession,
  [in]      const LPNTMS_GUID lpObjectId,
  [in]      DWORD             dwType,
  [out]     LPSTR             lpszDestination,
  [in, out] LPDWORD           lpdwBufSize


[in] hSession

Handle to the session returned by the OpenNtmsSession function.

[in] lpObjectId

Unique identifier of the object whose UI is being redirected. The object must be a container that can be a source for events. The object can be either be an application (a mount request triggered by the application), a library (a door open request in response to an eject) or a computer (all UI pertaining to the computer).

To specify the computer container set the lpObjectId pointer to point to a buffer with the Removable Storage Manager's computer object GUID. To specify a particular library set it to point to a buffer with the library's GUID. To specify an application, pass in a NULL pointer. The identity of the application is determined by the session used in hSession. Note that an application can have multiple sessions open simultaneously. In this case, the value set applies only to the hSession session.

[in] dwType

This parameter can have one of the following values.

Value Meaning
UI messages that provide information. These include the work queue items that indicate progress. For example, mount requests.
UI messages that are requests. These include the operator requests that handle media. For example, a request to inject new media.
UI messages that give error information. These include operator requests that are related to error notification. For example, a request to clean the drive.

[out] lpszDestination

Multi-string that returns the names of the machines to which the UI is being redirected. This parameter cannot be NULL.

[in, out] lpdwBufSize

Size of the destination string, in TCHARs.

Return value

This function returns one of the following values.

Value Meaning
Access to one or more RSM objects is denied.
The buffer size specified by lpdwSize is too small for the destinations found. The function returns the actual size in lpdwSize.
The session handle is missing or is not valid.
The lpdwSize or lpszDestination parameter is NULL, or lpObjectId is not a valid container, or dwType is not one of the three valid values.
An allocation failure occurred during processing.
The GUID specified by lpObjectId is not the GUID of any computer or library object in the database.
The function was successful.


A call to GetNtmsUIOptions returns a list of destinations for a particular instance determined by the lpObjectId and dwType parameters.

Application Display work item progress UI for work items generated by this application. Display operator request UI for operator requests generated by actions taken by this application. Undefined. Applications cannot cause this sort of error event.
Library Display work item progress UI for work items associated with this library. Display UI for requests associated with this library. Display UI for errors associated with this library.
Computer Display informational UI in this instance of RSM running on this machine. Display a request-type UI in this instance of RSM. Display error-type UI in this instance of RSM.


The ntmsapi.h header defines GetNtmsUIOptions as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.


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

Library Control Functions