Platform SDK: Removable Storage Manager

AddNtmsMediaType

The AddNtmsMediaType function adds the specified media type to the specified library if there is not currently a relation in the library object. The function then creates the system media pools (FREE/IMPORT/UNRECOGNIZED) if they do not exist.

DWORD AddNtmsMediaType(
  HANDLE hSession,
  LPNTMS_GUID lpMediaTypeId,
  LPNTMS_GUID lpLibId
);

Parameters

hSession
Handle to the session returned by the OpenNtmsSession function.
lpMediaTypeId
Specifies the unique identifier of a media type to add to the library.
lpLibId
Specifies the unique identifier of the library to which to add the media type.

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_LIBRARY The library ID is invalid.
ERROR_INVALID_PARAMETER The media type or library ID is missing.
ERROR_NOT_ENOUGH_MEMORY There was an allocation failure during processing.
ERROR_SUCCESS The function was successful.

Requirements

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

See Also

Media Services Functions, DeleteNtmsMediaType