Image Masterin api (imapi)


Extending the IDiscmaster and IDiscRecorder Interfaces



Yüklə 373 Kb.
səhifə3/6
tarix07.11.2018
ölçüsü373 Kb.
#78601
1   2   3   4   5   6

Extending the IDiscmaster and IDiscRecorder Interfaces


Such implementations should pay attention to restrictions on simultaneous access.

Exclusive access is not provided directly the by upper level IMAPI components. There may be multiple instances of the MSDiscMasterObj active on a system at the same time. However, in the case of the Microsoft implementation of IMAPI, there is only a single disc stash allowed open on the system at a time (it is definitely exclusive access).

A third-party implementation that extends IMAPI might not utilize the stash at all, and might therefore allow simultaneous access to all of its format masters.

As with IDiscMaster, an implementer of IDiscRecorder should pay attention to concurrency issues with the physical recorders. IMAPI burn engines must access physical devices through IMAPIW2K.SYS, which provides device enumeration, locking, and raw access to CD-ROM, CD-R, and CD-R/W style devices. It is IMAPIW2K.SYS that exports the GUIDs used to Init instances of MSDiscRecorderObj.


Creating Multi-session Discs


IMAPI is capable of creating multi-session data discs. There are a few additional points that should be kept in mind when doing so.

SetActiveDiscRecorder determines whether there is an IMAPI multi-session disc in the active drive upon setting. If so, IMAPI goes into multi-session mode automatically. Using ClearFormatContent after multi-session mode has been established will cause IMAPI to return to single-session mode. That means that a blank disc will be required for a RecordDisc burn. If in multi-session mode and a call is made to RecordDisc, the same disc must be in the active recorder or an error code of IMAPI_E_WRONGDISC will be returned.

Selecting a recorder while in an active Joliet format will cause IMAPI to read information off of the currently installed disc of the recorder. If this disc is a previous IMAPI Joliet disc and has space for another session, IMAPI will automatically set itself to multi-session mode. This disc will have to be present in the active recorder when RecordDisc is called.



There are 21 MB used to close the first session on a disc. Each additional session requires 11 MB to close.

Language Notes


The IMAPI interface can be utilized through its type library within Visual Basic or Visual C++. Use the following steps to import the type library in Visual C++:

  1. Start the OLE/COM Object Viewer delivered with the SDK and Visual C++.

  2. Expand the “All Objects” node and scroll down to the Microsoft IMAPI Disc Master object. Click on the object’s name, but do not expand the node to avoid a COM reference.

  3. In the right hand pane select the “Implementation” tab and the “Local Server” sub-tab.
    Note the IMAPI.EXE’s full “Path to Implementation.”

  4. Use a ‘#import “
    ”’ line in the header of those modules which will reference the IMAPI objects and their interfaces.

  5. Utilize the classes or smart pointers defined in the header files generated by the import to instantiate and manipulate IMAPI objects.

A full discourse on the proper use of COM through the #import statement is beyond the scope of this document. The reader should be very familiar with the contents of #import Visual C++ documentation in the MSDN library. It covers, in detail, the establishment of a namespace, the creation of the .TLH and .TLI files, and the creation of specialized smart pointers for the classes in those headers. Make sure to actually open and review the .TLH and .TLI files created by the import statement. It really will clear up any confusion surrounding parameters, return values, or exception generation.

Image Mastering API Reference

Interfaces

IDiscMaster


The IDiscMaster interface allows an application to reserve an image mastering API, enumerate disc mastering formats and disc recorders supported by an image mastering object, and start a simulated or actual burn of a disc. Although an image mastering object may support several formats through different interfaces, not all formats may be accessible through a specific recorder. For this reason a recorder must be chosen with SetActiveDiscRecorder after a specific format is chosen with SetActiveDiscRecorderFormat. The MSDiscMasterObj supports IJolietDiscMaster and IRedbookDiscMaster formats.

Methods in Vtable Order

Iunknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments the reference count.

Release

Decrements the reference count.



IDiscMaster Methods

Description

Open

Open an Image Mastering API object.

EnumDiscMasterFormats

Retrieve a format enumerator.

GetActiveDiscMasterFormat

Get the currently selected recorder format.

SetActiveDiscMasterFormat

Set a new active recorder format.

EnumDiscRecorders

Retrieve a recorder enumerator.

GetActiveDiscRecorder

Get the currently active disc recorder.

SetActiveDiscRecorder

Select a new active disc recorder.

ClearFormatContent

Reset the “contents” of an unburned image.

ProgressAdvise

Request progress notifications from IMAPI.

ProgressUnadvise

Cancel progress notifications from IMAPI.

RecordDisc

Burn the staged image to active recorder.

Close

Discontinue use of IMAPI.

Yüklə 373 Kb.

Dostları ilə paylaş:
1   2   3   4   5   6




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə