Export (0) Print
Expand All

GetNtmsUIOptions Function

[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 GetNtmsUIOptions(
  __in     HANDLE hSession,
  __in     const LPNTMS_GUID lpObjectId,
  __in     DWORD dwType,
  __out    LPTSTR lpszDestination,
  __inout  LPDWORD lpdwSize


hSession [in]

Handle to the session returned by the OpenNtmsSession function.

lpObjectId [in]

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.

dwType [in]

This parameter can have one of the following values.


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.


lpszDestination [out]

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

lpdwSize [in, out]

Size of the destination string, in TCHARs.

Return Value

This function returns one of the following values.


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.

ApplicationDisplay 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.
LibraryDisplay 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.
ComputerDisplay 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.



Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

End of client support

Windows Vista

End of server support

Windows Server 2008







Unicode and ANSI names

GetNtmsUIOptionsW (Unicode) and GetNtmsUIOptionsA (ANSI)

See Also

Library Control Functions



Send comments about this topic to Microsoft

Build date: 6/9/2011

Community Additions

© 2015 Microsoft