3.5 Identifier Class

This section covers the following topics:

The identifier class maintains all media identifier objects. Media identifiers are used to identify removable media. Each registered identifier is called by the Media Manager when removable media is activated until one of them identifies the activated media. If the media is not identified, then Media Manager will create an unidentified media object to represent the removable media.

When the identifier is called it must use only the MM_SpecialObjectBlockingIO for doing IO to the media. This API is available only during the activation phase of removable media. If an identifier identifies the media, it would then call MM_CreateRemovableObject to create the removable media object. If it’s appropriate, MM_CreateRemovableObject can also be used to create magazine objects. The identifier would then return with MM_OK. If the identifier does not identify, the media then the identifier must return MM_MEDIA_NOT_IDENTIFIED.

An identifier can also label or unlabel a media object. When the MM_LABEL_FUNCTIONS control function operations are submitted to media objects, the specified identifier is called either to label or unlabel the specified media. During the label/unlabel event, MM_SpecialObjectBlockingIO is again used to perform the actual labeling or unlabeling.

3.5.1 Identifier Registration

An identifier is registered by completing the IdentifierRegistrationDef structure and calling MM_RegisterObject.

An example follows:

  
  ccode = MM_RegisterObject(&identifierObjectHandle, 
     MM_IDENTIFIER_CLASS, &identifierRegistrationDef, 
     applicationHandle, identifierResourceTag);
  

identifierResourceTag should have been acquired with the signature MM_IDENTIFIER_SIGNATURE. (See Overview of Resource Tags.)

3.5.2 Identifier Generic Information

An identifier's generic information can be obtained by calling MM_ReturnObjectGenericInfo. The IdentifierGenericInfoDef structure is returned for the identifier OBID.