Microsoft Corporation
IMAPIv2 architecture Creating IMAPIv2 extensions Erase Extension Example Using IMAPIv2 extensions Shell Extension Example Additional Resources Discussion/Q&A
Helper Objects
User-presented content
Helper Objects Stream of prepared content
Helper Objects Logical device commands
Helper Objects OS packaged device commands
Example Scenario A new type of erase is supported by hardware Developer’s goal is to enable this new functionality through Windows for the end user Strategy Create an extension of IMAPIv2 to support the new erase method Expose functionality to users through a shell extension Solution Analysis Extend IMAPIv2 at the Disc Format level Does not involve user content Sends a specific sequence of logical commands to the device Implementation involves media-specific information
interface IEraseSample : IDiscFormat2 { // properties HRESULT Recorder([in] IDiscRecorder2 * value); HRESULT FullErase([in] VARIANT_BOOL value ); HRESULT ClientName([in] BSTR name); // methods HRESULT EraseMedia(); } Simple interface that extends IDiscFormat2 Includes new scenario specific methods and properties
HRESULT PerformErase(VARIANT_BOOL vbFullErase, IDiscRecorder2 *pDiscRecorder) { // create the new object // create the new object CoCreateInstance(CLSID_EraseSample, CoCreateInstance(CLSID_EraseSample, NULL, CLSCTX_ALL, NULL, CLSCTX_ALL, IID_PPV_ARGS(&pErase)); IID_PPV_ARGS(&pErase)); // use IDiscFormat2 method to ensure the operation is supported // use IDiscFormat2 method to ensure the operation is supported pErase->IsCurrentMediaSupported(pDiscRecorder, &vbEraseSupported); pErase->IsCurrentMediaSupported(pDiscRecorder, &vbEraseSupported); if (vbEraseSupported) { if (vbEraseSupported) { // attach the standard disc recorder // attach the standard disc recorder pErase->put_Recorder(pDiscRecorder); pErase->put_Recorder(pDiscRecorder); // set the appropriate properties // set the appropriate properties pErase->put_FullErase(vbFullErase); pErase->put_FullErase(vbFullErase); pErase->put_ClientName(SysAllocString(L"EraseShellExt")); pErase->put_ClientName(SysAllocString(L"EraseShellExt")); // perform the erase! // perform the erase! pErase->EraseMedia(); pErase->EraseMedia(); }}
Documentation and Examples MSDN WDK and SDK IMAPIv2 on WHDC Contact Information Optical Platform Discussion Forum Please don’t send code to this alias! microsoft.com
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.