Compartilhar via


CancelNtmsLibraryRequest Function

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

The CancelNtmsLibraryRequest function cancels outstanding RSM requests, such as calls to the CleanNtmsDrive function. If the library is busy, RSM queues the cancellation and returns success.

Syntax

DWORD CancelNtmsLibraryRequest(
  __in  HANDLE hSession,
  __in  LPNTMS_GUID lpRequestId
);

Parameters

  • hSession [in]
    Handle to the session returned by the OpenNtmsSession function.

  • lpRequestId [in]
    Unique identifier of the library request to be canceled.

    To retrieve the list of existing library requests, use the EnumerateNtmsObject function.

Return Value

This function returns one of the following values.

Value Meaning
ERROR_ACCESS_DENIED

Only an administrator of the RSM server can cancel library requests. This error is also returned if the request is currently being handled and cannot be deleted.

ERROR_INVALID_HANDLE

The session handle is missing or is not valid.

ERROR_NOT_ENOUGH_MEMORY

There was an allocation failure during processing.

ERROR_OBJECT_NOT_FOUND

The library request object ID was not found. This error occurs if the request is completed prior to issuing the cancel or when a request ID that is not valid is specified.

ERROR_SUCCESS

The library request has been queued for cancellation.

 

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

End of client support

Windows Vista

End of server support

Windows Server 2008

Header

Ntmsapi.h

Library

Ntmsapi.lib

DLL

Ntmsapi.dll

See Also

Library Control Functions

EnumerateNtmsObject

 

 

Send comments about this topic to Microsoft

Build date: 6/9/2011