AddNtmsMediaType
[This is preliminary documentation and subject to change.] 
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 (SCRATCH/IMPORT/FOREIGN) if they do not exist. This call requires the caller to have NTMS_CONTROL_ACCESS rights to the library object.
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
- 
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.
 
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, DeleteNtmsMediaType