ChangeNtmsMediaType

[This is preliminary documentation and subject to change.]

The ChangeNtmsMediaType function moves the specified PMID to the specified target media pool and sets the PMID's MediaType GUID to the MediaType of the target media pool.

DWORD ChangeNtmsMediaType(
  HANDLE hSession,
  LPNTMS_GUID lpMediaId,
  LPNTMS_GUID lpPoolId
);
 

Parameters

hSession
Handle to the session returned by the OpenNtmsSession function.
lpMediaId
Specifies the unique identifier of the physical media to be moved.
lppoolId
Specifies the unique identifier of a media pool to which the media is to be allocated.

Return Values

ERROR_ACCESS_DENIED
NTMS_MODIFY_ACCESS to media's media pool is denied.
ERROR_DATABASE_FAILURE
The database is inaccessible or damaged.
ERROR_DATABASE_FULL
The database is full.
ERROR_INVALID_HANDLE
The session handle is invalid or missing.
ERROR_INVALID_MEDIA_POOL
The media pool ID is invalid.
ERROR_INVALID_PARAMETER
The media pool or media ID is missing.
ERROR_NOT_ENOUGH_MEMORY
An allocation failure occurred during processing.
ERROR_SUCCESS
The function was successful.

Remarks

The ChangeNtmsMediaType function requires the caller to have NTMS_MODIFY_ACCESS rights on the target media pool. The ChangeNtmsMediaType function uses the same policy for moving media as the MoveToNtmsMediaPool function (FOREIGN media can only be moved to the SCRATCH Pool).

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in ntmsapi.h.
  Import Library: Use ntmsapi.lib.

See Also

Media Services Functions, AddNtmsMediaType, DeleteNtmsMediaType