3.2.5.2.2.17 INtmsMediaServices1::ChangeNtmsMediaType (Opnum 20)
The ChangeNtmsMediaType method moves a physical media identifier to a new media pool and sets the media type of the medium to that of the pool.
-
HRESULT ChangeNtmsMediaType( [in] LPNTMS_GUID lpMediaId, [in] LPNTMS_GUID lpPoolId );
lpMediaId: A pointer to the identifier of the physical media to be moved.
lpPoolId: A pointer to the identifier of the media pool to which the media will be allocated.
-
Return value/code
Description
0x00000000
S_OK
The call was successful.
0x80070005
ERROR_ACCESS_DENIED
NTMS_MODIFY_ACCESS to the media pool of the media is denied.
0x80070008
ERROR_NOT_ENOUGH_MEMORY
An allocation failure occurred during processing.
0x80070057
ERROR_INVALID_PARAMETER
The media pool or media identifiers are missing.
0x800710CC
ERROR_INVALID_MEDIA
The media identifier is not valid.
0x800710CE
ERROR_INVALID_MEDIA_POOL
The identifier of the media pool is invalid.
0x800710D9
ERROR_DATABASE_FAILURE
The database is inaccessible or damaged.
0x800710DA
ERROR_DATABASE_FULL
The database is full.
Upon receiving this message, the server MUST verify that both lpMediaId and lpPoolId are not NULL. If parameter validation fails, the server MUST immediately fail the operation and return ERROR_INVALID_PARAMETER (0x80070057).
If parameter validation succeeds, the server MUST verify that the user has the required access rights and that the library is enabled and online. If the client does not have the required access rights, the server MUST return ERROR_ACCESS_DENIED (0x80070005). If the library is offline, the server MUST return ERROR_LIBRARY_OFFLINE (0x800710D1).
The ChangeNtmsMediaType method uses the same policy for moving media as the method specified in [MSDN-MoveToNtmsMediaPool]. A medium having a partition in the completed, allocated, or reserved state MUST NOT be moved to the free media pool. A medium can be moved to an import pool only if all the partitions of the medium are in the import state.
Unrecognized media can only be moved to the free pool.
If moving the given media to specified media pool is an invalid operation, it MUST return ERROR_INVALID_MEDIA_POOL (0x800710CE).
On completion of an asynchronous operation, notification is sent with the identifier lpMediaId.