0 out of 1 rated this helpful - Rate this topic

IBurnVerification interface

Applies to: desktop apps only

Use this interface with IDiscFormat2Data or IDiscFormat2TrackAtOnce to get or set the Burn Verification Level property which dictates how burned media is verified for integrity after the write operation.

Members

The IBurnVerification interface inherits from the IUnknown interface. IBurnVerification also has these types of members:

Methods

The IBurnVerification interface has these methods.

MethodDescription
get_BurnVerificationLevel

Retrieves the current Burn Verification Level.

put_BurnVerificationLevel

Sets the Burn Verification Level.

 

Remarks

The following example function demonstrates how the burn verification level defined by IMAPI_BURN_VERIFICATION_LEVEL, can be implemented. Burn verification level should be set prior to a burn operation.


#include <imapi2.h>

HRESULT setBurnVerification(
    IDiscFormat2Data                *DataWriter,
    IMAPI_BURN_VERIFICATION_LEVEL   VerificationLevel
    )

{
    HRESULT hr = S_OK;
    IBurnVerification *burnVerifier = NULL;
 
    hr = DataWriter->QueryInterface(IID_PPV_ARGS(&burnVerifier));
 
    if (SUCCEEDED(hr))
    {
        hr = burnVerifier->put_BurnVerificationLevel(VerificationLevel);
    }
 
    if (burnVerifier != NULL)
    {
        burnVerifier->Release();
        burnVerifier = NULL;
    }
 
    return hr;
}


This interface is supported in Windows Server 2003 with Service Pack 1 (SP1), Windows XP with Service Pack 2 (SP2), and Windows Vista via the Windows Feature Pack for Storage. All features provided by this update package are supported natively in Windows 7 and Windows Server 2008 R2.

Requirements

Minimum supported client

Windows Vista, Windows XP with SP2

Minimum supported server

Windows Server 2003

IDL

Imapi2.idl

See also

IMAPI_BURN_VERIFICATION_LEVEL
IDiscFormat2Data
IDiscFormat2TrackAtOnce

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
C#:
using System;
using System.Runtime.InteropServices;
namespace BVTest
{

    public interface IBurnVerification
    {
        void setVerificationLevel(IMAPI2.IDiscFormat2Data dataWriter, int _verificationLevel);
        int getVerificationLevel(IMAPI2.IDiscFormat2Data dataWriter);
    }

    [ClassInterface(ClassInterfaceType.AutoDual)]
    public class BurnVerify : IBurnVerification
    {
        public void setVerificationLevel(IMAPI2.IDiscFormat2Data dataWriter, int _verificationLevel)
        {
            var burnVerification = (IMAPI2.IBurnVerification)dataWriter;
            burnVerification.BurnVerificationLevel = (IMAPI2.IMAPI_BURN_VERIFICATION_LEVEL)_verificationLevel;
        }

        public int getVerificationLevel(IMAPI2.IDiscFormat2Data dataWriter)
        {
            var burnVerification = (IMAPI2.IBurnVerification)dataWriter;
            return (int)burnVerification.BurnVerificationLevel;
        }
    }
}
Scripting languages limitation and workaround
IBurnVerification is derived from IUnknown, and to get it you need to call QueryInterface. That's the reason why BurnVerification level cannot be set up in scripting language. This limitation will be fixed in next IMAPI release.

There is a workaround for current release:
You will need to implement small COM library, which will accept IDiscFormat2Data & BurnVerificationLevel. Inside actual method, which takes both args, you'll need to call QueryInterface and set up appropriate level. Don't forget to register your COM with regsvr32 ;-)

Sample:

STDMETHODIMP CIMAPI2Helper::get_VerificationLevel(IDiscFormat2Data* df2d, IMAPI_BURN_VERIFICATION_LEVEL* vLevel)
{
CComPtr<IBurnVerification> burnVerifier;
HRESULT hr = df2d != NULL ? df2d->QueryInterface(&burnVerifier) : E_POINTER;
return burnVerifier != NULL ? burnVerifier->get_BurnVerificationLevel(vLevel) : hr;
}

STDMETHODIMP CIMAPI2Helper::put_VerificationLevel(IDiscFormat2Data* df2d, IMAPI_BURN_VERIFICATION_LEVEL vLevel)
{
CComPtr<IBurnVerification> burnVerifier;
HRESULT hr = df2d != NULL ? df2d->QueryInterface(&burnVerifier) : E_POINTER;
return burnVerifier != NULL ? burnVerifier->put_BurnVerificationLevel(vLevel) : hr;
}

And in javascript & vbscript you'll be able to use:
//declare burn verification level
/// <summary>Burn verification level</summary>
var BurnVerificationLevel = {
/// <summary>No write verification</summary>
None: 0x0000,
/// <summary>Quick write verification</summary>
Quick: 0x0001,
/// <summary>Full write verification</summary>
Full: 0x0002
};

var DataWriter = new ActiveXObject("IMAPI2.MsftDiscFormat2Data");
var IMAPIHelper = new ActiveXObject("IMAPI2Utilities.IMAPI2Helper");
IMAPIHelper.VerificationLevel(DataWriter) = BurnVerificationLevel.Full;
_LogTrace("Verification level is " + IMAPIHelper.VerificationLevel(DataWriter));

That's it! Now you can easily set and get verification level in scripting languages (javascript, vbscript, powershell)

Feel free to contact me if you have any questions :-)

Mikhail