Platform SDK: Removable Storage Manager

ChangeNtmsMediaType

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 Pmid,
  LPNTMS_GUID MPoolId
);

Parameters

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

Return Values

Value Meaning
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 uses the same policy for moving media as the MoveToNtmsMediaPool function (UNRECOGNIZED media can only be moved to the FREE Pool).

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Ntmsapi.h.
  Library: Use Ntmsapi.lib.

See Also

Media Services Functions, AddNtmsMediaType, DeleteNtmsMediaType