4.1 Allocation of Media with INtmsMediaServices1

The following example illustrates the allocation of media with the RSM Remote Protocol, using the INtmsMediaServices1 interface.

Example of media allocation

Figure 1: Example of media allocation

  1. The client calls INtmsSession1::OpenNtmsServerSessionA to open a session with the server.

  2. The server initializes the session and indicates success.

  3. The client calls INtmsMediaServices1::CreateNtmsMediaPoolA, with lpPoolName as a pointer to the pool name that the client wants to create.

  4. The server creates a media pool with the name that was passed by the client, and returns a unique ID (that is, lpPoolId) and indicates success.

  5. The client calls INtmsMediaServices1::AllocateNtmsMedia and passes in lpPoolId.

  6. The server allocates media from the free pool, and moves the media to a pool identified by the lpPoolId value sent by the client. The server returns allocation information and the media ID (lpMediaId) to the client.

  7. The client calls INtmsMediaServices1::MountNtmsMedia, passing in both lpPoolId and lpMediaId.

  8. The server mounts the media and returns lpDriveId.

  9. The client reads and writes to the media that is identified by lpDriveId. The client then calls INtmsMediaServices1::DismountNtmsMedia and passes in lpMediaId.

  10. The server dismounts the media and indicates success.

  11. The client calls INtmsMediaServices1::DeallocateNtmsMedia and passes in lpMediaId.

  12. The server frees the media and indicates success.

  13. The client calls INtmsSession1::CloseNtmsSession.

  14. The server closes the session and indicates success.