Imapi2Interop.cs 132 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190
  1. // Imapi2Interop.cs
  2. //
  3. // by Eric Haddan
  4. //
  5. // Parts taken from Microsoft's Interop.cs
  6. //
  7. using System;
  8. using System.Collections;
  9. using System.Diagnostics;
  10. using System.IO;
  11. using System.Runtime.CompilerServices;
  12. using System.Runtime.InteropServices;
  13. using System.Runtime.InteropServices.ComTypes;
  14. using System.Threading;
  15. namespace IMAPI2.Interop
  16. {
  17. #region IMAPI2 Enums
  18. public enum EmulationType
  19. {
  20. EmulationNone,
  21. Emulation12MFloppy,
  22. Emulation144MFloppy,
  23. Emulation288MFloppy,
  24. EmulationHardDisk
  25. }
  26. [Flags]
  27. public enum FsiFileSystems
  28. {
  29. FsiFileSystemNone = 0,
  30. FsiFileSystemISO9660 = 1,
  31. FsiFileSystemJoliet = 2,
  32. FsiFileSystemUDF = 4,
  33. FsiFileSystemUnknown = 0x40000000
  34. }
  35. public enum FsiItemType
  36. {
  37. FsiItemNotFound,
  38. FsiItemDirectory,
  39. FsiItemFile
  40. }
  41. public enum IMAPI_BURN_VERIFICATION_LEVEL
  42. {
  43. IMAPI_BURN_VERIFICATION_NONE,
  44. IMAPI_BURN_VERIFICATION_QUICK,
  45. IMAPI_BURN_VERIFICATION_FULL
  46. }
  47. public enum IMAPI_CD_SECTOR_TYPE
  48. {
  49. IMAPI_CD_SECTOR_AUDIO,
  50. IMAPI_CD_SECTOR_MODE_ZERO,
  51. IMAPI_CD_SECTOR_MODE1,
  52. IMAPI_CD_SECTOR_MODE2FORM0,
  53. IMAPI_CD_SECTOR_MODE2FORM1,
  54. IMAPI_CD_SECTOR_MODE2FORM2,
  55. IMAPI_CD_SECTOR_MODE1RAW,
  56. IMAPI_CD_SECTOR_MODE2FORM0RAW,
  57. IMAPI_CD_SECTOR_MODE2FORM1RAW,
  58. IMAPI_CD_SECTOR_MODE2FORM2RAW
  59. }
  60. public enum IMAPI_CD_TRACK_DIGITAL_COPY_SETTING
  61. {
  62. IMAPI_CD_TRACK_DIGITAL_COPY_PERMITTED,
  63. IMAPI_CD_TRACK_DIGITAL_COPY_PROHIBITED,
  64. IMAPI_CD_TRACK_DIGITAL_COPY_SCMS
  65. }
  66. public enum IMAPI_FEATURE_PAGE_TYPE
  67. {
  68. IMAPI_FEATURE_PAGE_TYPE_PROFILE_LIST = 0,
  69. IMAPI_FEATURE_PAGE_TYPE_CORE = 1,
  70. IMAPI_FEATURE_PAGE_TYPE_MORPHING = 2,
  71. IMAPI_FEATURE_PAGE_TYPE_REMOVABLE_MEDIUM = 3,
  72. IMAPI_FEATURE_PAGE_TYPE_WRITE_PROTECT = 4,
  73. IMAPI_FEATURE_PAGE_TYPE_RANDOMLY_READABLE = 0x10,
  74. IMAPI_FEATURE_PAGE_TYPE_CD_MULTIREAD = 0x1d,
  75. IMAPI_FEATURE_PAGE_TYPE_CD_READ = 0x1e,
  76. IMAPI_FEATURE_PAGE_TYPE_DVD_READ = 0x1f,
  77. IMAPI_FEATURE_PAGE_TYPE_RANDOMLY_WRITABLE = 0x20,
  78. IMAPI_FEATURE_PAGE_TYPE_INCREMENTAL_STREAMING_WRITABLE = 0x21,
  79. IMAPI_FEATURE_PAGE_TYPE_SECTOR_ERASABLE = 0x22,
  80. IMAPI_FEATURE_PAGE_TYPE_FORMATTABLE = 0x23,
  81. IMAPI_FEATURE_PAGE_TYPE_HARDWARE_DEFECT_MANAGEMENT = 0x24,
  82. IMAPI_FEATURE_PAGE_TYPE_WRITE_ONCE = 0x25,
  83. IMAPI_FEATURE_PAGE_TYPE_RESTRICTED_OVERWRITE = 0x26,
  84. IMAPI_FEATURE_PAGE_TYPE_CDRW_CAV_WRITE = 0x27,
  85. IMAPI_FEATURE_PAGE_TYPE_MRW = 0x28,
  86. IMAPI_FEATURE_PAGE_TYPE_ENHANCED_DEFECT_REPORTING = 0x29,
  87. IMAPI_FEATURE_PAGE_TYPE_DVD_PLUS_RW = 0x2a,
  88. IMAPI_FEATURE_PAGE_TYPE_DVD_PLUS_R = 0x2b,
  89. IMAPI_FEATURE_PAGE_TYPE_RIGID_RESTRICTED_OVERWRITE = 0x2c,
  90. IMAPI_FEATURE_PAGE_TYPE_CD_TRACK_AT_ONCE = 0x2d,
  91. IMAPI_FEATURE_PAGE_TYPE_CD_MASTERING = 0x2e,
  92. IMAPI_FEATURE_PAGE_TYPE_DVD_DASH_WRITE = 0x2f,
  93. IMAPI_FEATURE_PAGE_TYPE_DOUBLE_DENSITY_CD_READ = 0x30,
  94. IMAPI_FEATURE_PAGE_TYPE_DOUBLE_DENSITY_CD_R_WRITE = 0x31,
  95. IMAPI_FEATURE_PAGE_TYPE_DOUBLE_DENSITY_CD_RW_WRITE = 0x32,
  96. IMAPI_FEATURE_PAGE_TYPE_LAYER_JUMP_RECORDING = 0x33,
  97. IMAPI_FEATURE_PAGE_TYPE_CD_RW_MEDIA_WRITE_SUPPORT = 0x37,
  98. IMAPI_FEATURE_PAGE_TYPE_BD_PSEUDO_OVERWRITE = 0x38,
  99. IMAPI_FEATURE_PAGE_TYPE_DVD_PLUS_R_DUAL_LAYER = 0x3b,
  100. IMAPI_FEATURE_PAGE_TYPE_BD_READ = 0x40,
  101. IMAPI_FEATURE_PAGE_TYPE_BD_WRITE = 0x41,
  102. IMAPI_FEATURE_PAGE_TYPE_HD_DVD_READ = 0x50,
  103. IMAPI_FEATURE_PAGE_TYPE_HD_DVD_WRITE = 0x51,
  104. IMAPI_FEATURE_PAGE_TYPE_POWER_MANAGEMENT = 0x100,
  105. IMAPI_FEATURE_PAGE_TYPE_SMART = 0x101,
  106. IMAPI_FEATURE_PAGE_TYPE_EMBEDDED_CHANGER = 0x102,
  107. IMAPI_FEATURE_PAGE_TYPE_CD_ANALOG_PLAY = 0x103,
  108. IMAPI_FEATURE_PAGE_TYPE_MICROCODE_UPDATE = 0x104,
  109. IMAPI_FEATURE_PAGE_TYPE_TIMEOUT = 0x105,
  110. IMAPI_FEATURE_PAGE_TYPE_DVD_CSS = 0x106,
  111. IMAPI_FEATURE_PAGE_TYPE_REAL_TIME_STREAMING = 0x107,
  112. IMAPI_FEATURE_PAGE_TYPE_LOGICAL_UNIT_SERIAL_NUMBER = 0x108,
  113. IMAPI_FEATURE_PAGE_TYPE_MEDIA_SERIAL_NUMBER = 0x109,
  114. IMAPI_FEATURE_PAGE_TYPE_DISC_CONTROL_BLOCKS = 0x10a,
  115. IMAPI_FEATURE_PAGE_TYPE_DVD_CPRM = 0x10b,
  116. IMAPI_FEATURE_PAGE_TYPE_FIRMWARE_INFORMATION = 0x10c,
  117. IMAPI_FEATURE_PAGE_TYPE_AACS = 0x10d,
  118. IMAPI_FEATURE_PAGE_TYPE_VCPS = 0x110
  119. }
  120. public enum IMAPI_FORMAT2_DATA_MEDIA_STATE
  121. {
  122. [TypeLibVar((short)0x40)]
  123. IMAPI_FORMAT2_DATA_MEDIA_STATE_UNKNOWN = 0,
  124. IMAPI_FORMAT2_DATA_MEDIA_STATE_OVERWRITE_ONLY = 1,
  125. IMAPI_FORMAT2_DATA_MEDIA_STATE_RANDOMLY_WRITABLE = 1,
  126. IMAPI_FORMAT2_DATA_MEDIA_STATE_BLANK = 2,
  127. IMAPI_FORMAT2_DATA_MEDIA_STATE_APPENDABLE = 4,
  128. IMAPI_FORMAT2_DATA_MEDIA_STATE_FINAL_SESSION = 8,
  129. IMAPI_FORMAT2_DATA_MEDIA_STATE_INFORMATIONAL_MASK = 15,
  130. IMAPI_FORMAT2_DATA_MEDIA_STATE_DAMAGED = 0x400,
  131. IMAPI_FORMAT2_DATA_MEDIA_STATE_ERASE_REQUIRED = 0x800,
  132. IMAPI_FORMAT2_DATA_MEDIA_STATE_NON_EMPTY_SESSION = 0x1000,
  133. IMAPI_FORMAT2_DATA_MEDIA_STATE_WRITE_PROTECTED = 0x2000,
  134. IMAPI_FORMAT2_DATA_MEDIA_STATE_FINALIZED = 0x4000,
  135. IMAPI_FORMAT2_DATA_MEDIA_STATE_UNSUPPORTED_MEDIA = 0x8000,
  136. IMAPI_FORMAT2_DATA_MEDIA_STATE_UNSUPPORTED_MASK = 0xfc00
  137. }
  138. public enum IMAPI_FORMAT2_DATA_WRITE_ACTION
  139. {
  140. IMAPI_FORMAT2_DATA_WRITE_ACTION_VALIDATING_MEDIA,
  141. IMAPI_FORMAT2_DATA_WRITE_ACTION_FORMATTING_MEDIA,
  142. IMAPI_FORMAT2_DATA_WRITE_ACTION_INITIALIZING_HARDWARE,
  143. IMAPI_FORMAT2_DATA_WRITE_ACTION_CALIBRATING_POWER,
  144. IMAPI_FORMAT2_DATA_WRITE_ACTION_WRITING_DATA,
  145. IMAPI_FORMAT2_DATA_WRITE_ACTION_FINALIZATION,
  146. IMAPI_FORMAT2_DATA_WRITE_ACTION_COMPLETED,
  147. IMAPI_FORMAT2_DATA_WRITE_ACTION_VERIFYING
  148. }
  149. public enum IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE
  150. {
  151. IMAPI_FORMAT2_RAW_CD_SUBCODE_PQ_ONLY = 1,
  152. IMAPI_FORMAT2_RAW_CD_SUBCODE_IS_COOKED = 2,
  153. IMAPI_FORMAT2_RAW_CD_SUBCODE_IS_RAW = 3
  154. }
  155. public enum IMAPI_FORMAT2_RAW_CD_WRITE_ACTION
  156. {
  157. [TypeLibVar((short) 0x40)]
  158. IMAPI_FORMAT2_RAW_CD_WRITE_ACTION_UNKNOWN = 0,
  159. IMAPI_FORMAT2_RAW_CD_WRITE_ACTION_PREPARING = 1,
  160. IMAPI_FORMAT2_RAW_CD_WRITE_ACTION_WRITING = 2,
  161. IMAPI_FORMAT2_RAW_CD_WRITE_ACTION_FINISHING = 3
  162. }
  163. public enum IMAPI_FORMAT2_TAO_WRITE_ACTION
  164. {
  165. [TypeLibVar((short) 0x40)]
  166. IMAPI_FORMAT2_TAO_WRITE_ACTION_UNKNOWN = 0,
  167. IMAPI_FORMAT2_TAO_WRITE_ACTION_PREPARING = 1,
  168. IMAPI_FORMAT2_TAO_WRITE_ACTION_WRITING = 2,
  169. IMAPI_FORMAT2_TAO_WRITE_ACTION_FINISHING = 3,
  170. IMAPI_FORMAT2_TAO_WRITE_ACTION_VERIFYING = 4
  171. }
  172. public enum IMAPI_MEDIA_PHYSICAL_TYPE
  173. {
  174. IMAPI_MEDIA_TYPE_UNKNOWN = 0,
  175. IMAPI_MEDIA_TYPE_CDROM = 1,
  176. IMAPI_MEDIA_TYPE_CDR = 2,
  177. IMAPI_MEDIA_TYPE_CDRW = 3,
  178. IMAPI_MEDIA_TYPE_DVDROM = 4,
  179. IMAPI_MEDIA_TYPE_DVDRAM = 5,
  180. IMAPI_MEDIA_TYPE_DVDPLUSR = 6,
  181. IMAPI_MEDIA_TYPE_DVDPLUSRW = 7,
  182. IMAPI_MEDIA_TYPE_DVDPLUSR_DUALLAYER = 8,
  183. IMAPI_MEDIA_TYPE_DVDDASHR = 9,
  184. IMAPI_MEDIA_TYPE_DVDDASHRW = 10,
  185. IMAPI_MEDIA_TYPE_DVDDASHR_DUALLAYER = 11,
  186. IMAPI_MEDIA_TYPE_DISK = 12,
  187. IMAPI_MEDIA_TYPE_DVDPLUSRW_DUALLAYER = 13,
  188. IMAPI_MEDIA_TYPE_HDDVDROM = 14,
  189. IMAPI_MEDIA_TYPE_HDDVDR = 15,
  190. IMAPI_MEDIA_TYPE_HDDVDRAM = 0x10,
  191. IMAPI_MEDIA_TYPE_BDROM = 0x11,
  192. IMAPI_MEDIA_TYPE_BDR = 0x12,
  193. IMAPI_MEDIA_TYPE_BDRE = 0x13,
  194. IMAPI_MEDIA_TYPE_MAX = 0x13
  195. }
  196. public enum IMAPI_MEDIA_WRITE_PROTECT_STATE
  197. {
  198. IMAPI_WRITEPROTECTED_UNTIL_POWERDOWN = 1,
  199. IMAPI_WRITEPROTECTED_BY_CARTRIDGE = 2,
  200. IMAPI_WRITEPROTECTED_BY_MEDIA_SPECIFIC_REASON = 4,
  201. IMAPI_WRITEPROTECTED_BY_SOFTWARE_WRITE_PROTECT = 8,
  202. IMAPI_WRITEPROTECTED_BY_DISC_CONTROL_BLOCK = 0x10,
  203. IMAPI_WRITEPROTECTED_READ_ONLY_MEDIA = 0x4000
  204. }
  205. public enum IMAPI_MODE_PAGE_REQUEST_TYPE
  206. {
  207. IMAPI_MODE_PAGE_REQUEST_TYPE_CURRENT_VALUES,
  208. IMAPI_MODE_PAGE_REQUEST_TYPE_CHANGEABLE_VALUES,
  209. IMAPI_MODE_PAGE_REQUEST_TYPE_DEFAULT_VALUES,
  210. IMAPI_MODE_PAGE_REQUEST_TYPE_SAVED_VALUES
  211. }
  212. public enum IMAPI_MODE_PAGE_TYPE
  213. {
  214. IMAPI_MODE_PAGE_TYPE_READ_WRITE_ERROR_RECOVERY = 1,
  215. IMAPI_MODE_PAGE_TYPE_MRW = 3,
  216. IMAPI_MODE_PAGE_TYPE_WRITE_PARAMETERS = 5,
  217. IMAPI_MODE_PAGE_TYPE_CACHING = 8,
  218. IMAPI_MODE_PAGE_TYPE_POWER_CONDITION = 0x1a,
  219. IMAPI_MODE_PAGE_TYPE_TIMEOUT_AND_PROTECT = 0x1d,
  220. IMAPI_MODE_PAGE_TYPE_INFORMATIONAL_EXCEPTIONS = 0x1c,
  221. IMAPI_MODE_PAGE_TYPE_LEGACY_CAPABILITIES = 0x2a
  222. }
  223. public enum IMAPI_PROFILE_TYPE
  224. {
  225. IMAPI_PROFILE_TYPE_INVALID = 0,
  226. IMAPI_PROFILE_TYPE_NON_REMOVABLE_DISK = 1,
  227. IMAPI_PROFILE_TYPE_REMOVABLE_DISK = 2,
  228. IMAPI_PROFILE_TYPE_MO_ERASABLE = 3,
  229. IMAPI_PROFILE_TYPE_MO_WRITE_ONCE = 4,
  230. IMAPI_PROFILE_TYPE_AS_MO = 5,
  231. IMAPI_PROFILE_TYPE_CDROM = 8,
  232. IMAPI_PROFILE_TYPE_CD_RECORDABLE = 9,
  233. IMAPI_PROFILE_TYPE_CD_REWRITABLE = 10,
  234. IMAPI_PROFILE_TYPE_DVDROM = 0x10,
  235. IMAPI_PROFILE_TYPE_DVD_DASH_RECORDABLE = 0x11,
  236. IMAPI_PROFILE_TYPE_DVD_RAM = 0x12,
  237. IMAPI_PROFILE_TYPE_DVD_DASH_REWRITABLE = 0x13,
  238. IMAPI_PROFILE_TYPE_DVD_DASH_RW_SEQUENTIAL = 0x14,
  239. IMAPI_PROFILE_TYPE_DVD_DASH_R_DUAL_SEQUENTIAL = 0x15,
  240. IMAPI_PROFILE_TYPE_DVD_DASH_R_DUAL_LAYER_JUMP = 0x16,
  241. IMAPI_PROFILE_TYPE_DVD_PLUS_RW = 0x1a,
  242. IMAPI_PROFILE_TYPE_DVD_PLUS_R = 0x1b,
  243. IMAPI_PROFILE_TYPE_DDCDROM = 0x20,
  244. IMAPI_PROFILE_TYPE_DDCD_RECORDABLE = 0x21,
  245. IMAPI_PROFILE_TYPE_DDCD_REWRITABLE = 0x22,
  246. IMAPI_PROFILE_TYPE_DVD_PLUS_RW_DUAL = 0x2a,
  247. IMAPI_PROFILE_TYPE_DVD_PLUS_R_DUAL = 0x2b,
  248. IMAPI_PROFILE_TYPE_BD_ROM = 0x40,
  249. IMAPI_PROFILE_TYPE_BD_R_SEQUENTIAL = 0x41,
  250. IMAPI_PROFILE_TYPE_BD_R_RANDOM_RECORDING = 0x42,
  251. IMAPI_PROFILE_TYPE_BD_REWRITABLE = 0x43,
  252. IMAPI_PROFILE_TYPE_HD_DVD_ROM = 0x50,
  253. IMAPI_PROFILE_TYPE_HD_DVD_RECORDABLE = 0x51,
  254. IMAPI_PROFILE_TYPE_HD_DVD_RAM = 0x52,
  255. IMAPI_PROFILE_TYPE_NON_STANDARD = 0xffff
  256. }
  257. public enum IMAPI_READ_TRACK_ADDRESS_TYPE
  258. {
  259. IMAPI_READ_TRACK_ADDRESS_TYPE_LBA,
  260. IMAPI_READ_TRACK_ADDRESS_TYPE_TRACK,
  261. IMAPI_READ_TRACK_ADDRESS_TYPE_SESSION
  262. }
  263. public enum PlatformId
  264. {
  265. PlatformX86 = 0,
  266. PlatformPowerPC = 1,
  267. PlatformMac = 2,
  268. PlatformEFI = 0xef
  269. }
  270. #endregion
  271. #region IMAPI2 Structures
  272. [StructLayout(LayoutKind.Sequential, Pack=4)]
  273. public struct _FILETIME
  274. {
  275. public uint dwLowDateTime;
  276. public uint dwHighDateTime;
  277. }
  278. [StructLayout(LayoutKind.Sequential, Pack=8)]
  279. public struct _LARGE_INTEGER
  280. {
  281. public long QuadPart;
  282. }
  283. [StructLayout(LayoutKind.Sequential, Pack=8)]
  284. public struct _ULARGE_INTEGER
  285. {
  286. public ulong QuadPart;
  287. }
  288. [StructLayout(LayoutKind.Sequential, Pack=4)]
  289. public struct tagCONNECTDATA
  290. {
  291. [MarshalAs(UnmanagedType.IUnknown)]
  292. public object pUnk;
  293. public uint dwCookie;
  294. }
  295. [StructLayout(LayoutKind.Sequential, Pack=8)]
  296. public struct tagSTATSTG
  297. {
  298. [MarshalAs(UnmanagedType.LPWStr)]
  299. public string pwcsName;
  300. public uint type;
  301. public _ULARGE_INTEGER cbSize;
  302. public _FILETIME mtime;
  303. public _FILETIME ctime;
  304. public _FILETIME atime;
  305. public uint grfMode;
  306. public uint grfLocksSupported;
  307. public Guid clsid;
  308. public uint grfStateBits;
  309. public uint reserved;
  310. }
  311. #endregion
  312. #region DDiscFormat2DataEvents
  313. /// <summary>
  314. /// Data Writer
  315. /// </summary>
  316. [ComImport]
  317. [Guid("2735413C-7F64-5B0F-8F00-5D77AFBE261E")]
  318. [TypeLibType(TypeLibTypeFlags.FNonExtensible|TypeLibTypeFlags.FOleAutomation|TypeLibTypeFlags.FDispatchable)]
  319. public interface DDiscFormat2DataEvents
  320. {
  321. // Update to current progress
  322. [DispId(0x200)] // DISPID_DDISCFORMAT2DATAEVENTS_UPDATE
  323. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  324. void Update([In, MarshalAs(UnmanagedType.IDispatch)] object sender, [In, MarshalAs(UnmanagedType.IDispatch)] object progress);
  325. }
  326. [ComVisible(false)]
  327. [ComEventInterface(typeof(DDiscFormat2DataEvents),typeof(DiscFormat2Data_EventProvider))]
  328. [TypeLibType(TypeLibTypeFlags.FHidden)]
  329. public interface DiscFormat2Data_Event
  330. {
  331. // Events
  332. event DiscFormat2Data_EventHandler Update;
  333. }
  334. [ClassInterface(ClassInterfaceType.None)]
  335. internal sealed class DiscFormat2Data_EventProvider : DiscFormat2Data_Event, IDisposable
  336. {
  337. // Fields
  338. private Hashtable m_aEventSinkHelpers = new Hashtable();
  339. private IConnectionPoint m_connectionPoint = null;
  340. // Methods
  341. public DiscFormat2Data_EventProvider(object pointContainer)
  342. {
  343. lock (this)
  344. {
  345. Guid eventsGuid = typeof(DDiscFormat2DataEvents).GUID;
  346. IConnectionPointContainer connectionPointContainer = pointContainer as IConnectionPointContainer;
  347. connectionPointContainer.FindConnectionPoint(ref eventsGuid, out m_connectionPoint);
  348. }
  349. }
  350. public event DiscFormat2Data_EventHandler Update
  351. {
  352. add
  353. {
  354. lock (this)
  355. {
  356. DiscFormat2Data_SinkHelper helper =
  357. new DiscFormat2Data_SinkHelper(value);
  358. int cookie;
  359. m_connectionPoint.Advise(helper, out cookie);
  360. helper.Cookie = cookie;
  361. m_aEventSinkHelpers.Add(helper.UpdateDelegate, helper);
  362. }
  363. }
  364. remove
  365. {
  366. lock (this)
  367. {
  368. DiscFormat2Data_SinkHelper helper =
  369. m_aEventSinkHelpers[value] as DiscFormat2Data_SinkHelper;
  370. if (helper != null)
  371. {
  372. m_connectionPoint.Unadvise(helper.Cookie);
  373. m_aEventSinkHelpers.Remove(helper.UpdateDelegate);
  374. }
  375. }
  376. }
  377. }
  378. ~DiscFormat2Data_EventProvider()
  379. {
  380. Cleanup();
  381. }
  382. public void Dispose()
  383. {
  384. Cleanup();
  385. GC.SuppressFinalize(this);
  386. }
  387. private void Cleanup()
  388. {
  389. Monitor.Enter(this);
  390. try
  391. {
  392. foreach (DiscFormat2Data_SinkHelper helper in m_aEventSinkHelpers.Values)
  393. {
  394. m_connectionPoint.Unadvise(helper.Cookie);
  395. }
  396. m_aEventSinkHelpers.Clear();
  397. Marshal.ReleaseComObject(m_connectionPoint);
  398. }
  399. catch (SynchronizationLockException)
  400. {
  401. return;
  402. }
  403. finally
  404. {
  405. Monitor.Exit(this);
  406. }
  407. }
  408. }
  409. [ClassInterface(ClassInterfaceType.None)]
  410. [TypeLibType(TypeLibTypeFlags.FHidden)]
  411. public sealed class DiscFormat2Data_SinkHelper : DDiscFormat2DataEvents
  412. {
  413. // Fields
  414. private int m_dwCookie;
  415. private DiscFormat2Data_EventHandler m_UpdateDelegate;
  416. // Methods
  417. internal DiscFormat2Data_SinkHelper(DiscFormat2Data_EventHandler eventHandler)
  418. {
  419. if (eventHandler == null)
  420. throw new ArgumentNullException("Delegate (callback function) cannot be null");
  421. m_dwCookie = 0;
  422. m_UpdateDelegate = eventHandler;
  423. }
  424. public void Update(object sender, object args)
  425. {
  426. m_UpdateDelegate(sender, args);
  427. }
  428. public int Cookie
  429. {
  430. get
  431. {
  432. return m_dwCookie;
  433. }
  434. set
  435. {
  436. m_dwCookie = value;
  437. }
  438. }
  439. public DiscFormat2Data_EventHandler UpdateDelegate
  440. {
  441. get
  442. {
  443. return m_UpdateDelegate;
  444. }
  445. set
  446. {
  447. m_UpdateDelegate = value;
  448. }
  449. }
  450. }
  451. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  452. public delegate void DiscFormat2Data_EventHandler([In, MarshalAs(UnmanagedType.IDispatch)] object sender, [In, MarshalAs(UnmanagedType.IDispatch)] object progress);
  453. #endregion // DDiscFormat2DataEvents
  454. #region DDiscFormat2EraseEvents
  455. /// <summary>
  456. /// Provides notification of media erase progress.
  457. /// </summary>
  458. [ComImport]
  459. [TypeLibType(TypeLibTypeFlags.FNonExtensible|TypeLibTypeFlags.FOleAutomation|TypeLibTypeFlags.FDispatchable)]
  460. [Guid("2735413A-7F64-5B0F-8F00-5D77AFBE261E")]
  461. public interface DDiscFormat2EraseEvents
  462. {
  463. // Update to current progress
  464. [DispId(0x200)] // DISPID_IDISCFORMAT2ERASEEVENTS_UPDATE
  465. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  466. void Update([In, MarshalAs(UnmanagedType.IDispatch)] object sender, [In] int elapsedSeconds, [In] int estimatedTotalSeconds);
  467. }
  468. [TypeLibType(TypeLibTypeFlags.FHidden)]
  469. [ComVisible(false)]
  470. [ComEventInterface(typeof(DDiscFormat2EraseEvents), typeof(DiscFormat2Erase_EventProvider))]
  471. public interface DiscFormat2Erase_Event
  472. {
  473. // Events
  474. event DiscFormat2Erase_EventHandler Update;
  475. }
  476. [ClassInterface(ClassInterfaceType.None)]
  477. internal sealed class DiscFormat2Erase_EventProvider : DiscFormat2Erase_Event, IDisposable
  478. {
  479. // Fields
  480. private Hashtable m_aEventSinkHelpers = new Hashtable();
  481. private IConnectionPoint m_connectionPoint = null;
  482. // Methods
  483. public DiscFormat2Erase_EventProvider(object pointContainer)
  484. {
  485. lock (this)
  486. {
  487. Guid eventsGuid = typeof(DDiscFormat2EraseEvents).GUID;
  488. IConnectionPointContainer connectionPointContainer = pointContainer as IConnectionPointContainer;
  489. connectionPointContainer.FindConnectionPoint(ref eventsGuid, out m_connectionPoint);
  490. }
  491. }
  492. public event DiscFormat2Erase_EventHandler Update
  493. {
  494. add
  495. {
  496. lock (this)
  497. {
  498. DiscFormat2Erase_SinkHelper helper =
  499. new DiscFormat2Erase_SinkHelper(value);
  500. int cookie = -1;
  501. m_connectionPoint.Advise(helper, out cookie);
  502. helper.Cookie = cookie;
  503. m_aEventSinkHelpers.Add(helper.UpdateDelegate, helper);
  504. }
  505. }
  506. remove
  507. {
  508. lock (this)
  509. {
  510. DiscFormat2Erase_SinkHelper helper =
  511. m_aEventSinkHelpers[value] as DiscFormat2Erase_SinkHelper;
  512. if (helper != null)
  513. {
  514. m_connectionPoint.Unadvise(helper.Cookie);
  515. m_aEventSinkHelpers.Remove(helper.UpdateDelegate);
  516. }
  517. }
  518. }
  519. }
  520. ~DiscFormat2Erase_EventProvider()
  521. {
  522. Cleanup();
  523. }
  524. public void Dispose()
  525. {
  526. Cleanup();
  527. GC.SuppressFinalize(this);
  528. }
  529. private void Cleanup()
  530. {
  531. Monitor.Enter(this);
  532. try
  533. {
  534. foreach (DiscFormat2Erase_SinkHelper helper in m_aEventSinkHelpers.Values)
  535. {
  536. m_connectionPoint.Unadvise(helper.Cookie);
  537. }
  538. m_aEventSinkHelpers.Clear();
  539. Marshal.ReleaseComObject(m_connectionPoint);
  540. }
  541. catch (SynchronizationLockException)
  542. {
  543. return;
  544. }
  545. finally
  546. {
  547. Monitor.Exit(this);
  548. }
  549. }
  550. }
  551. [TypeLibType(TypeLibTypeFlags.FHidden)]
  552. [ClassInterface(ClassInterfaceType.None)]
  553. public sealed class DiscFormat2Erase_SinkHelper : DDiscFormat2EraseEvents
  554. {
  555. // Fields
  556. private int m_dwCookie;
  557. private DiscFormat2Erase_EventHandler m_UpdateDelegate;
  558. public DiscFormat2Erase_SinkHelper(DiscFormat2Erase_EventHandler eventHandler)
  559. {
  560. if (eventHandler == null)
  561. throw new ArgumentNullException("Delegate (callback function) cannot be null");
  562. m_dwCookie = 0;
  563. m_UpdateDelegate = eventHandler;
  564. }
  565. public void Update(object sender, int elapsedSeconds, int estimatedTotalSeconds)
  566. {
  567. m_UpdateDelegate(sender, elapsedSeconds, estimatedTotalSeconds);
  568. }
  569. public int Cookie
  570. {
  571. get
  572. {
  573. return m_dwCookie;
  574. }
  575. set
  576. {
  577. m_dwCookie = value;
  578. }
  579. }
  580. public DiscFormat2Erase_EventHandler UpdateDelegate
  581. {
  582. get
  583. {
  584. return m_UpdateDelegate;
  585. }
  586. set
  587. {
  588. m_UpdateDelegate = value;
  589. }
  590. }
  591. }
  592. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  593. public delegate void DiscFormat2Erase_EventHandler([In, MarshalAs(UnmanagedType.IDispatch)]object sender, [In] int elapsedSeconds, [In] int estimatedTotalSeconds);
  594. #endregion // DDiscFormat2EraseEvents
  595. #region DDiscFormat2RawCDEvents
  596. /// <summary>
  597. /// CD Disc-At-Once RAW Writer Events
  598. /// </summary>
  599. [ComImport]
  600. [TypeLibType(TypeLibTypeFlags.FNonExtensible|TypeLibTypeFlags.FOleAutomation|TypeLibTypeFlags.FDispatchable)]
  601. [Guid("27354142-7F64-5B0F-8F00-5D77AFBE261E")]
  602. public interface DDiscFormat2RawCDEvents
  603. {
  604. // Update to current progress
  605. [DispId(0x200)] // DISPID_DDISCFORMAT2RAWCDEVENTS_UPDATE
  606. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  607. void Update([In, MarshalAs(UnmanagedType.IDispatch)] object sender, [In, MarshalAs(UnmanagedType.IDispatch)] object progress);
  608. }
  609. [ComEventInterface(typeof(DDiscFormat2RawCDEvents), typeof(DiscFormat2RawCD_EventProvider))]
  610. [TypeLibType(TypeLibTypeFlags.FHidden)]
  611. [ComVisible(false)]
  612. public interface DiscFormat2RawCD_Event
  613. {
  614. // Events
  615. event DiscFormat2RawCD_EventHandler Update;
  616. }
  617. [ClassInterface(ClassInterfaceType.None)]
  618. internal sealed class DiscFormat2RawCD_EventProvider : DiscFormat2RawCD_Event, IDisposable
  619. {
  620. // Fields
  621. private Hashtable m_aEventSinkHelpers = new Hashtable();
  622. private IConnectionPoint m_connectionPoint = null;
  623. // Methods
  624. public DiscFormat2RawCD_EventProvider(object pointContainer)
  625. {
  626. lock (this)
  627. {
  628. Guid eventsGuid = typeof(DDiscFormat2RawCDEvents).GUID;
  629. IConnectionPointContainer connectionPointContainer = pointContainer as IConnectionPointContainer;
  630. connectionPointContainer.FindConnectionPoint(ref eventsGuid, out m_connectionPoint);
  631. }
  632. }
  633. public event DiscFormat2RawCD_EventHandler Update
  634. {
  635. add
  636. {
  637. lock (this)
  638. {
  639. DiscFormat2RawCD_SinkHelper helper =
  640. new DiscFormat2RawCD_SinkHelper(value);
  641. int cookie;
  642. m_connectionPoint.Advise(helper, out cookie);
  643. helper.Cookie = cookie;
  644. m_aEventSinkHelpers.Add(helper.UpdateDelegate, helper);
  645. }
  646. }
  647. remove
  648. {
  649. lock (this)
  650. {
  651. DiscFormat2RawCD_SinkHelper helper =
  652. m_aEventSinkHelpers[value] as DiscFormat2RawCD_SinkHelper;
  653. if (helper != null)
  654. {
  655. m_connectionPoint.Unadvise(helper.Cookie);
  656. m_aEventSinkHelpers.Remove(helper.UpdateDelegate);
  657. }
  658. }
  659. }
  660. }
  661. ~DiscFormat2RawCD_EventProvider()
  662. {
  663. Cleanup();
  664. }
  665. public void Dispose()
  666. {
  667. Cleanup();
  668. GC.SuppressFinalize(this);
  669. }
  670. private void Cleanup()
  671. {
  672. Monitor.Enter(this);
  673. try
  674. {
  675. foreach (DiscFormat2RawCD_SinkHelper helper in m_aEventSinkHelpers.Values)
  676. {
  677. m_connectionPoint.Unadvise(helper.Cookie);
  678. }
  679. m_aEventSinkHelpers.Clear();
  680. Marshal.ReleaseComObject(m_connectionPoint);
  681. }
  682. catch (SynchronizationLockException)
  683. {
  684. return;
  685. }
  686. finally
  687. {
  688. Monitor.Exit(this);
  689. }
  690. }
  691. }
  692. [ClassInterface(ClassInterfaceType.None)]
  693. [TypeLibType(TypeLibTypeFlags.FHidden)]
  694. public sealed class DiscFormat2RawCD_SinkHelper : DDiscFormat2RawCDEvents
  695. {
  696. // Fields
  697. private int m_dwCookie;
  698. private DiscFormat2RawCD_EventHandler m_UpdateDelegate;
  699. public DiscFormat2RawCD_SinkHelper(DiscFormat2RawCD_EventHandler eventHandler)
  700. {
  701. if (eventHandler == null)
  702. throw new ArgumentNullException("Delegate (callback function) cannot be null");
  703. m_dwCookie = 0;
  704. m_UpdateDelegate = eventHandler;
  705. }
  706. public void Update(object sender, object progress)
  707. {
  708. m_UpdateDelegate(sender, progress);
  709. }
  710. public int Cookie
  711. {
  712. get
  713. {
  714. return m_dwCookie;
  715. }
  716. set
  717. {
  718. m_dwCookie = value;
  719. }
  720. }
  721. public DiscFormat2RawCD_EventHandler UpdateDelegate
  722. {
  723. get
  724. {
  725. return m_UpdateDelegate;
  726. }
  727. set
  728. {
  729. m_UpdateDelegate = value;
  730. }
  731. }
  732. }
  733. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  734. public delegate void DiscFormat2RawCD_EventHandler([In, MarshalAs(UnmanagedType.IDispatch)] object sender, [In, MarshalAs(UnmanagedType.IDispatch)] object progress);
  735. #endregion // DDiscFormat2RawCDEvents
  736. #region DDiscFormat2TrackAtOnceEvents
  737. /// <summary>
  738. /// CD Track-at-Once Audio Writer Events
  739. /// </summary>
  740. [ComImport]
  741. [Guid("2735413F-7F64-5B0F-8F00-5D77AFBE261E")]
  742. [TypeLibType(TypeLibTypeFlags.FNonExtensible|TypeLibTypeFlags.FOleAutomation|TypeLibTypeFlags.FDispatchable)]
  743. public interface DDiscFormat2TrackAtOnceEvents
  744. {
  745. // Update to current progress
  746. [DispId(0x200)] // DISPID_DDISCFORMAT2TAOEVENTS_UPDATE
  747. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  748. void Update([In, MarshalAs(UnmanagedType.IDispatch)] object sender, [In, MarshalAs(UnmanagedType.IDispatch)] object progress);
  749. }
  750. [ComVisible(false)]
  751. [TypeLibType(TypeLibTypeFlags.FHidden)]
  752. [ComEventInterface(typeof(DDiscFormat2TrackAtOnceEvents), typeof(DiscFormat2TrackAtOnce_EventProvider))]
  753. public interface DiscFormat2TrackAtOnce_Event
  754. {
  755. // Events
  756. event DiscFormat2TrackAtOnce_EventHandler Update;
  757. }
  758. [ClassInterface(ClassInterfaceType.None)]
  759. internal sealed class DiscFormat2TrackAtOnce_EventProvider : DiscFormat2TrackAtOnce_Event, IDisposable
  760. {
  761. // Fields
  762. private Hashtable m_aEventSinkHelpers = new Hashtable();
  763. private IConnectionPoint m_connectionPoint = null;
  764. // Methods
  765. public DiscFormat2TrackAtOnce_EventProvider(object pointContainer)
  766. {
  767. lock (this)
  768. {
  769. Guid eventsGuid = typeof(DDiscFormat2TrackAtOnceEvents).GUID;
  770. IConnectionPointContainer connectionPointContainer = pointContainer as IConnectionPointContainer;
  771. connectionPointContainer.FindConnectionPoint(ref eventsGuid, out m_connectionPoint);
  772. }
  773. }
  774. public event DiscFormat2TrackAtOnce_EventHandler Update
  775. {
  776. add
  777. {
  778. lock (this)
  779. {
  780. DiscFormat2TrackAtOnce_SinkHelper helper =
  781. new DiscFormat2TrackAtOnce_SinkHelper(value);
  782. int cookie;
  783. m_connectionPoint.Advise(helper, out cookie);
  784. helper.Cookie = cookie;
  785. m_aEventSinkHelpers.Add(helper.UpdateDelegate, helper);
  786. }
  787. }
  788. remove
  789. {
  790. lock (this)
  791. {
  792. DiscFormat2TrackAtOnce_SinkHelper helper =
  793. m_aEventSinkHelpers[value] as DiscFormat2TrackAtOnce_SinkHelper;
  794. if (helper != null)
  795. {
  796. m_connectionPoint.Unadvise(helper.Cookie);
  797. m_aEventSinkHelpers.Remove(helper.UpdateDelegate);
  798. }
  799. }
  800. }
  801. }
  802. ~DiscFormat2TrackAtOnce_EventProvider()
  803. {
  804. Cleanup();
  805. }
  806. public void Dispose()
  807. {
  808. Cleanup();
  809. GC.SuppressFinalize(this);
  810. }
  811. private void Cleanup()
  812. {
  813. Monitor.Enter(this);
  814. try
  815. {
  816. foreach (DiscFormat2TrackAtOnce_SinkHelper helper in m_aEventSinkHelpers.Values)
  817. {
  818. m_connectionPoint.Unadvise(helper.Cookie);
  819. }
  820. m_aEventSinkHelpers.Clear();
  821. Marshal.ReleaseComObject(m_connectionPoint);
  822. }
  823. catch (SynchronizationLockException)
  824. {
  825. return;
  826. }
  827. finally
  828. {
  829. Monitor.Exit(this);
  830. }
  831. }
  832. }
  833. [TypeLibType(TypeLibTypeFlags.FHidden)]
  834. [ClassInterface(ClassInterfaceType.None)]
  835. public sealed class DiscFormat2TrackAtOnce_SinkHelper : DDiscFormat2TrackAtOnceEvents
  836. {
  837. // Fields
  838. private int m_dwCookie;
  839. private DiscFormat2TrackAtOnce_EventHandler m_UpdateDelegate;
  840. public DiscFormat2TrackAtOnce_SinkHelper(DiscFormat2TrackAtOnce_EventHandler eventHandler)
  841. {
  842. if (eventHandler == null)
  843. throw new ArgumentNullException("Delegate (callback function) cannot be null");
  844. m_dwCookie = 0;
  845. m_UpdateDelegate = eventHandler;
  846. }
  847. public void Update(object sender, object progress)
  848. {
  849. m_UpdateDelegate(sender, progress);
  850. }
  851. public int Cookie
  852. {
  853. get
  854. {
  855. return m_dwCookie;
  856. }
  857. set
  858. {
  859. m_dwCookie = value;
  860. }
  861. }
  862. public DiscFormat2TrackAtOnce_EventHandler UpdateDelegate
  863. {
  864. get
  865. {
  866. return m_UpdateDelegate;
  867. }
  868. set
  869. {
  870. m_UpdateDelegate = value;
  871. }
  872. }
  873. }
  874. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  875. public delegate void DiscFormat2TrackAtOnce_EventHandler([In, MarshalAs(UnmanagedType.IDispatch)] object sender, [In, MarshalAs(UnmanagedType.IDispatch)] object progress);
  876. #endregion // DDiscFormat2TrackAtOnceEvents
  877. #region DDiscMaster2Events
  878. /// <summary>
  879. /// Provides notification of the arrival/removal of CD/DVD (optical) devices.
  880. /// </summary>
  881. [ComImport]
  882. [Guid("27354131-7F64-5B0F-8F00-5D77AFBE261E")]
  883. [TypeLibType(TypeLibTypeFlags.FNonExtensible|TypeLibTypeFlags.FOleAutomation|TypeLibTypeFlags.FDispatchable)]
  884. public interface DDiscMaster2Events
  885. {
  886. // A device was added to the system
  887. [DispId(0x100)] // DISPID_DDISCMASTER2EVENTS_DEVICEADDED
  888. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  889. void NotifyDeviceAdded([In, MarshalAs(UnmanagedType.IDispatch)] object sender, string uniqueId);
  890. // A device was removed from the system
  891. [DispId(0x101)] // DISPID_DDISCMASTER2EVENTS_DEVICEREMOVED
  892. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  893. void NotifyDeviceRemoved([In, MarshalAs(UnmanagedType.IDispatch)] object sender, string uniqueId);
  894. }
  895. [ComVisible(false)]
  896. [TypeLibType(TypeLibTypeFlags.FHidden)]
  897. [ComEventInterface(typeof(DDiscMaster2Events), typeof(DiscMaster2_EventProvider))]
  898. public interface DiscMaster2_Event
  899. {
  900. // Events
  901. event DiscMaster2_NotifyDeviceAddedEventHandler NotifyDeviceAdded;
  902. event DiscMaster2_NotifyDeviceRemovedEventHandler NotifyDeviceRemoved;
  903. }
  904. [ClassInterface(ClassInterfaceType.None)]
  905. internal sealed class DiscMaster2_EventProvider : DiscMaster2_Event, IDisposable
  906. {
  907. // Fields
  908. private Hashtable m_aEventSinkHelpers = new Hashtable();
  909. private IConnectionPoint m_connectionPoint = null;
  910. // Methods
  911. public DiscMaster2_EventProvider(object pointContainer)
  912. {
  913. lock (this)
  914. {
  915. Guid eventsGuid = typeof(DDiscMaster2Events).GUID;
  916. IConnectionPointContainer connectionPointContainer = pointContainer as IConnectionPointContainer;
  917. connectionPointContainer.FindConnectionPoint(ref eventsGuid, out m_connectionPoint);
  918. }
  919. }
  920. public event DiscMaster2_NotifyDeviceAddedEventHandler NotifyDeviceAdded
  921. {
  922. add
  923. {
  924. lock (this)
  925. {
  926. DiscMaster2_SinkHelper helper =
  927. new DiscMaster2_SinkHelper(value);
  928. int cookie;
  929. m_connectionPoint.Advise(helper, out cookie);
  930. helper.Cookie = cookie;
  931. m_aEventSinkHelpers.Add(helper.NotifyDeviceAddedDelegate, helper);
  932. }
  933. }
  934. remove
  935. {
  936. lock (this)
  937. {
  938. DiscMaster2_SinkHelper helper =
  939. m_aEventSinkHelpers[value] as DiscMaster2_SinkHelper;
  940. if (helper != null)
  941. {
  942. m_connectionPoint.Unadvise(helper.Cookie);
  943. m_aEventSinkHelpers.Remove(helper.NotifyDeviceAddedDelegate);
  944. }
  945. }
  946. }
  947. }
  948. public event DiscMaster2_NotifyDeviceRemovedEventHandler NotifyDeviceRemoved
  949. {
  950. add
  951. {
  952. lock (this)
  953. {
  954. DiscMaster2_SinkHelper helper =
  955. new DiscMaster2_SinkHelper(value);
  956. int cookie;
  957. m_connectionPoint.Advise(helper, out cookie);
  958. helper.Cookie = cookie;
  959. m_aEventSinkHelpers.Add(helper.NotifyDeviceRemovedDelegate, helper);
  960. }
  961. }
  962. remove
  963. {
  964. lock (this)
  965. {
  966. DiscMaster2_SinkHelper helper =
  967. m_aEventSinkHelpers[value] as DiscMaster2_SinkHelper;
  968. if (helper != null)
  969. {
  970. m_connectionPoint.Unadvise(helper.Cookie);
  971. m_aEventSinkHelpers.Remove(helper.NotifyDeviceRemovedDelegate);
  972. }
  973. }
  974. }
  975. }
  976. ~DiscMaster2_EventProvider()
  977. {
  978. Cleanup();
  979. }
  980. public void Dispose()
  981. {
  982. Cleanup();
  983. GC.SuppressFinalize(this);
  984. }
  985. private void Cleanup()
  986. {
  987. Monitor.Enter(this);
  988. try
  989. {
  990. foreach (DiscMaster2_SinkHelper helper in m_aEventSinkHelpers.Values)
  991. {
  992. m_connectionPoint.Unadvise(helper.Cookie);
  993. }
  994. m_aEventSinkHelpers.Clear();
  995. Marshal.ReleaseComObject(m_connectionPoint);
  996. }
  997. catch (SynchronizationLockException)
  998. {
  999. return;
  1000. }
  1001. finally
  1002. {
  1003. Monitor.Exit(this);
  1004. }
  1005. }
  1006. }
  1007. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1008. public delegate void DiscMaster2_NotifyDeviceAddedEventHandler([In, MarshalAs(UnmanagedType.IDispatch)]object sender, string uniqueId);
  1009. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1010. public delegate void DiscMaster2_NotifyDeviceRemovedEventHandler([In, MarshalAs(UnmanagedType.IDispatch)]object sender, string uniqueId);
  1011. [ClassInterface(ClassInterfaceType.None)]
  1012. [TypeLibType(TypeLibTypeFlags.FHidden)]
  1013. public sealed class DiscMaster2_SinkHelper : DDiscMaster2Events
  1014. {
  1015. // Fields
  1016. private int m_dwCookie;
  1017. private DiscMaster2_NotifyDeviceAddedEventHandler m_AddedDelegate = null;
  1018. private DiscMaster2_NotifyDeviceRemovedEventHandler m_RemovedDelegate = null;
  1019. public DiscMaster2_SinkHelper(DiscMaster2_NotifyDeviceAddedEventHandler eventHandler)
  1020. {
  1021. if (eventHandler == null)
  1022. throw new ArgumentNullException("Delegate (callback function) cannot be null");
  1023. m_dwCookie = 0;
  1024. m_AddedDelegate = eventHandler;
  1025. }
  1026. public DiscMaster2_SinkHelper(DiscMaster2_NotifyDeviceRemovedEventHandler eventHandler)
  1027. {
  1028. if (eventHandler == null)
  1029. throw new ArgumentNullException("Delegate (callback function) cannot be null");
  1030. m_dwCookie = 0;
  1031. m_RemovedDelegate = eventHandler;
  1032. }
  1033. public void NotifyDeviceAdded(object sender, string uniqueId)
  1034. {
  1035. m_AddedDelegate(sender, uniqueId);
  1036. }
  1037. public void NotifyDeviceRemoved(object sender, string uniqueId)
  1038. {
  1039. m_RemovedDelegate(sender, uniqueId);
  1040. }
  1041. public int Cookie
  1042. {
  1043. get
  1044. {
  1045. return m_dwCookie;
  1046. }
  1047. set
  1048. {
  1049. m_dwCookie = value;
  1050. }
  1051. }
  1052. public DiscMaster2_NotifyDeviceAddedEventHandler NotifyDeviceAddedDelegate
  1053. {
  1054. get
  1055. {
  1056. return m_AddedDelegate;
  1057. }
  1058. set
  1059. {
  1060. m_AddedDelegate = value;
  1061. }
  1062. }
  1063. public DiscMaster2_NotifyDeviceRemovedEventHandler NotifyDeviceRemovedDelegate
  1064. {
  1065. get
  1066. {
  1067. return m_RemovedDelegate;
  1068. }
  1069. set
  1070. {
  1071. m_RemovedDelegate = value;
  1072. }
  1073. }
  1074. }
  1075. #endregion DDiscMaster2Events
  1076. #region DFileSystemImageEvents
  1077. /// <summary>
  1078. /// Provides notification of file system import progress
  1079. /// </summary>
  1080. [ComImport]
  1081. [Guid("2C941FDF-975B-59BE-A960-9A2A262853A5")]
  1082. [TypeLibType(TypeLibTypeFlags.FNonExtensible | TypeLibTypeFlags.FOleAutomation | TypeLibTypeFlags.FDispatchable)]
  1083. public interface DFileSystemImageEvents
  1084. {
  1085. // Update to current progress
  1086. [DispId(0x100)] // DISPID_DFILESYSTEMIMAGEEVENTS_UPDATE
  1087. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  1088. void Update([In, MarshalAs(UnmanagedType.IDispatch)] object sender, string currentFile, [In] int copiedSectors, [In] int totalSectors);
  1089. }
  1090. [ComVisible(false)]
  1091. [ComEventInterface(typeof(DFileSystemImageEvents), typeof(DFileSystemImage_EventProvider))]
  1092. [TypeLibType(TypeLibTypeFlags.FHidden)]
  1093. public interface DFileSystemImage_Event
  1094. {
  1095. // Events
  1096. event DFileSystemImage_EventHandler Update;
  1097. }
  1098. [ClassInterface(ClassInterfaceType.None)]
  1099. internal sealed class DFileSystemImage_EventProvider : DFileSystemImage_Event, IDisposable
  1100. {
  1101. // Fields
  1102. private Hashtable m_aEventSinkHelpers = new Hashtable();
  1103. private IConnectionPoint m_connectionPoint = null;
  1104. // Methods
  1105. public DFileSystemImage_EventProvider(object pointContainer)
  1106. {
  1107. lock (this)
  1108. {
  1109. Guid eventsGuid = typeof(DFileSystemImageEvents).GUID;
  1110. IConnectionPointContainer connectionPointContainer = pointContainer as IConnectionPointContainer;
  1111. connectionPointContainer.FindConnectionPoint(ref eventsGuid, out m_connectionPoint);
  1112. }
  1113. }
  1114. public event DFileSystemImage_EventHandler Update
  1115. {
  1116. add
  1117. {
  1118. lock (this)
  1119. {
  1120. DFileSystemImage_SinkHelper helper = new DFileSystemImage_SinkHelper(value);
  1121. int cookie;
  1122. m_connectionPoint.Advise(helper, out cookie);
  1123. helper.Cookie = cookie;
  1124. m_aEventSinkHelpers.Add(helper.UpdateDelegate, helper);
  1125. }
  1126. }
  1127. remove
  1128. {
  1129. lock (this)
  1130. {
  1131. DFileSystemImage_SinkHelper helper =
  1132. m_aEventSinkHelpers[value] as DFileSystemImage_SinkHelper;
  1133. if (helper != null)
  1134. {
  1135. m_connectionPoint.Unadvise(helper.Cookie);
  1136. m_aEventSinkHelpers.Remove(helper.UpdateDelegate);
  1137. }
  1138. }
  1139. }
  1140. }
  1141. ~DFileSystemImage_EventProvider()
  1142. {
  1143. Cleanup();
  1144. }
  1145. public void Dispose()
  1146. {
  1147. Cleanup();
  1148. GC.SuppressFinalize(this);
  1149. }
  1150. private void Cleanup()
  1151. {
  1152. Monitor.Enter(this);
  1153. try
  1154. {
  1155. foreach (DFileSystemImage_SinkHelper helper in m_aEventSinkHelpers.Values)
  1156. {
  1157. m_connectionPoint.Unadvise(helper.Cookie);
  1158. }
  1159. m_aEventSinkHelpers.Clear();
  1160. Marshal.ReleaseComObject(m_connectionPoint);
  1161. }
  1162. catch (SynchronizationLockException)
  1163. {
  1164. return;
  1165. }
  1166. finally
  1167. {
  1168. Monitor.Exit(this);
  1169. }
  1170. }
  1171. }
  1172. [ClassInterface(ClassInterfaceType.None), TypeLibType(TypeLibTypeFlags.FHidden)]
  1173. public sealed class DFileSystemImage_SinkHelper : DFileSystemImageEvents
  1174. {
  1175. // Fields
  1176. private int m_dwCookie;
  1177. private DFileSystemImage_EventHandler m_UpdateDelegate;
  1178. public DFileSystemImage_SinkHelper(DFileSystemImage_EventHandler eventHandler)
  1179. {
  1180. if (eventHandler == null)
  1181. throw new ArgumentNullException("Delegate (callback function) cannot be null");
  1182. m_dwCookie = 0;
  1183. m_UpdateDelegate = eventHandler;
  1184. }
  1185. public void Update(object sender, string currentFile, int copiedSectors, int totalSectors)
  1186. {
  1187. m_UpdateDelegate(sender, currentFile, copiedSectors, totalSectors);
  1188. }
  1189. public int Cookie
  1190. {
  1191. get
  1192. {
  1193. return m_dwCookie;
  1194. }
  1195. set
  1196. {
  1197. m_dwCookie = value;
  1198. }
  1199. }
  1200. public DFileSystemImage_EventHandler UpdateDelegate
  1201. {
  1202. get
  1203. {
  1204. return m_UpdateDelegate;
  1205. }
  1206. set
  1207. {
  1208. m_UpdateDelegate = value;
  1209. }
  1210. }
  1211. }
  1212. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1213. public delegate void DFileSystemImage_EventHandler([In, MarshalAs(UnmanagedType.IDispatch)]object sender, string currentFile, int copiedSectors, int totalSectors);
  1214. #endregion // DFileSystemImageEvents
  1215. #region DFileSystemImageImportEvents
  1216. //
  1217. // DFileSystemImageImportEvents
  1218. //
  1219. [ComImport]
  1220. [Guid("D25C30F9-4087-4366-9E24-E55BE286424B")]
  1221. [TypeLibType(TypeLibTypeFlags.FNonExtensible | TypeLibTypeFlags.FOleAutomation | TypeLibTypeFlags.FDispatchable)]
  1222. public interface DFileSystemImageImportEvents
  1223. {
  1224. [DispId(0x101)] // DISPID_DFILESYSTEMIMAGEIMPORTEVENTS_UPDATEIMPORT
  1225. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  1226. void UpdateImport([In, MarshalAs(UnmanagedType.IDispatch)] object sender, FsiFileSystems fileSystem,
  1227. string currentItem, int importedDirectoryItems, int totalDirectoryItems, int importedFileItems, int totalFileItems);
  1228. }
  1229. [ComVisible(false)]
  1230. [ComEventInterface(typeof(DFileSystemImageImportEvents), typeof(DFileSystemImageImport_EventProvider))]
  1231. [TypeLibType(TypeLibTypeFlags.FHidden)]
  1232. public interface DFileSystemImageImport_Event
  1233. {
  1234. // Events
  1235. event DFileSystemImageImport_EventHandler UpdateImport;
  1236. }
  1237. [ClassInterface(ClassInterfaceType.None)]
  1238. internal sealed class DFileSystemImageImport_EventProvider : DFileSystemImageImport_Event, IDisposable
  1239. {
  1240. // Fields
  1241. private Hashtable m_aEventSinkHelpers = new Hashtable();
  1242. private IConnectionPoint m_connectionPoint = null;
  1243. // Methods
  1244. public DFileSystemImageImport_EventProvider(object pointContainer)
  1245. {
  1246. lock (this)
  1247. {
  1248. Guid eventsGuid = typeof(DFileSystemImageImportEvents).GUID;
  1249. IConnectionPointContainer connectionPointContainer = pointContainer as IConnectionPointContainer;
  1250. connectionPointContainer.FindConnectionPoint(ref eventsGuid, out m_connectionPoint);
  1251. }
  1252. }
  1253. public event DFileSystemImageImport_EventHandler UpdateImport
  1254. {
  1255. add
  1256. {
  1257. lock (this)
  1258. {
  1259. DFileSystemImageImport_SinkHelper helper = new DFileSystemImageImport_SinkHelper(value);
  1260. int cookie;
  1261. m_connectionPoint.Advise(helper, out cookie);
  1262. helper.Cookie = cookie;
  1263. m_aEventSinkHelpers.Add(helper.UpdateDelegate, helper);
  1264. }
  1265. }
  1266. remove
  1267. {
  1268. lock (this)
  1269. {
  1270. DFileSystemImageImport_SinkHelper helper =
  1271. m_aEventSinkHelpers[value] as DFileSystemImageImport_SinkHelper;
  1272. if (helper != null)
  1273. {
  1274. m_connectionPoint.Unadvise(helper.Cookie);
  1275. m_aEventSinkHelpers.Remove(helper.UpdateDelegate);
  1276. }
  1277. }
  1278. }
  1279. }
  1280. ~DFileSystemImageImport_EventProvider()
  1281. {
  1282. Cleanup();
  1283. }
  1284. public void Dispose()
  1285. {
  1286. Cleanup();
  1287. GC.SuppressFinalize(this);
  1288. }
  1289. private void Cleanup()
  1290. {
  1291. Monitor.Enter(this);
  1292. try
  1293. {
  1294. foreach (DFileSystemImageImport_SinkHelper helper in m_aEventSinkHelpers.Values)
  1295. {
  1296. m_connectionPoint.Unadvise(helper.Cookie);
  1297. }
  1298. m_aEventSinkHelpers.Clear();
  1299. Marshal.ReleaseComObject(m_connectionPoint);
  1300. }
  1301. catch (SynchronizationLockException)
  1302. {
  1303. return;
  1304. }
  1305. finally
  1306. {
  1307. Monitor.Exit(this);
  1308. }
  1309. }
  1310. }
  1311. [TypeLibType(TypeLibTypeFlags.FHidden)]
  1312. [ClassInterface(ClassInterfaceType.None)]
  1313. public sealed class DFileSystemImageImport_SinkHelper : DFileSystemImageImportEvents
  1314. {
  1315. // Fields
  1316. private int m_dwCookie;
  1317. private DFileSystemImageImport_EventHandler m_UpdateDelegate;
  1318. public DFileSystemImageImport_SinkHelper(DFileSystemImageImport_EventHandler eventHandler)
  1319. {
  1320. if (eventHandler == null)
  1321. throw new ArgumentNullException("Delegate (callback function) cannot be null");
  1322. m_dwCookie = 0;
  1323. m_UpdateDelegate = eventHandler;
  1324. }
  1325. public void UpdateImport(object sender, FsiFileSystems fileSystems, string currentItem,
  1326. int importedDirectoryItems, int totalDirectoryItems, int importedFileItems, int totalFileItems)
  1327. {
  1328. m_UpdateDelegate(sender, fileSystems, currentItem, importedDirectoryItems, totalDirectoryItems,
  1329. importedFileItems, totalFileItems);
  1330. }
  1331. public int Cookie
  1332. {
  1333. get
  1334. {
  1335. return m_dwCookie;
  1336. }
  1337. set
  1338. {
  1339. m_dwCookie = value;
  1340. }
  1341. }
  1342. public DFileSystemImageImport_EventHandler UpdateDelegate
  1343. {
  1344. get
  1345. {
  1346. return m_UpdateDelegate;
  1347. }
  1348. set
  1349. {
  1350. m_UpdateDelegate = value;
  1351. }
  1352. }
  1353. }
  1354. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1355. public delegate void DFileSystemImageImport_EventHandler([In, MarshalAs(UnmanagedType.IDispatch)] object sender,
  1356. FsiFileSystems fileSystem, string currentItem, int importedDirectoryItems, int totalDirectoryItems, int importedFileItems, int totalFileItems);
  1357. #endregion // DFileSystemImageImportEvents
  1358. #region DWriteEngine2Events
  1359. /// <summary>
  1360. /// Provides notification of the progress of the WriteEngine2 writing.
  1361. /// </summary>
  1362. [ComImport]
  1363. [TypeLibType(TypeLibTypeFlags.FNonExtensible|TypeLibTypeFlags.FOleAutomation|TypeLibTypeFlags.FDispatchable)]
  1364. [Guid("27354137-7F64-5B0F-8F00-5D77AFBE261E")]
  1365. public interface DWriteEngine2Events
  1366. {
  1367. // Update to current progress
  1368. [DispId(0x100)] // DISPID_DWRITEENGINE2EVENTS_UPDATE
  1369. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  1370. void Update([In, MarshalAs(UnmanagedType.IDispatch)] object sender, [In, MarshalAs(UnmanagedType.IDispatch)] object progress);
  1371. }
  1372. [ComVisible(false)]
  1373. [ComEventInterface(typeof(DWriteEngine2Events), typeof(DWriteEngine2_EventProvider))]
  1374. [TypeLibType(TypeLibTypeFlags.FHidden)]
  1375. public interface DWriteEngine2_Event
  1376. {
  1377. // Events
  1378. event DWriteEngine2_EventHandler Update;
  1379. }
  1380. [ClassInterface(ClassInterfaceType.None)]
  1381. internal sealed class DWriteEngine2_EventProvider : DWriteEngine2_Event, IDisposable
  1382. {
  1383. // Fields
  1384. private Hashtable m_aEventSinkHelpers = new Hashtable();
  1385. private IConnectionPoint m_connectionPoint = null;
  1386. // Methods
  1387. public DWriteEngine2_EventProvider(object pointContainer)
  1388. {
  1389. lock (this)
  1390. {
  1391. Guid eventsGuid = typeof(DWriteEngine2Events).GUID;
  1392. IConnectionPointContainer connectionPointContainer = pointContainer as IConnectionPointContainer;
  1393. connectionPointContainer.FindConnectionPoint(ref eventsGuid, out m_connectionPoint);
  1394. }
  1395. }
  1396. public event DWriteEngine2_EventHandler Update
  1397. {
  1398. add
  1399. {
  1400. lock (this)
  1401. {
  1402. DWriteEngine2_SinkHelper helper =
  1403. new DWriteEngine2_SinkHelper(value);
  1404. int cookie;
  1405. m_connectionPoint.Advise(helper, out cookie);
  1406. helper.Cookie = cookie;
  1407. m_aEventSinkHelpers.Add(helper.UpdateDelegate, helper);
  1408. }
  1409. }
  1410. remove
  1411. {
  1412. lock (this)
  1413. {
  1414. DWriteEngine2_SinkHelper helper =
  1415. m_aEventSinkHelpers[value] as DWriteEngine2_SinkHelper;
  1416. if (helper != null)
  1417. {
  1418. m_connectionPoint.Unadvise(helper.Cookie);
  1419. m_aEventSinkHelpers.Remove(helper.UpdateDelegate);
  1420. }
  1421. }
  1422. }
  1423. }
  1424. ~DWriteEngine2_EventProvider()
  1425. {
  1426. Cleanup();
  1427. }
  1428. public void Dispose()
  1429. {
  1430. Cleanup();
  1431. GC.SuppressFinalize(this);
  1432. }
  1433. private void Cleanup()
  1434. {
  1435. Monitor.Enter(this);
  1436. try
  1437. {
  1438. foreach (DWriteEngine2_SinkHelper helper in m_aEventSinkHelpers.Values)
  1439. {
  1440. m_connectionPoint.Unadvise(helper.Cookie);
  1441. }
  1442. m_aEventSinkHelpers.Clear();
  1443. Marshal.ReleaseComObject(m_connectionPoint);
  1444. }
  1445. catch (SynchronizationLockException)
  1446. {
  1447. return;
  1448. }
  1449. finally
  1450. {
  1451. Monitor.Exit(this);
  1452. }
  1453. }
  1454. }
  1455. [TypeLibType(TypeLibTypeFlags.FHidden)]
  1456. [ClassInterface(ClassInterfaceType.None)]
  1457. public sealed class DWriteEngine2_SinkHelper : DWriteEngine2Events
  1458. {
  1459. // Fields
  1460. private int m_dwCookie;
  1461. private DWriteEngine2_EventHandler m_UpdateDelegate;
  1462. public DWriteEngine2_SinkHelper(DWriteEngine2_EventHandler eventHandler)
  1463. {
  1464. if (eventHandler == null)
  1465. throw new ArgumentNullException("Delegate (callback function) cannot be null");
  1466. m_dwCookie = 0;
  1467. m_UpdateDelegate = eventHandler;
  1468. }
  1469. public void Update(object sender, object progress)
  1470. {
  1471. m_UpdateDelegate(sender, progress);
  1472. }
  1473. public int Cookie
  1474. {
  1475. get
  1476. {
  1477. return m_dwCookie;
  1478. }
  1479. set
  1480. {
  1481. m_dwCookie = value;
  1482. }
  1483. }
  1484. public DWriteEngine2_EventHandler UpdateDelegate
  1485. {
  1486. get
  1487. {
  1488. return m_UpdateDelegate;
  1489. }
  1490. set
  1491. {
  1492. m_UpdateDelegate = value;
  1493. }
  1494. }
  1495. }
  1496. [UnmanagedFunctionPointer(CallingConvention.StdCall)]
  1497. public delegate void DWriteEngine2_EventHandler([In, MarshalAs(UnmanagedType.IDispatch)] object sender, [In, MarshalAs(UnmanagedType.IDispatch)] object progress);
  1498. #endregion // DWriteEngine2Events
  1499. #region Interfaces
  1500. /// <summary>
  1501. /// Boot Options
  1502. /// </summary>
  1503. [Guid("2C941FD4-975B-59BE-A960-9A2A262853A5")]
  1504. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1505. public interface IBootOptions
  1506. {
  1507. // Get boot image data stream
  1508. [DispId(1)]
  1509. IStream BootImage { get; }
  1510. // Get boot manufacturer
  1511. [DispId(2)]
  1512. string Manufacturer { get; set; }
  1513. // Get boot platform identifier
  1514. [DispId(3)]
  1515. PlatformId PlatformId { get; set; }
  1516. // Get boot emulation type
  1517. [DispId(4)]
  1518. EmulationType Emulation { get; set; }
  1519. // Get boot image size
  1520. [DispId(5)]
  1521. uint ImageSize { get; }
  1522. // Set the boot image data stream, emulation type, and image size
  1523. [DispId(20)]
  1524. void AssignBootImage(IStream newVal);
  1525. }
  1526. /// <summary>
  1527. /// An interface to control burn verification for a burning object
  1528. /// </summary>
  1529. [ComImport]
  1530. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  1531. [Guid("D2FFD834-958B-426D-8470-2A13879C6A91")]
  1532. public interface IBurnVerification
  1533. {
  1534. // The requested level of burn verification
  1535. [DispId(0x400)]
  1536. IMAPI_BURN_VERIFICATION_LEVEL BurnVerificationLevel { set; get; }
  1537. }
  1538. /// <summary>
  1539. /// Common Disc Format (writer) Operations
  1540. /// </summary>
  1541. [ComImport]
  1542. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1543. [Guid("27354152-8F64-5B0F-8F00-5D77AFBE261E")]
  1544. public interface IDiscFormat2
  1545. {
  1546. // Determines if the recorder object supports the given format
  1547. [DispId(0x800)]
  1548. bool IsRecorderSupported(IDiscRecorder2 Recorder);
  1549. // Determines if the current media in a supported recorder object supports the given format
  1550. [DispId(0x801)]
  1551. bool IsCurrentMediaSupported(IDiscRecorder2 Recorder);
  1552. // Determines if the current media is reported as physically blank by the drive
  1553. [DispId(0x700)]
  1554. bool MediaPhysicallyBlank { get; }
  1555. // Attempts to determine if the media is blank using heuristics (mainly for DVD+RW and DVD-RAM media)
  1556. [DispId(0x701)]
  1557. bool MediaHeuristicallyBlank { get; }
  1558. // Supported media types
  1559. [DispId(0x702)]
  1560. object[] SupportedMediaTypes { get; }
  1561. }
  1562. /// <summary>
  1563. /// Data Writer
  1564. /// </summary>
  1565. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1566. [Guid("27354153-9F64-5B0F-8F00-5D77AFBE261E")]
  1567. public interface IDiscFormat2Data
  1568. {
  1569. //
  1570. // IDiscFormat2
  1571. //
  1572. // Determines if the recorder object supports the given format
  1573. [DispId(0x800)]
  1574. bool IsRecorderSupported(IDiscRecorder2 Recorder);
  1575. // Determines if the current media in a supported recorder object supports the given format
  1576. [DispId(0x801)]
  1577. bool IsCurrentMediaSupported(IDiscRecorder2 Recorder);
  1578. // Determines if the current media is reported as physically blank by the drive
  1579. [DispId(0x700)]
  1580. bool MediaPhysicallyBlank { get; }
  1581. // Attempts to determine if the media is blank using heuristics (mainly for DVD+RW and DVD-RAM media)
  1582. [DispId(0x701)]
  1583. bool MediaHeuristicallyBlank { get; }
  1584. // Supported media types
  1585. [DispId(0x702)]
  1586. object[] SupportedMediaTypes { get; }
  1587. //
  1588. // IDiscFormat2Data
  1589. //
  1590. // The disc recorder to use
  1591. [DispId(0x100)]
  1592. IDiscRecorder2 Recorder { set; get; }
  1593. // Buffer Underrun Free recording should be disabled
  1594. [DispId(0x101)]
  1595. bool BufferUnderrunFreeDisabled { set; get; }
  1596. // Postgap is included in image
  1597. [DispId(260)]
  1598. bool PostgapAlreadyInImage { set; get; }
  1599. // The state (usability) of the current media
  1600. [DispId(0x106)]
  1601. IMAPI_FORMAT2_DATA_MEDIA_STATE CurrentMediaStatus { get; }
  1602. // The write protection state of the current media
  1603. [DispId(0x107)]
  1604. IMAPI_MEDIA_WRITE_PROTECT_STATE WriteProtectStatus { get; }
  1605. // Total sectors available on the media (used + free).
  1606. [DispId(0x108)]
  1607. int TotalSectorsOnMedia { get; }
  1608. // Free sectors available on the media.
  1609. [DispId(0x109)]
  1610. int FreeSectorsOnMedia { get; }
  1611. // Next writable address on the media (also used sectors)
  1612. [DispId(0x10a)]
  1613. int NextWritableAddress { get; }
  1614. // The first sector in the previous session on the media
  1615. [DispId(0x10b)]
  1616. int StartAddressOfPreviousSession { get; }
  1617. // The last sector in the previous session on the media
  1618. [DispId(0x10c)]
  1619. int LastWrittenAddressOfPreviousSession { get; }
  1620. // Prevent further additions to the file system
  1621. [DispId(0x10d)]
  1622. bool ForceMediaToBeClosed { set; get; }
  1623. // Default is to maximize compatibility with DVD-ROM. May be disabled to
  1624. // reduce time to finish writing the disc or increase usable space on the
  1625. // media for later writing.
  1626. [DispId(270)]
  1627. bool DisableConsumerDvdCompatibilityMode { set; get; }
  1628. // Get the current physical media type
  1629. [DispId(0x10f)]
  1630. IMAPI_MEDIA_PHYSICAL_TYPE CurrentPhysicalMediaType { get; }
  1631. // The friendly name of the client (used to determine recorder reservation conflicts)
  1632. [DispId(0x110)]
  1633. string ClientName { set; get; }
  1634. // The last requested write speed
  1635. [DispId(0x111)]
  1636. int RequestedWriteSpeed { get; }
  1637. // The last requested rotation type
  1638. [DispId(0x112)]
  1639. bool RequestedRotationTypeIsPureCAV { get; }
  1640. // The drive's current write speed
  1641. [DispId(0x113)]
  1642. int CurrentWriteSpeed { get; }
  1643. // The drive's current rotation type.
  1644. [DispId(0x114)]
  1645. bool CurrentRotationTypeIsPureCAV { get; }
  1646. // Gets an array of the write speeds supported for the attached disc recorder and current media
  1647. [DispId(0x115)]
  1648. object[] SupportedWriteSpeeds { get; }
  1649. // Gets an array of the detailed write configurations supported for the attached disc recorder
  1650. // and current media
  1651. [DispId(0x116)]
  1652. object[] SupportedWriteSpeedDescriptors { get; }
  1653. // Forces the Datawriter to overwrite the disc on overwritable media types
  1654. [DispId(0x117)]
  1655. bool ForceOverwrite { set; get; }
  1656. // Returns the array of available multi-session interfaces. The array shall not be empty
  1657. [DispId(280)]
  1658. object[] MultisessionInterfaces { get; }
  1659. // Writes all the data provided in the IStream to the device
  1660. [DispId(0x200)]
  1661. void Write(IStream data);
  1662. // Cancels the current write operation
  1663. [DispId(0x201)]
  1664. void CancelWrite();
  1665. // Sets the write speed (in sectors per second) of the attached disc recorder
  1666. [DispId(0x202)]
  1667. void SetWriteSpeed(int RequestedSectorsPerSecond, bool RotationTypeIsPureCAV);
  1668. }
  1669. /// <summary>
  1670. /// Track-at-once Data Writer
  1671. /// </summary>
  1672. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1673. [Guid("2735413D-7F64-5B0F-8F00-5D77AFBE261E")]
  1674. public interface IDiscFormat2DataEventArgs
  1675. {
  1676. //
  1677. // IWriteEngine2EventArgs
  1678. //
  1679. // The starting logical block address for the current write operation.
  1680. [DispId(0x100)]
  1681. int StartLba { get; }
  1682. // The number of sectors being written for the current write operation.
  1683. [DispId(0x101)]
  1684. int SectorCount { get; }
  1685. // The last logical block address of data read for the current write operation.
  1686. [DispId(0x102)]
  1687. int LastReadLba { get; }
  1688. // The last logical block address of data written for the current write operation
  1689. [DispId(0x103)]
  1690. int LastWrittenLba { get; }
  1691. // The total bytes available in the system's cache buffer
  1692. [DispId(0x106)]
  1693. int TotalSystemBuffer { get; }
  1694. // The used bytes in the system's cache buffer
  1695. [DispId(0x107)]
  1696. int UsedSystemBuffer { get; }
  1697. // The free bytes in the system's cache buffer
  1698. [DispId(0x108)]
  1699. int FreeSystemBuffer { get; }
  1700. //
  1701. // IDiscFormat2DataEventArgs
  1702. //
  1703. // The total elapsed time for the current write operation
  1704. [DispId(0x300)]
  1705. int ElapsedTime { get; }
  1706. // The estimated time remaining for the write operation.
  1707. [DispId(0x301)]
  1708. int RemainingTime { get; }
  1709. // The estimated total time for the write operation.
  1710. [DispId(770)]
  1711. int TotalTime { get; }
  1712. // The current write action.
  1713. [DispId(0x303)]
  1714. IMAPI_FORMAT2_DATA_WRITE_ACTION CurrentAction { get; }
  1715. }
  1716. [ComImport, Guid("27354156-8F64-5B0F-8F00-5D77AFBE261E")]
  1717. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1718. public interface IDiscFormat2Erase
  1719. {
  1720. //
  1721. // IDiscFormat2
  1722. //
  1723. // Determines if the recorder object supports the given format
  1724. [DispId(0x800)]
  1725. bool IsRecorderSupported(IDiscRecorder2 Recorder);
  1726. // Determines if the current media in a supported recorder object supports the given format
  1727. [DispId(0x801)]
  1728. bool IsCurrentMediaSupported(IDiscRecorder2 Recorder);
  1729. // Determines if the current media is reported as physically blank by the drive
  1730. [DispId(0x700)]
  1731. bool MediaPhysicallyBlank { get; }
  1732. // Attempts to determine if the media is blank using heuristics (mainly for DVD+RW and DVD-RAM media)
  1733. [DispId(0x701)]
  1734. bool MediaHeuristicallyBlank { get; }
  1735. // Supported media types
  1736. [DispId(0x702)]
  1737. object[] SupportedMediaTypes { get; }
  1738. //
  1739. // IDiscFormat2Erase
  1740. //
  1741. // Sets the recorder object to use for an erase operation
  1742. [DispId(0x100)]
  1743. IDiscRecorder2 Recorder { set; get; }
  1744. //
  1745. [DispId(0x101)]
  1746. bool FullErase { set; get; }
  1747. // Get the current physical media type
  1748. [DispId(0x102)]
  1749. IMAPI_MEDIA_PHYSICAL_TYPE CurrentPhysicalMediaType { get; }
  1750. // The friendly name of the client (used to determine recorder reservation conflicts)
  1751. [DispId(0x103)]
  1752. string ClientName { set; get; }
  1753. // Erases the media in the active disc recorder
  1754. [DispId(0x201)]
  1755. void EraseMedia();
  1756. }
  1757. /// <summary>
  1758. /// CD Disc-At-Once RAW Writer
  1759. /// </summary>
  1760. [ComImport, Guid("27354155-8F64-5B0F-8F00-5D77AFBE261E")]
  1761. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1762. public interface IDiscFormat2RawCD
  1763. {
  1764. //
  1765. // IDiscFormat2
  1766. //
  1767. // Determines if the recorder object supports the given format
  1768. [DispId(0x800)]
  1769. bool IsRecorderSupported(IDiscRecorder2 Recorder);
  1770. // Determines if the current media in a supported recorder object supports the given format
  1771. [DispId(0x801)]
  1772. bool IsCurrentMediaSupported(IDiscRecorder2 Recorder);
  1773. // Determines if the current media is reported as physically blank by the drive
  1774. [DispId(0x700)]
  1775. bool MediaPhysicallyBlank { get; }
  1776. // Attempts to determine if the media is blank using heuristics (mainly for DVD+RW and DVD-RAM media)
  1777. [DispId(0x701)]
  1778. bool MediaHeuristicallyBlank { get; }
  1779. // Supported media types
  1780. [DispId(0x702)]
  1781. object[] SupportedMediaTypes { get; }
  1782. //
  1783. // IDiscFormat2RawCD
  1784. //
  1785. // Locks the current media for use by this writer
  1786. [DispId(0x200)]
  1787. void PrepareMedia();
  1788. // Writes a RAW image that starts at 95:00:00 (MSF) to the currently inserted blank CD media
  1789. [DispId(0x201)]
  1790. void WriteMedia(IStream data);
  1791. // Writes a RAW image to the currently inserted blank CD media. A stream starting at 95:00:00
  1792. // (-5 minutes) would use 5*60*75 + 150 sectors pregap == 22,650 for the number of sectors
  1793. [DispId(0x202)]
  1794. void WriteMedia2(IStream data, int streamLeadInSectors);
  1795. // Cancels the current write.
  1796. [DispId(0x203)]
  1797. void CancelWrite();
  1798. // Finishes use of the locked media.
  1799. [DispId(0x204)]
  1800. void ReleaseMedia();
  1801. // Sets the write speed (in sectors per second) of the attached disc recorder
  1802. [DispId(0x205)]
  1803. void SetWriteSpeed(int RequestedSectorsPerSecond, bool RotationTypeIsPureCAV);
  1804. // The disc recorder to use
  1805. [DispId(0x100)]
  1806. IDiscRecorder2 Recorder { set; get; }
  1807. // Buffer Underrun Free recording should be disabled
  1808. [DispId(0x102)]
  1809. bool BufferUnderrunFreeDisabled { set; get; }
  1810. // The first sector of the next session. May be negative for blank media
  1811. [DispId(0x103)]
  1812. int StartOfNextSession { get; }
  1813. // The last possible start for the leadout area. Can be used to
  1814. // calculate available space on media
  1815. [DispId(260)]
  1816. int LastPossibleStartOfLeadout { get; }
  1817. // Get the current physical media type
  1818. [DispId(0x105)]
  1819. IMAPI_MEDIA_PHYSICAL_TYPE CurrentPhysicalMediaType { get; }
  1820. // Supported data sector types for the current recorder
  1821. [DispId(0x108)]
  1822. object[] SupportedSectorTypes { get; }
  1823. // Requested data sector to use during write of the stream
  1824. [DispId(0x109)]
  1825. IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE RequestedSectorType { set; get; }
  1826. // The friendly name of the client (used to determine recorder reservation conflicts).
  1827. [DispId(0x10a)]
  1828. string ClientName { set; get; }
  1829. // The last requested write speed
  1830. [DispId(0x10b)]
  1831. int RequestedWriteSpeed { get; }
  1832. // The last requested rotation type.
  1833. [DispId(0x10c)]
  1834. bool RequestedRotationTypeIsPureCAV { get; }
  1835. // The drive's current write speed.
  1836. [DispId(0x10d)]
  1837. int CurrentWriteSpeed { get; }
  1838. // The drive's current rotation type
  1839. [DispId(270)]
  1840. bool CurrentRotationTypeIsPureCAV { get; }
  1841. // Gets an array of the write speeds supported for the attached disc
  1842. // recorder and current media
  1843. [DispId(0x10f)]
  1844. object[] SupportedWriteSpeeds { get; }
  1845. // Gets an array of the detailed write configurations supported for the
  1846. // attached disc recorder and current media
  1847. [DispId(0x110)]
  1848. object[] SupportedWriteSpeedDescriptors { get; }
  1849. }
  1850. /// <summary>
  1851. /// CD Disc-At-Once RAW Writer Event Arguments
  1852. /// </summary>
  1853. [ComImport, Guid("27354143-7F64-5B0F-8F00-5D77AFBE261E"), TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1854. public interface IDiscFormat2RawCDEventArgs
  1855. {
  1856. //
  1857. // IWriteEngine2EventArgs
  1858. //
  1859. // The starting logical block address for the current write operation.
  1860. [DispId(0x100)]
  1861. int StartLba { get; }
  1862. // The number of sectors being written for the current write operation.
  1863. [DispId(0x101)]
  1864. int SectorCount { get; }
  1865. // The last logical block address of data read for the current write operation.
  1866. [DispId(0x102)]
  1867. int LastReadLba { get; }
  1868. // The last logical block address of data written for the current write operation
  1869. [DispId(0x103)]
  1870. int LastWrittenLba { get; }
  1871. // The total bytes available in the system's cache buffer
  1872. [DispId(0x106)]
  1873. int TotalSystemBuffer { get; }
  1874. // The used bytes in the system's cache buffer
  1875. [DispId(0x107)]
  1876. int UsedSystemBuffer { get; }
  1877. // The free bytes in the system's cache buffer
  1878. [DispId(0x108)]
  1879. int FreeSystemBuffer { get; }
  1880. //
  1881. // IDiscFormat2RawCDEventArgs
  1882. //
  1883. // The current write action
  1884. [DispId(0x301)]
  1885. IMAPI_FORMAT2_RAW_CD_WRITE_ACTION CurrentAction { get; }
  1886. // The elapsed time for the current track write or media finishing operation
  1887. [DispId(770)]
  1888. int ElapsedTime { get; }
  1889. // The estimated time remaining for the current track write or media finishing operation
  1890. [DispId(0x303)]
  1891. int RemainingTime { get; }
  1892. }
  1893. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1894. [ComImport]
  1895. [Guid("27354154-8F64-5B0F-8F00-5D77AFBE261E")]
  1896. public interface IDiscFormat2TrackAtOnce
  1897. {
  1898. //
  1899. // IDiscFormat2
  1900. //
  1901. // Determines if the recorder object supports the given format
  1902. [DispId(0x800)]
  1903. bool IsRecorderSupported(IDiscRecorder2 Recorder);
  1904. // Determines if the current media in a supported recorder object supports the given format
  1905. [DispId(0x801)]
  1906. bool IsCurrentMediaSupported(IDiscRecorder2 Recorder);
  1907. // Determines if the current media is reported as physically blank by the drive
  1908. [DispId(0x700)]
  1909. bool MediaPhysicallyBlank { get; }
  1910. // Attempts to determine if the media is blank using heuristics (mainly for DVD+RW and DVD-RAM media)
  1911. [DispId(0x701)]
  1912. bool MediaHeuristicallyBlank { get; }
  1913. // Supported media types
  1914. [DispId(0x702)]
  1915. object[] SupportedMediaTypes { get; }
  1916. //
  1917. // IDiscFormat2TrackAtOnce
  1918. //
  1919. // Locks the current media for use by this writer.
  1920. [DispId(0x200)]
  1921. void PrepareMedia();
  1922. // Immediately writes a new audio track to the locked media
  1923. [DispId(0x201)]
  1924. void AddAudioTrack(IStream data);
  1925. // Cancels the current addition of a track
  1926. [DispId(0x202)]
  1927. void CancelAddTrack();
  1928. // Finishes use of the locked media
  1929. [DispId(0x203)]
  1930. void ReleaseMedia();
  1931. // Sets the write speed (in sectors per second) of the attached disc recorder
  1932. [DispId(0x204)]
  1933. void SetWriteSpeed(int RequestedSectorsPerSecond, bool RotationTypeIsPureCAV);
  1934. // The disc recorder to use
  1935. [DispId(0x100)]
  1936. IDiscRecorder2 Recorder { set; get; }
  1937. // Buffer Underrun Free recording should be disabled
  1938. [DispId(0x102)]
  1939. bool BufferUnderrunFreeDisabled { set; get; }
  1940. // Number of tracks already written to the locked media
  1941. [DispId(0x103)]
  1942. int NumberOfExistingTracks { get; }
  1943. // Total sectors available on locked media if writing one continuous audio track
  1944. [DispId(260)]
  1945. int TotalSectorsOnMedia { get; }
  1946. // Number of sectors available for adding a new track to the media
  1947. [DispId(0x105)]
  1948. int FreeSectorsOnMedia { get; }
  1949. // Number of sectors used on the locked media, including overhead (space between tracks)
  1950. [DispId(0x106)]
  1951. int UsedSectorsOnMedia { get; }
  1952. // Set the media to be left 'open' after writing, to allow multisession discs
  1953. [DispId(0x107)]
  1954. bool DoNotFinalizeMedia { set; get; }
  1955. // Get the current physical media type
  1956. [DispId(0x10a)]
  1957. object[] ExpectedTableOfContents { get; }
  1958. // Get the current physical media type
  1959. [DispId(0x10b)]
  1960. IMAPI_MEDIA_PHYSICAL_TYPE CurrentPhysicalMediaType { get; }
  1961. // The friendly name of the client (used to determine recorder reservation conflicts)
  1962. [DispId(270)]
  1963. string ClientName { set; get; }
  1964. // The last requested write speed
  1965. [DispId(0x10f)]
  1966. int RequestedWriteSpeed { get; }
  1967. // The last requested rotation type.
  1968. [DispId(0x110)]
  1969. bool RequestedRotationTypeIsPureCAV { get; }
  1970. // The drive's current write speed.
  1971. [DispId(0x111)]
  1972. int CurrentWriteSpeed { get; }
  1973. // The drive's current rotation type.
  1974. [DispId(0x112)]
  1975. bool CurrentRotationTypeIsPureCAV { get; }
  1976. // Gets an array of the write speeds supported for the attached disc recorder and current media
  1977. [DispId(0x113)]
  1978. object[] SupportedWriteSpeeds { get; }
  1979. // Gets an array of the detailed write configurations supported for the attached disc recorder and current media
  1980. [DispId(0x114)]
  1981. object[] SupportedWriteSpeedDescriptors { get; }
  1982. }
  1983. /// <summary>
  1984. /// CD Track-at-once Audio Writer Event Arguments
  1985. /// </summary>
  1986. [ComImport]
  1987. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1988. [Guid("27354140-7F64-5B0F-8F00-5D77AFBE261E")]
  1989. public interface IDiscFormat2TrackAtOnceEventArgs
  1990. {
  1991. //
  1992. // IWriteEngine2EventArgs
  1993. //
  1994. // The starting logical block address for the current write operation.
  1995. [DispId(0x100)]
  1996. int StartLba { get; }
  1997. // The number of sectors being written for the current write operation.
  1998. [DispId(0x101)]
  1999. int SectorCount { get; }
  2000. // The last logical block address of data read for the current write operation.
  2001. [DispId(0x102)]
  2002. int LastReadLba { get; }
  2003. // The last logical block address of data written for the current write operation
  2004. [DispId(0x103)]
  2005. int LastWrittenLba { get; }
  2006. // The total bytes available in the system's cache buffer
  2007. [DispId(0x106)]
  2008. int TotalSystemBuffer { get; }
  2009. // The used bytes in the system's cache buffer
  2010. [DispId(0x107)]
  2011. int UsedSystemBuffer { get; }
  2012. // The free bytes in the system's cache buffer
  2013. [DispId(0x108)]
  2014. int FreeSystemBuffer { get; }
  2015. //
  2016. // IDiscFormat2TrackAtOnceEventArgs
  2017. //
  2018. // The total elapsed time for the current write operation
  2019. [DispId(0x300)]
  2020. int CurrentTrackNumber { get; }
  2021. // The current write action
  2022. [DispId(0x301)]
  2023. IMAPI_FORMAT2_TAO_WRITE_ACTION CurrentAction { get; }
  2024. // The elapsed time for the current track write or media finishing operation
  2025. [DispId(770)]
  2026. int ElapsedTime { get; }
  2027. // The estimated time remaining for the current track write or media finishing operation
  2028. [DispId(0x303)]
  2029. int RemainingTime { get; }
  2030. }
  2031. /// <summary>
  2032. /// IDiscMaster2 is used to get an enumerator for the set of CD/DVD (optical) devices on the system
  2033. /// </summary>
  2034. [ComImport]
  2035. [Guid("27354130-7F64-5B0F-8F00-5D77AFBE261E")]
  2036. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2037. public interface IDiscMaster2
  2038. {
  2039. // Enumerates the list of CD/DVD devices on the system (VT_BSTR)
  2040. [DispId(-4), TypeLibFunc((short)0x41)]
  2041. IEnumerator GetEnumerator();
  2042. // Gets a single recorder's ID (ZERO BASED INDEX)
  2043. [DispId(0)]
  2044. string this[int index] { get; }
  2045. // The current number of recorders in the system.
  2046. [DispId(1)]
  2047. int Count { get; }
  2048. // Whether IMAPI is running in an environment with optical devices and permission to access them.
  2049. [DispId(2)]
  2050. bool IsSupportedEnvironment { get; }
  2051. }
  2052. /// <summary>
  2053. /// Represents a single CD/DVD type device, and enables many common operations via a simplified API.
  2054. /// </summary>
  2055. [ComImport]
  2056. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2057. [Guid("27354133-7F64-5B0F-8F00-5D77AFBE261E")]
  2058. public interface IDiscRecorder2
  2059. {
  2060. // Ejects the media (if any) and opens the tray
  2061. [DispId(0x100)]
  2062. void EjectMedia();
  2063. // Close the media tray and load any media in the tray.
  2064. [DispId(0x101)]
  2065. void CloseTray();
  2066. // Acquires exclusive access to device. May be called multiple times.
  2067. [DispId(0x102)]
  2068. void AcquireExclusiveAccess(bool force, string clientName);
  2069. // Releases exclusive access to device. Call once per AcquireExclusiveAccess().
  2070. [DispId(0x103)]
  2071. void ReleaseExclusiveAccess();
  2072. // Disables Media Change Notification (MCN).
  2073. [DispId(260)]
  2074. void DisableMcn();
  2075. // Re-enables Media Change Notification after a call to DisableMcn()
  2076. [DispId(0x105)]
  2077. void EnableMcn();
  2078. // Initialize the recorder, opening a handle to the specified recorder.
  2079. [DispId(0x106)]
  2080. void InitializeDiscRecorder(string recorderUniqueId);
  2081. // The unique ID used to initialize the recorder.
  2082. [DispId(0)]
  2083. string ActiveDiscRecorder { get; }
  2084. // The vendor ID in the device's INQUIRY data.
  2085. [DispId(0x201)]
  2086. string VendorId { get; }
  2087. // The Product ID in the device's INQUIRY data.
  2088. [DispId(0x202)]
  2089. string ProductId { get; }
  2090. // The Product Revision in the device's INQUIRY data.
  2091. [DispId(0x203)]
  2092. string ProductRevision { get; }
  2093. // Get the unique volume name (this is not a drive letter).
  2094. [DispId(0x204)]
  2095. string VolumeName { get; }
  2096. // Drive letters and NTFS mount points to access the recorder.
  2097. [DispId(0x205)]
  2098. object[] VolumePathNames { [DispId(0x205)] get; }
  2099. // One of the volume names associated with the recorder.
  2100. [DispId(0x206)]
  2101. bool DeviceCanLoadMedia { [DispId(0x206)] get; }
  2102. // Gets the legacy 'device number' associated with the recorder. This number is not guaranteed to be static.
  2103. [DispId(0x207)]
  2104. int LegacyDeviceNumber { [DispId(0x207)] get; }
  2105. // Gets a list of all feature pages supported by the device
  2106. [DispId(520)]
  2107. object[] SupportedFeaturePages { [DispId(520)] get; }
  2108. // Gets a list of all feature pages with 'current' bit set to true
  2109. [DispId(0x209)]
  2110. object[] CurrentFeaturePages { [DispId(0x209)] get; }
  2111. // Gets a list of all profiles supported by the device
  2112. [DispId(0x20a)]
  2113. object[] SupportedProfiles { [DispId(0x20a)] get; }
  2114. // Gets a list of all profiles with 'currentP' bit set to true
  2115. [DispId(0x20b)]
  2116. object[] CurrentProfiles { [DispId(0x20b)] get; }
  2117. // Gets a list of all MODE PAGES supported by the device
  2118. [DispId(0x20c)]
  2119. object[] SupportedModePages { [DispId(0x20c)] get; }
  2120. // Queries the device to determine who, if anyone, has acquired exclusive access
  2121. [DispId(0x20d)]
  2122. string ExclusiveAccessOwner { [DispId(0x20d)] get; }
  2123. }
  2124. /// <summary>
  2125. /// Represents a single CD/DVD type device, enabling additional commands requiring advanced marshalling code
  2126. /// </summary>
  2127. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  2128. [Guid("27354132-7F64-5B0F-8F00-5D77AFBE261E")]
  2129. public interface IDiscRecorder2Ex
  2130. {
  2131. //
  2132. // Send a command to the device that does not transfer any data
  2133. //
  2134. void SendCommandNoData(
  2135. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)]
  2136. byte[] Cdb,
  2137. uint CdbSize,
  2138. [MarshalAs(UnmanagedType.LPArray, SizeConst = 18)]
  2139. byte[] SenseBuffer,
  2140. uint Timeout);
  2141. // Send a command to the device that requires data sent to the device
  2142. void SendCommandSendDataToDevice(
  2143. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)]
  2144. byte[] Cdb,
  2145. uint CdbSize,
  2146. [MarshalAs(UnmanagedType.LPArray, SizeConst = 18)]
  2147. byte[] SenseBuffer,
  2148. uint Timeout,
  2149. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 5)]
  2150. byte[] Buffer,
  2151. uint BufferSize);
  2152. // Send a command to the device that requests data from the device
  2153. void SendCommandGetDataFromDevice(
  2154. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)]
  2155. byte[] Cdb,
  2156. uint CdbSize,
  2157. [MarshalAs(UnmanagedType.LPArray, SizeConst = 18)]
  2158. byte[] SenseBuffer,
  2159. uint Timeout,
  2160. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 5)]
  2161. byte[] Buffer,
  2162. uint BufferSize,
  2163. out uint BufferFetched);
  2164. // Read a DVD Structure from the media
  2165. void ReadDvdStructure(uint format, uint address, uint layer, uint agid, out IntPtr data, out uint Count);
  2166. // Sends a DVD structure to the media
  2167. void SendDvdStructure(uint format,
  2168. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)]
  2169. byte[] data,
  2170. uint Count);
  2171. // Get the full adapter descriptor (via IOCTL_STORAGE_QUERY_PROPERTY).
  2172. void GetAdapterDescriptor(out IntPtr data, ref uint byteSize);
  2173. // Get the full device descriptor (via IOCTL_STORAGE_QUERY_PROPERTY).
  2174. void GetDeviceDescriptor(out IntPtr data, ref uint byteSize);
  2175. // Gets data from a READ_DISC_INFORMATION command
  2176. void GetDiscInformation(out IntPtr discInformation, ref uint byteSize);
  2177. // Gets data from a READ_TRACK_INFORMATION command
  2178. void GetTrackInformation(uint address, IMAPI_READ_TRACK_ADDRESS_TYPE addressType, out IntPtr trackInformation, ref uint byteSize);
  2179. // Gets a feature's data from a GET_CONFIGURATION command
  2180. void GetFeaturePage(IMAPI_FEATURE_PAGE_TYPE requestedFeature, sbyte currentFeatureOnly, out IntPtr featureData, ref uint byteSize);
  2181. // Gets data from a MODE_SENSE10 command
  2182. void GetModePage(IMAPI_MODE_PAGE_TYPE requestedModePage, IMAPI_MODE_PAGE_REQUEST_TYPE requestType, out IntPtr modePageData, ref uint byteSize);
  2183. // Sets mode page data using MODE_SELECT10 command
  2184. void SetModePage(IMAPI_MODE_PAGE_REQUEST_TYPE requestType,
  2185. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)]
  2186. byte[] data,
  2187. uint byteSize);
  2188. // Gets a list of all feature pages supported by the device
  2189. void GetSupportedFeaturePages(sbyte currentFeatureOnly, out IntPtr featureData, ref uint byteSize);
  2190. // Gets a list of all PROFILES supported by the device
  2191. void GetSupportedProfiles(sbyte currentOnly, out IntPtr profileTypes, out uint validProfiles);
  2192. // Gets a list of all MODE PAGES supported by the device
  2193. void GetSupportedModePages(IMAPI_MODE_PAGE_REQUEST_TYPE requestType, out IntPtr modePageTypes, out uint validPages);
  2194. // The byte alignment requirement mask for this device.
  2195. uint GetByteAlignmentMask();
  2196. // The maximum non-page-aligned transfer size for this device.
  2197. uint GetMaximumNonPageAlignedTransferSize();
  2198. // The maximum non-page-aligned transfer size for this device.
  2199. uint GetMaximumPageAlignedTransferSize();
  2200. }
  2201. /// <summary>
  2202. /// FileSystemImage item enumerator
  2203. /// </summary>
  2204. [Guid("2C941FDA-975B-59BE-A960-9A2A262853A5")]
  2205. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  2206. public interface IEnumFsiItems
  2207. {
  2208. // Note: not listed in COM Interface, but it is in Interop.cs
  2209. void Next(uint celt, out IFsiItem rgelt, out uint pceltFetched);
  2210. // Remoting support for Next (allow NULL pointer for item count when requesting single item)
  2211. void RemoteNext(uint celt, out IFsiItem rgelt, out uint pceltFetched);
  2212. // Skip items in the enumeration
  2213. void Skip(uint celt);
  2214. // Reset the enumerator
  2215. void Reset();
  2216. // Make a copy of the enumerator
  2217. void Clone(out IEnumFsiItems ppEnum);
  2218. }
  2219. /// <summary>
  2220. /// FileSystemImageResult progress item enumerator
  2221. /// </summary>
  2222. [Guid("2C941FD6-975B-59BE-A960-9A2A262853A5")]
  2223. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  2224. public interface IEnumProgressItems
  2225. {
  2226. // Not in COM, but is in Interop.cs
  2227. void Next(uint celt, out IProgressItem rgelt, out uint pceltFetched);
  2228. // Remoting support for Next (allow NULL pointer for item count when requesting single item)
  2229. void RemoteNext(uint celt, out IProgressItem rgelt, out uint pceltFetched);
  2230. // Skip items in the enumeration
  2231. void Skip(uint celt);
  2232. // Reset the enumerator
  2233. void Reset();
  2234. // Make a copy of the enumerator
  2235. void Clone(out IEnumProgressItems ppEnum);
  2236. }
  2237. /// <summary>
  2238. /// File system image
  2239. /// </summary>
  2240. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2241. [Guid("2C941FE1-975B-59BE-A960-9A2A262853A5")]
  2242. public interface IFileSystemImage
  2243. {
  2244. // Root directory item
  2245. [DispId(0)]
  2246. IFsiDirectoryItem Root { get; }
  2247. // Disc start block for the image
  2248. [DispId(1)]
  2249. int SessionStartBlock { get; set; }
  2250. // Maximum number of blocks available for the image
  2251. [DispId(2)]
  2252. int FreeMediaBlocks { get; set; }
  2253. // Set maximum number of blocks available based on the recorder
  2254. // supported discs. 0 for unknown maximum may be set.
  2255. [DispId(0x24)]
  2256. void SetMaxMediaBlocksFromDevice(IDiscRecorder2 discRecorder);
  2257. // Number of blocks in use
  2258. [DispId(3)]
  2259. int UsedBlocks { get; }
  2260. // Volume name
  2261. [DispId(4)]
  2262. string VolumeName { get; set; }
  2263. // Imported Volume name
  2264. [DispId(5)]
  2265. string ImportedVolumeName { get; }
  2266. // Boot image and boot options
  2267. [DispId(6)]
  2268. IBootOptions BootImageOptions { get; set; }
  2269. // Number of files in the image
  2270. [DispId(7)]
  2271. int FileCount { get; }
  2272. // Number of directories in the image
  2273. [DispId(8)]
  2274. int DirectoryCount { get; }
  2275. // Temp directory for stash files
  2276. [DispId(9)]
  2277. string WorkingDirectory { get; set; }
  2278. // Change point identifier
  2279. [DispId(10)]
  2280. int ChangePoint { get; }
  2281. // Strict file system compliance option
  2282. [DispId(11)]
  2283. bool StrictFileSystemCompliance { get; set; }
  2284. // If true, indicates restricted character set is being used for file and directory names
  2285. [DispId(12)]
  2286. bool UseRestrictedCharacterSet { get; set; }
  2287. // File systems to create
  2288. [DispId(13)]
  2289. FsiFileSystems FileSystemsToCreate { get; set; }
  2290. // File systems supported
  2291. [DispId(14)]
  2292. FsiFileSystems FileSystemsSupported { get; }
  2293. // UDF revision
  2294. [DispId(0x25)]
  2295. int UDFRevision { set; get; }
  2296. // UDF revision(s) supported
  2297. [DispId(0x1f)]
  2298. object[] UDFRevisionsSupported { get; }
  2299. // Select filesystem types and image size based on the current media
  2300. [DispId(0x20)]
  2301. void ChooseImageDefaults(IDiscRecorder2 discRecorder);
  2302. // Select filesystem types and image size based on the media type
  2303. [DispId(0x21)]
  2304. void ChooseImageDefaultsForMediaType(IMAPI_MEDIA_PHYSICAL_TYPE value);
  2305. // ISO compatibility level to create
  2306. [DispId(0x22)]
  2307. int ISO9660InterchangeLevel { set; get; }
  2308. // ISO compatibility level(s) supported
  2309. [DispId(0x26)]
  2310. object[] ISO9660InterchangeLevelsSupported { get; }
  2311. // Create result image stream
  2312. [DispId(15)]
  2313. IFileSystemImageResult CreateResultImage();
  2314. // Check for existance an item in the file system
  2315. [DispId(0x10)]
  2316. FsiItemType Exists(string FullPath);
  2317. // Return a string useful for identifying the current disc
  2318. [DispId(0x12)]
  2319. string CalculateDiscIdentifier();
  2320. // Identify file systems on a given disc
  2321. [DispId(0x13)]
  2322. FsiFileSystems IdentifyFileSystemsOnDisc(IDiscRecorder2 discRecorder);
  2323. // Identify which of the specified file systems would be imported by default
  2324. [DispId(20)]
  2325. FsiFileSystems GetDefaultFileSystemForImport(FsiFileSystems fileSystems);
  2326. // Import the default file system on the current disc
  2327. [DispId(0x15)]
  2328. FsiFileSystems ImportFileSystem();
  2329. // Import a specific file system on the current disc
  2330. [DispId(0x16)]
  2331. void ImportSpecificFileSystem(FsiFileSystems fileSystemToUse);
  2332. // Roll back to the specified change point
  2333. [DispId(0x17)]
  2334. void RollbackToChangePoint(int ChangePoint);
  2335. // Lock in changes
  2336. [DispId(0x18)]
  2337. void LockInChangePoint();
  2338. // Create a directory item with the specified name
  2339. [DispId(0x19)]
  2340. IFsiDirectoryItem CreateDirectoryItem(string Name);
  2341. // Create a file item with the specified name
  2342. [DispId(0x1a)]
  2343. IFsiFileItem CreateFileItem(string Name);
  2344. // Volume Name UDF
  2345. [DispId(0x1b)]
  2346. string VolumeNameUDF { get; }
  2347. // Volume name Joliet
  2348. [DispId(0x1c)]
  2349. string VolumeNameJoliet { get; }
  2350. // Volume name ISO 9660
  2351. [DispId(0x1d)]
  2352. string VolumeNameISO9660 { get; }
  2353. // Indicates whether or not IMAPI should stage the filesystem before the burn
  2354. [DispId(30)]
  2355. bool StageFiles { get; set; }
  2356. // Get array of available multi-session interfaces.
  2357. [DispId(40)]
  2358. object[] MultisessionInterfaces { get; set; }
  2359. }
  2360. /// <summary>
  2361. /// File system image (rev.2)
  2362. /// </summary>
  2363. [ComImport]
  2364. [Guid("D7644B2C-1537-4767-B62F-F1387B02DDFD")]
  2365. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2366. public interface IFileSystemImage2
  2367. {
  2368. //
  2369. // IFileSystemImage
  2370. //
  2371. // Root directory item
  2372. [DispId(0)]
  2373. IFsiDirectoryItem Root { get; }
  2374. // Disc start block for the image
  2375. [DispId(1)]
  2376. int SessionStartBlock { get; set; }
  2377. // Maximum number of blocks available for the image
  2378. [DispId(2)]
  2379. int FreeMediaBlocks { get; set; }
  2380. // Set maximum number of blocks available based on the recorder
  2381. // supported discs. 0 for unknown maximum may be set.
  2382. [DispId(0x24)]
  2383. void SetMaxMediaBlocksFromDevice(IDiscRecorder2 discRecorder);
  2384. // Number of blocks in use
  2385. [DispId(3)]
  2386. int UsedBlocks { get; }
  2387. // Volume name
  2388. [DispId(4)]
  2389. string VolumeName { get; set; }
  2390. // Imported Volume name
  2391. [DispId(5)]
  2392. string ImportedVolumeName { get; }
  2393. // Boot image and boot options
  2394. [DispId(6)]
  2395. IBootOptions BootImageOptions { get; set; }
  2396. // Number of files in the image
  2397. [DispId(7)]
  2398. int FileCount { get; }
  2399. // Number of directories in the image
  2400. [DispId(8)]
  2401. int DirectoryCount { get; }
  2402. // Temp directory for stash files
  2403. [DispId(9)]
  2404. string WorkingDirectory { get; set; }
  2405. // Change point identifier
  2406. [DispId(10)]
  2407. int ChangePoint { get; }
  2408. // Strict file system compliance option
  2409. [DispId(11)]
  2410. bool StrictFileSystemCompliance { get; set; }
  2411. // If true, indicates restricted character set is being used for file and directory names
  2412. [DispId(12)]
  2413. bool UseRestrictedCharacterSet { get; set; }
  2414. // File systems to create
  2415. [DispId(13)]
  2416. FsiFileSystems FileSystemsToCreate { get; set; }
  2417. // File systems supported
  2418. [DispId(14)]
  2419. FsiFileSystems FileSystemsSupported { get; }
  2420. // UDF revision
  2421. [DispId(0x25)]
  2422. int UDFRevision { set; get; }
  2423. // UDF revision(s) supported
  2424. [DispId(0x1f)]
  2425. object[] UDFRevisionsSupported { get; }
  2426. // Select filesystem types and image size based on the current media
  2427. [DispId(0x20)]
  2428. void ChooseImageDefaults(IDiscRecorder2 discRecorder);
  2429. // Select filesystem types and image size based on the media type
  2430. [DispId(0x21)]
  2431. void ChooseImageDefaultsForMediaType(IMAPI_MEDIA_PHYSICAL_TYPE value);
  2432. // ISO compatibility level to create
  2433. [DispId(0x22)]
  2434. int ISO9660InterchangeLevel { set; get; }
  2435. // ISO compatibility level(s) supported
  2436. [DispId(0x26)]
  2437. object[] ISO9660InterchangeLevelsSupported { get; }
  2438. // Create result image stream
  2439. [DispId(15)]
  2440. IFileSystemImageResult CreateResultImage();
  2441. // Check for existance an item in the file system
  2442. [DispId(0x10)]
  2443. FsiItemType Exists(string FullPath);
  2444. // Return a string useful for identifying the current disc
  2445. [DispId(0x12)]
  2446. string CalculateDiscIdentifier();
  2447. // Identify file systems on a given disc
  2448. [DispId(0x13)]
  2449. FsiFileSystems IdentifyFileSystemsOnDisc(IDiscRecorder2 discRecorder);
  2450. // Identify which of the specified file systems would be imported by default
  2451. [DispId(20)]
  2452. FsiFileSystems GetDefaultFileSystemForImport(FsiFileSystems fileSystems);
  2453. // Import the default file system on the current disc
  2454. [DispId(0x15)]
  2455. FsiFileSystems ImportFileSystem();
  2456. // Import a specific file system on the current disc
  2457. [DispId(0x16)]
  2458. void ImportSpecificFileSystem(FsiFileSystems fileSystemToUse);
  2459. // Roll back to the specified change point
  2460. [DispId(0x17)]
  2461. void RollbackToChangePoint(int ChangePoint);
  2462. // Lock in changes
  2463. [DispId(0x18)]
  2464. void LockInChangePoint();
  2465. // Create a directory item with the specified name
  2466. [DispId(0x19)]
  2467. IFsiDirectoryItem CreateDirectoryItem(string Name);
  2468. // Create a file item with the specified name
  2469. [DispId(0x1a)]
  2470. IFsiFileItem CreateFileItem(string Name);
  2471. // Volume Name UDF
  2472. [DispId(0x1b)]
  2473. string VolumeNameUDF { get; }
  2474. // Volume name Joliet
  2475. [DispId(0x1c)]
  2476. string VolumeNameJoliet { get; }
  2477. // Volume name ISO 9660
  2478. [DispId(0x1d)]
  2479. string VolumeNameISO9660 { get; }
  2480. // Indicates whether or not IMAPI should stage the filesystem before the burn
  2481. [DispId(30)]
  2482. bool StageFiles { get; set; }
  2483. // Get array of available multi-session interfaces.
  2484. [DispId(40)]
  2485. object[] MultisessionInterfaces { get; set; }
  2486. //
  2487. // IFileSystemImage2
  2488. //
  2489. // Get boot options array for supporting multi-boot
  2490. [DispId(60)]
  2491. object[] BootImageOptionsArray { get; set; }
  2492. }
  2493. /// <summary>
  2494. /// File system image (rev.3)"),
  2495. /// </summary>
  2496. [ComImport]
  2497. [Guid("7CFF842C-7E97-4807-8304-910DD8F7C051")]
  2498. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2499. public interface IFileSystemImage3
  2500. {
  2501. //
  2502. // IFileSystemImage
  2503. //
  2504. // Root directory item
  2505. [DispId(0)]
  2506. IFsiDirectoryItem Root { get; }
  2507. // Disc start block for the image
  2508. [DispId(1)]
  2509. int SessionStartBlock { get; set; }
  2510. // Maximum number of blocks available for the image
  2511. [DispId(2)]
  2512. int FreeMediaBlocks { get; set; }
  2513. // Set maximum number of blocks available based on the recorder
  2514. // supported discs. 0 for unknown maximum may be set.
  2515. [DispId(0x24)]
  2516. void SetMaxMediaBlocksFromDevice(IDiscRecorder2 discRecorder);
  2517. // Number of blocks in use
  2518. [DispId(3)]
  2519. int UsedBlocks { get; }
  2520. // Volume name
  2521. [DispId(4)]
  2522. string VolumeName { get; set; }
  2523. // Imported Volume name
  2524. [DispId(5)]
  2525. string ImportedVolumeName { get; }
  2526. // Boot image and boot options
  2527. [DispId(6)]
  2528. IBootOptions BootImageOptions { get; set; }
  2529. // Number of files in the image
  2530. [DispId(7)]
  2531. int FileCount { get; }
  2532. // Number of directories in the image
  2533. [DispId(8)]
  2534. int DirectoryCount { get; }
  2535. // Temp directory for stash files
  2536. [DispId(9)]
  2537. string WorkingDirectory { get; set; }
  2538. // Change point identifier
  2539. [DispId(10)]
  2540. int ChangePoint { get; }
  2541. // Strict file system compliance option
  2542. [DispId(11)]
  2543. bool StrictFileSystemCompliance { get; set; }
  2544. // If true, indicates restricted character set is being used for file and directory names
  2545. [DispId(12)]
  2546. bool UseRestrictedCharacterSet { get; set; }
  2547. // File systems to create
  2548. [DispId(13)]
  2549. FsiFileSystems FileSystemsToCreate { get; set; }
  2550. // File systems supported
  2551. [DispId(14)]
  2552. FsiFileSystems FileSystemsSupported { get; }
  2553. // UDF revision
  2554. [DispId(0x25)]
  2555. int UDFRevision { set; get; }
  2556. // UDF revision(s) supported
  2557. [DispId(0x1f)]
  2558. object[] UDFRevisionsSupported { get; }
  2559. // Select filesystem types and image size based on the current media
  2560. [DispId(0x20)]
  2561. void ChooseImageDefaults(IDiscRecorder2 discRecorder);
  2562. // Select filesystem types and image size based on the media type
  2563. [DispId(0x21)]
  2564. void ChooseImageDefaultsForMediaType(IMAPI_MEDIA_PHYSICAL_TYPE value);
  2565. // ISO compatibility level to create
  2566. [DispId(0x22)]
  2567. int ISO9660InterchangeLevel { set; get; }
  2568. // ISO compatibility level(s) supported
  2569. [DispId(0x26)]
  2570. object[] ISO9660InterchangeLevelsSupported { get; }
  2571. // Create result image stream
  2572. [DispId(15)]
  2573. IFileSystemImageResult CreateResultImage();
  2574. // Check for existance an item in the file system
  2575. [DispId(0x10)]
  2576. FsiItemType Exists(string FullPath);
  2577. // Return a string useful for identifying the current disc
  2578. [DispId(0x12)]
  2579. string CalculateDiscIdentifier();
  2580. // Identify file systems on a given disc
  2581. [DispId(0x13)]
  2582. FsiFileSystems IdentifyFileSystemsOnDisc(IDiscRecorder2 discRecorder);
  2583. // Identify which of the specified file systems would be imported by default
  2584. [DispId(20)]
  2585. FsiFileSystems GetDefaultFileSystemForImport(FsiFileSystems fileSystems);
  2586. // Import the default file system on the current disc
  2587. [DispId(0x15)]
  2588. FsiFileSystems ImportFileSystem();
  2589. // Import a specific file system on the current disc
  2590. [DispId(0x16)]
  2591. void ImportSpecificFileSystem(FsiFileSystems fileSystemToUse);
  2592. // Roll back to the specified change point
  2593. [DispId(0x17)]
  2594. void RollbackToChangePoint(int ChangePoint);
  2595. // Lock in changes
  2596. [DispId(0x18)]
  2597. void LockInChangePoint();
  2598. // Create a directory item with the specified name
  2599. [DispId(0x19)]
  2600. IFsiDirectoryItem CreateDirectoryItem(string Name);
  2601. // Create a file item with the specified name
  2602. [DispId(0x1a)]
  2603. IFsiFileItem CreateFileItem(string Name);
  2604. // Volume Name UDF
  2605. [DispId(0x1b)]
  2606. string VolumeNameUDF { get; }
  2607. // Volume name Joliet
  2608. [DispId(0x1c)]
  2609. string VolumeNameJoliet { get; }
  2610. // Volume name ISO 9660
  2611. [DispId(0x1d)]
  2612. string VolumeNameISO9660 { get; }
  2613. // Indicates whether or not IMAPI should stage the filesystem before the burn
  2614. [DispId(30)]
  2615. bool StageFiles { get; set; }
  2616. // Get array of available multi-session interfaces.
  2617. [DispId(40)]
  2618. object[] MultisessionInterfaces { get; set; }
  2619. //
  2620. // IFileSystemImage2
  2621. //
  2622. // Get boot options array for supporting multi-boot
  2623. [DispId(60)]
  2624. object[] BootImageOptionsArray { get; set; }
  2625. //
  2626. // IFileSystemImage3
  2627. //
  2628. // If true, indicates that UDF Metadata and Metadata Mirror files are truly redundant,
  2629. // i.e. reference different extents
  2630. [DispId(0x3d)]
  2631. bool CreateRedundantUdfMetadataFiles { get; set; }
  2632. // Probe if a specific file system on the disc is appendable through IMAPI
  2633. [DispId(70)]
  2634. bool ProbeSpecificFileSystem(FsiFileSystems fileSystemToProbe);
  2635. }
  2636. /// <summary>
  2637. /// FileSystemImage result stream
  2638. /// </summary>
  2639. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2640. [Guid("2C941FD8-975B-59BE-A960-9A2A262853A5")]
  2641. public interface IFileSystemImageResult
  2642. {
  2643. // Image stream
  2644. [DispId(1)]
  2645. IStream ImageStream { get; }
  2646. // Progress item block mapping collection
  2647. [DispId(2)]
  2648. IProgressItems ProgressItems { get; }
  2649. // Number of blocks in the result image
  2650. [DispId(3)]
  2651. int TotalBlocks { get; }
  2652. // Number of bytes in a block
  2653. [DispId(4)]
  2654. int BlockSize { get; }
  2655. // Disc Identifier (for identifing imported session of multi-session disc)
  2656. [DispId(5)]
  2657. string DiscId { get; }
  2658. }
  2659. [Guid("2C941FDC-975B-59BE-A960-9A2A262853A5")]
  2660. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2661. public interface IFsiDirectoryItem
  2662. {
  2663. //
  2664. // IFsiItem
  2665. //
  2666. // Item name
  2667. [DispId(11)]
  2668. string Name { get; }
  2669. // Full path
  2670. [DispId(12)]
  2671. string FullPath { get; }
  2672. // Date and time of creation
  2673. [DispId(13)]
  2674. DateTime CreationTime { get; set; }
  2675. // Date and time of last access
  2676. [DispId(14)]
  2677. DateTime LastAccessedTime { get; set; }
  2678. // Date and time of last modification
  2679. [DispId(15)]
  2680. DateTime LastModifiedTime { get; set; }
  2681. // Flag indicating if item is hidden
  2682. [DispId(0x10)]
  2683. bool IsHidden { get; set; }
  2684. // Name of item in the specified file system
  2685. [DispId(0x11)]
  2686. string FileSystemName(FsiFileSystems fileSystem);
  2687. // Name of item in the specified file system
  2688. [DispId(0x12)]
  2689. string FileSystemPath(FsiFileSystems fileSystem);
  2690. //
  2691. // IFsiDirectoryItem
  2692. //
  2693. // Get an enumerator for the collection
  2694. [TypeLibFunc((short)0x41), DispId(-4)]
  2695. IEnumerator GetEnumerator();
  2696. // Get the item with the given relative path
  2697. [DispId(0)]
  2698. IFsiItem this[string path] { get; }
  2699. // Number of items in the collection
  2700. [DispId(1)]
  2701. int Count { get; }
  2702. // Get a non-variant enumerator
  2703. [DispId(2)]
  2704. IEnumFsiItems EnumFsiItems { get; }
  2705. // Add a directory with the specified relative path
  2706. [DispId(30)]
  2707. void AddDirectory(string path);
  2708. // Add a file with the specified relative path and data
  2709. [DispId(0x1f)]
  2710. void AddFile(string path, IStream fileData);
  2711. // Add files and directories from the specified source directory
  2712. [DispId(0x20)]
  2713. void AddTree(string sourceDirectory, bool includeBaseDirectory);
  2714. // Add an item
  2715. [DispId(0x21)]
  2716. void Add(IFsiItem Item);
  2717. // Remove an item with the specified relative path
  2718. [DispId(0x22)]
  2719. void Remove(string path);
  2720. // Remove a subtree with the specified relative path
  2721. [DispId(0x23)]
  2722. void RemoveTree(string path);
  2723. }
  2724. /// <summary>
  2725. /// FileSystemImage directory item (rev.2)
  2726. /// </summary>
  2727. [ComImport]
  2728. [Guid("F7FB4B9B-6D96-4D7B-9115-201B144811EF")]
  2729. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2730. public interface IFsiDirectoryItem2 : IFsiDirectoryItem
  2731. {
  2732. // Add files and directories from the specified source directory including named streams
  2733. [DispId(0x24)]
  2734. void AddTreeWithNamedStreams( string sourceDirectory, bool includeBaseDirectory);
  2735. }
  2736. /// <summary>
  2737. /// FileSystemImage file item
  2738. /// </summary>
  2739. [Guid("2C941FDB-975B-59BE-A960-9A2A262853A5")]
  2740. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2741. public interface IFsiFileItem
  2742. {
  2743. //
  2744. // IFsiItem
  2745. //
  2746. // Item name
  2747. [DispId(11)]
  2748. string Name { get; }
  2749. // Full path
  2750. [DispId(12)]
  2751. string FullPath { get; }
  2752. // Date and time of creation
  2753. [DispId(13)]
  2754. DateTime CreationTime { get; set; }
  2755. // Date and time of last access
  2756. [DispId(14)]
  2757. DateTime LastAccessedTime { get; set; }
  2758. // Date and time of last modification
  2759. [DispId(15)]
  2760. DateTime LastModifiedTime { get; set; }
  2761. // Flag indicating if item is hidden
  2762. [DispId(0x10)]
  2763. bool IsHidden { get; set; }
  2764. // Name of item in the specified file system
  2765. [DispId(0x11)]
  2766. string FileSystemName(FsiFileSystems fileSystem);
  2767. // Name of item in the specified file system
  2768. [DispId(0x12)]
  2769. string FileSystemPath(FsiFileSystems fileSystem);
  2770. //
  2771. // IFsiFileItem
  2772. //
  2773. // Data byte count
  2774. [DispId(0x29)]
  2775. long DataSize { get; }
  2776. // Lower 32 bits of the data byte count
  2777. [DispId(0x2a)]
  2778. int DataSize32BitLow { get; }
  2779. // Upper 32 bits of the data byte count
  2780. [DispId(0x2b)]
  2781. int DataSize32BitHigh { get; }
  2782. // Data stream
  2783. [DispId(0x2c)]
  2784. IStream Data { get; set; }
  2785. }
  2786. /// <summary>
  2787. /// FileSystemImage file item (rev.2)
  2788. /// </summary>
  2789. [ComImport]
  2790. [Guid("199D0C19-11E1-40EB-8EC2-C8C822A07792")]
  2791. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2792. public interface IFsiFileItem2
  2793. {
  2794. //
  2795. // IFsiItem
  2796. //
  2797. // Item name
  2798. [DispId(11)]
  2799. string Name { get; }
  2800. // Full path
  2801. [DispId(12)]
  2802. string FullPath { get; }
  2803. // Date and time of creation
  2804. [DispId(13)]
  2805. DateTime CreationTime { get; set; }
  2806. // Date and time of last access
  2807. [DispId(14)]
  2808. DateTime LastAccessedTime { get; set; }
  2809. // Date and time of last modification
  2810. [DispId(15)]
  2811. DateTime LastModifiedTime { get; set; }
  2812. // Flag indicating if item is hidden
  2813. [DispId(0x10)]
  2814. bool IsHidden { get; set; }
  2815. // Name of item in the specified file system
  2816. [DispId(0x11)]
  2817. string FileSystemName(FsiFileSystems fileSystem);
  2818. // Name of item in the specified file system
  2819. [DispId(0x12)]
  2820. string FileSystemPath(FsiFileSystems fileSystem);
  2821. //
  2822. // IFsiFileItem
  2823. //
  2824. // Data byte count
  2825. [DispId(0x29)]
  2826. long DataSize { get; }
  2827. // Lower 32 bits of the data byte count
  2828. [DispId(0x2a)]
  2829. int DataSize32BitLow { get; }
  2830. // Upper 32 bits of the data byte count
  2831. [DispId(0x2b)]
  2832. int DataSize32BitHigh { get; }
  2833. // Data stream
  2834. [DispId(0x2c)]
  2835. IStream Data { get; set; }
  2836. //
  2837. // IFsiFileItem2
  2838. //
  2839. // Get the list of the named streams of the file
  2840. [DispId(0x2d)]
  2841. FsiNamedStreams FsiNamedStreams { get; }
  2842. // Flag indicating if file item is a named stream of a file
  2843. [DispId(0x2e)]
  2844. bool IsNamedStream { get; }
  2845. // Add a new named stream to the collection
  2846. [DispId(0x2f)]
  2847. void AddStream( string Name, FsiStream streamData);
  2848. // Remove a specific named stream from the collection
  2849. [DispId(0x30)]
  2850. void RemoveStream( string Name);
  2851. // Flag indicating if file is Real-Time
  2852. [DispId(0x31)]
  2853. bool IsRealTime { get; set; }
  2854. }
  2855. /// <summary>
  2856. /// FileSystemImage item
  2857. /// </summary>
  2858. [Guid("2C941FD9-975B-59BE-A960-9A2A262853A5")]
  2859. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2860. public interface IFsiItem
  2861. {
  2862. // Item name
  2863. [DispId(11)]
  2864. string Name { get; }
  2865. // Full path
  2866. [DispId(12)]
  2867. string FullPath { get; }
  2868. // Date and time of creation
  2869. [DispId(13)]
  2870. DateTime CreationTime { get; set; }
  2871. // Date and time of last access
  2872. [DispId(14)]
  2873. DateTime LastAccessedTime { get; set; }
  2874. // Date and time of last modification
  2875. [DispId(15)]
  2876. DateTime LastModifiedTime { get; set; }
  2877. // Flag indicating if item is hidden
  2878. [DispId(0x10)]
  2879. bool IsHidden { get; set; }
  2880. // Name of item in the specified file system
  2881. [DispId(0x11)]
  2882. string FileSystemName(FsiFileSystems fileSystem);
  2883. // Name of item in the specified file system
  2884. [DispId(0x12)]
  2885. string FileSystemPath(FsiFileSystems fileSystem);
  2886. }
  2887. /// <summary>
  2888. /// Named stream collection
  2889. /// </summary>
  2890. [ComImport]
  2891. [Guid("ED79BA56-5294-4250-8D46-F9AECEE23459")]
  2892. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2893. public interface IFsiNamedStreams : IEnumerable
  2894. {
  2895. // Get a named stream from the collection
  2896. [DispId(0)]
  2897. FsiFileItem this[int Index] { get; }
  2898. // Number of named streams in the collection
  2899. [DispId(0x51)]
  2900. int Count { [DispId(0x51)] get; }
  2901. // Get a non-variant enumerator for the named stream collection
  2902. [DispId(0x52)]
  2903. EnumFsiItems EnumNamedStreams { get; }
  2904. }
  2905. /// <summary>
  2906. /// ISO Image Manager: Helper object for ISO image file manipulation
  2907. /// </summary>
  2908. [ComImport]
  2909. [TypeLibType(TypeLibTypeFlags.FDispatchable)]
  2910. [Guid("6CA38BE5-FBBB-4800-95A1-A438865EB0D4")]
  2911. public interface IIsoImageManager
  2912. {
  2913. // Path to the ISO image file
  2914. [DispId(0x100)]
  2915. string path { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] get; }
  2916. // Stream from the ISO image
  2917. [DispId(0x101)]
  2918. FsiStream Stream { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] get; }
  2919. // Set path to the ISO image file, overwrites stream
  2920. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  2921. void SetPath( string Val);
  2922. // Set stream from the ISO image, overwrites path
  2923. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  2924. void SetStream([In, MarshalAs(UnmanagedType.Interface)] FsiStream Data);
  2925. // Validate if the ISO image file is a valid file
  2926. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  2927. void Validate();
  2928. }
  2929. [ComImport]
  2930. [Guid("27354150-7F64-5B0F-8F00-5D77AFBE261E")]
  2931. [TypeLibType(TypeLibTypeFlags.FDispatchable)]
  2932. public interface IMultisession
  2933. {
  2934. // Is it possible to write this multi-session type on the current media in its present state
  2935. [DispId(0x100)]
  2936. bool IsSupportedOnCurrentMediaState { get; }
  2937. // Is this multi-session type the one to use on current media
  2938. [DispId(0x101)]
  2939. bool InUse { set; get; }
  2940. // The disc recorder to use to import previous session(s)
  2941. [DispId(0x102)]
  2942. MsftDiscRecorder2 ImportRecorder { get; }
  2943. }
  2944. [ComImport]
  2945. [Guid("27354151-7F64-5B0F-8F00-5D77AFBE261E")]
  2946. [TypeLibType(TypeLibTypeFlags.FDispatchable)]
  2947. public interface IMultisessionSequential
  2948. {
  2949. //
  2950. // IMultisession
  2951. //
  2952. // Is it possible to write this multi-session type on the current media in its present state
  2953. [DispId(0x100)]
  2954. bool IsSupportedOnCurrentMediaState { get; }
  2955. // Is this multi-session type the one to use on current media
  2956. [DispId(0x101)]
  2957. bool InUse { set; get; }
  2958. // The disc recorder to use to import previous session(s)
  2959. [DispId(0x102)]
  2960. MsftDiscRecorder2 ImportRecorder { get; }
  2961. //
  2962. // IMultisessionSequential
  2963. //
  2964. // Is this the first data session on the media?
  2965. [DispId(0x200)]
  2966. bool IsFirstDataSession { get; }
  2967. // The first sector in the previous session on the media.
  2968. [DispId(0x201)]
  2969. int StartAddressOfPreviousSession { get; }
  2970. // The last sector in the previous session on the media
  2971. [DispId(0x202)]
  2972. int LastWrittenAddressOfPreviousSession { get; }
  2973. // Next writable address on the media (also used sectors).
  2974. [DispId(0x203)]
  2975. int NextWritableAddress { get; }
  2976. // Free sectors available on the media
  2977. [DispId(0x204)]
  2978. int FreeSectorsOnMedia { get; }
  2979. }
  2980. /// <summary>
  2981. /// FileSystemImageResult progress item
  2982. /// </summary>
  2983. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2984. [Guid("2C941FD5-975B-59BE-A960-9A2A262853A5")]
  2985. public interface IProgressItem
  2986. {
  2987. // Progress item description
  2988. [DispId(1)]
  2989. string Description { get; }
  2990. // First block in the range of blocks used by the progress item
  2991. [DispId(2)]
  2992. uint FirstBlock { get; }
  2993. // Last block in the range of blocks used by the progress item
  2994. [DispId(3)]
  2995. uint LastBlock { get; }
  2996. // Number of blocks used by the progress item
  2997. [DispId(4)]
  2998. uint BlockCount { get; }
  2999. }
  3000. /// <summary>
  3001. /// FileSystemImageResult progress item
  3002. /// </summary>
  3003. [Guid("2C941FD7-975B-59BE-A960-9A2A262853A5")]
  3004. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  3005. public interface IProgressItems
  3006. {
  3007. // Get an enumerator for the collection
  3008. [DispId(-4), TypeLibFunc((short)0x41)]
  3009. IEnumerator GetEnumerator();
  3010. // Find the block mapping from the specified index
  3011. [DispId(0)]
  3012. IProgressItem this[int Index] { get; }
  3013. // Number of items in the collection
  3014. [DispId(1)]
  3015. int Count { get; }
  3016. // Find the block mapping from the specified block
  3017. [DispId(2)]
  3018. IProgressItem ProgressItemFromBlock(uint block);
  3019. // Find the block mapping from the specified item description
  3020. [DispId(3)]
  3021. IProgressItem ProgressItemFromDescription(string Description);
  3022. // Get a non-variant enumerator
  3023. [DispId(4)]
  3024. IEnumProgressItems EnumProgressItems { get; }
  3025. }
  3026. [ComImport]
  3027. [Guid("25983550-9D65-49CE-B335-40630D901227")]
  3028. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  3029. public interface IRawCDImageCreator
  3030. {
  3031. // Creates the result stream
  3032. [DispId(0x200)]
  3033. IStream CreateResultImage();
  3034. // Adds a track to the media (defaults to audio, always 2352 bytes/sector)
  3035. [DispId(0x201)]
  3036. int AddTrack(IMAPI_CD_SECTOR_TYPE dataType, [In, MarshalAs(UnmanagedType.Interface)] IStream data);
  3037. // Adds a special pregap to the first track, and implies an audio CD
  3038. [DispId(0x202)]
  3039. void AddSpecialPregap([In, MarshalAs(UnmanagedType.Interface)] IStream data);
  3040. // Adds an R-W subcode generation object to supply R-W subcode (i.e. CD-Text or CD-G).
  3041. [DispId(0x203)]
  3042. void AddSubcodeRWGenerator([In, MarshalAs(UnmanagedType.Interface)] IStream subcode);
  3043. [DispId(0x100)]
  3044. IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE ResultingImageType { set; get; }
  3045. // Equal to (final user LBA+1), defines minimum disc size image can be written to.
  3046. [DispId(0x101)]
  3047. int StartOfLeadout { get; }
  3048. //
  3049. [DispId(0x102)]
  3050. int StartOfLeadoutLimit { set; get; }
  3051. // Disables gapless recording of consecutive audio tracks
  3052. [DispId(0x103)]
  3053. bool DisableGaplessAudio { set; get; }
  3054. // The Media Catalog Number for the CD image
  3055. [DispId(260)]
  3056. string MediaCatalogNumber { set; get; }
  3057. // The starting track number (only for pure audio CDs)
  3058. [DispId(0x105)]
  3059. int StartingTrackNumber { set; get; }
  3060. [DispId(0x106)]
  3061. IRawCDImageTrackInfo this[int trackIndex] { [DispId(0x106)] get; }
  3062. [DispId(0x107)]
  3063. int NumberOfExistingTracks { get; }
  3064. [DispId(0x108)]
  3065. int LastUsedUserSectorInImage { get; }
  3066. [DispId(0x109)]
  3067. object[] ExpectedTableOfContents { get; }
  3068. }
  3069. [ComImport]
  3070. [Guid("25983551-9D65-49CE-B335-40630D901227")]
  3071. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  3072. public interface IRawCDImageTrackInfo
  3073. {
  3074. // The LBA of the first user sector in this track
  3075. [DispId(0x100)]
  3076. int StartingLba { get; }
  3077. // The number of user sectors in this track
  3078. [DispId(0x101)]
  3079. int SectorCount { get; }
  3080. // The track number assigned for this track
  3081. [DispId(0x102)]
  3082. int TrackNumber { get; }
  3083. // The type of data being recorded on the current sector.
  3084. [DispId(0x103)]
  3085. IMAPI_CD_SECTOR_TYPE SectorType { get; }
  3086. // The International Standard Recording Code (ISRC) for this track.
  3087. [DispId(260)]
  3088. string ISRC { get; set; }
  3089. // The digital audio copy setting for this track
  3090. [DispId(0x105)]
  3091. IMAPI_CD_TRACK_DIGITAL_COPY_SETTING DigitalAudioCopySetting { get; set; }
  3092. // The audio provided already has preemphasis applied (rare).
  3093. [DispId(0x106)]
  3094. bool AudioHasPreemphasis { get; set; }
  3095. // The list of current track-relative indexes within the CD track.
  3096. [DispId(0x107)]
  3097. object[] TrackIndexes { get; }
  3098. // Add the specified LBA (relative to the start of the track) as an index.
  3099. [DispId(0x200)]
  3100. void AddTrackIndex( int lbaOffset);
  3101. // Removes the specified LBA (relative to the start of the track) as an index.
  3102. [DispId(0x201)]
  3103. void ClearTrackIndex( int lbaOffset);
  3104. }
  3105. /// <summary>
  3106. /// Write Engine
  3107. /// </summary>
  3108. [ComImport]
  3109. [Guid("27354135-7F64-5B0F-8F00-5D77AFBE261E")]
  3110. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  3111. public interface IWriteEngine2
  3112. {
  3113. // Writes data provided in the IStream to the device
  3114. [DispId(0x200)]
  3115. void WriteSection(IStream data, int startingBlockAddress, int numberOfBlocks);
  3116. // Cancels the current write operation
  3117. [DispId(0x201)]
  3118. void CancelWrite();
  3119. // The disc recorder to use
  3120. [DispId(0x100)]
  3121. IDiscRecorder2Ex Recorder { set; get; }
  3122. // If true, uses WRITE12 with the AV bit set to one; else uses WRITE10
  3123. [DispId(0x101)]
  3124. bool UseStreamingWrite12 { set; get; }
  3125. // The approximate number of sectors per second the device can write at
  3126. // the start of the write process. This is used to optimize sleep time
  3127. // in the write engine.
  3128. [DispId(0x102)]
  3129. int StartingSectorsPerSecond { set; get; }
  3130. // The approximate number of sectors per second the device can write at
  3131. // the end of the write process. This is used to optimize sleep time
  3132. // in the write engine.
  3133. [DispId(0x103)]
  3134. int EndingSectorsPerSecond { set; get; }
  3135. // The number of bytes to use for each sector during writing.
  3136. [DispId(260)]
  3137. int BytesPerSector { set; get; }
  3138. // Simple check to see if the object is currently writing to media.
  3139. [DispId(0x105)]
  3140. bool WriteInProgress { get; }
  3141. }
  3142. /// <summary>
  3143. /// CD Write Engine
  3144. /// </summary>
  3145. [ComImport]
  3146. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  3147. [Guid("27354136-7F64-5B0F-8F00-5D77AFBE261E")]
  3148. public interface IWriteEngine2EventArgs
  3149. {
  3150. // The starting logical block address for the current write operation.
  3151. [DispId(0x100)]
  3152. int StartLba { get; }
  3153. // The number of sectors being written for the current write operation.
  3154. [DispId(0x101)]
  3155. int SectorCount { get; }
  3156. // The last logical block address of data read for the current write operation.
  3157. [DispId(0x102)]
  3158. int LastReadLba { get; }
  3159. // The last logical block address of data written for the current write operation
  3160. [DispId(0x103)]
  3161. int LastWrittenLba { get; }
  3162. // The total bytes available in the system's cache buffer
  3163. [DispId(0x106)]
  3164. int TotalSystemBuffer { get; }
  3165. // The used bytes in the system's cache buffer
  3166. [DispId(0x107)]
  3167. int UsedSystemBuffer { get; }
  3168. // The free bytes in the system's cache buffer
  3169. [DispId(0x108)]
  3170. int FreeSystemBuffer { get; }
  3171. }
  3172. /// <summary>
  3173. /// A single optical drive Write Speed Configuration
  3174. /// </summary>
  3175. [ComImport]
  3176. [Guid("27354144-7F64-5B0F-8F00-5D77AFBE261E")]
  3177. [TypeLibType(TypeLibTypeFlags.FDispatchable|TypeLibTypeFlags.FDual)]
  3178. public interface IWriteSpeedDescriptor
  3179. {
  3180. // The type of media that this descriptor is valid for
  3181. [DispId(0x101)]
  3182. IMAPI_MEDIA_PHYSICAL_TYPE MediaType { get; }
  3183. // Whether or not this descriptor represents a writing configuration that uses
  3184. // Pure CAV rotation control
  3185. [DispId(0x102)]
  3186. bool RotationTypeIsPureCAV { get; }
  3187. // The maximum speed at which the media will be written in the write configuration
  3188. // represented by this descriptor
  3189. [DispId(0x103)]
  3190. int WriteSpeed { get; }
  3191. }
  3192. #endregion // Interfaces
  3193. [ComImport]
  3194. [CoClass(typeof(MsftDiscFormat2DataClass))]
  3195. [Guid("27354153-9F64-5B0F-8F00-5D77AFBE261E")]
  3196. public interface MsftDiscFormat2Data : IDiscFormat2Data, DiscFormat2Data_Event
  3197. {
  3198. }
  3199. [ComImport]
  3200. [ComSourceInterfaces("DDiscFormat2DataEvents\0")]
  3201. [Guid("2735412A-7F64-5B0F-8F00-5D77AFBE261E")]
  3202. [TypeLibType(TypeLibTypeFlags.FCanCreate), ClassInterface(ClassInterfaceType.None)]
  3203. public class MsftDiscFormat2DataClass
  3204. {
  3205. }
  3206. [ComImport]
  3207. [Guid("27354156-8F64-5B0F-8F00-5D77AFBE261E")]
  3208. [CoClass(typeof(MsftDiscFormat2EraseClass))]
  3209. public interface MsftDiscFormat2Erase : IDiscFormat2Erase, DiscFormat2Erase_Event
  3210. {
  3211. }
  3212. [ComImport]
  3213. [Guid("2735412B-7F64-5B0F-8F00-5D77AFBE261E")]
  3214. [ComSourceInterfaces("DDiscFormat2EraseEvents\0")]
  3215. [TypeLibType(TypeLibTypeFlags.FCanCreate), ClassInterface(ClassInterfaceType.None)]
  3216. public class MsftDiscFormat2EraseClass
  3217. {
  3218. }
  3219. [ComImport]
  3220. [CoClass(typeof(MsftDiscFormat2RawCDClass))]
  3221. [Guid("27354155-8F64-5B0F-8F00-5D77AFBE261E")]
  3222. public interface MsftDiscFormat2RawCD : IDiscFormat2RawCD, DiscFormat2RawCD_Event
  3223. {
  3224. }
  3225. [ComImport]
  3226. [Guid("27354128-7F64-5B0F-8F00-5D77AFBE261E")]
  3227. [ComSourceInterfaces("DDiscFormat2RawCDEvents\0")]
  3228. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3229. [ClassInterface(ClassInterfaceType.None)]
  3230. public class MsftDiscFormat2RawCDClass
  3231. {
  3232. }
  3233. /// <summary>
  3234. /// Microsoft IMAPIv2 Track-at-Once Audio CD Writer
  3235. /// </summary>
  3236. [ComImport]
  3237. [Guid("27354154-8F64-5B0F-8F00-5D77AFBE261E")]
  3238. [CoClass(typeof(MsftDiscFormat2TrackAtOnceClass))]
  3239. public interface MsftDiscFormat2TrackAtOnce : IDiscFormat2TrackAtOnce, DiscFormat2TrackAtOnce_Event
  3240. {
  3241. }
  3242. [ComImport]
  3243. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3244. [ComSourceInterfaces("DDiscFormat2TrackAtOnceEvents\0")]
  3245. [Guid("27354129-7F64-5B0F-8F00-5D77AFBE261E")]
  3246. [ClassInterface(ClassInterfaceType.None)]
  3247. public class MsftDiscFormat2TrackAtOnceClass
  3248. {
  3249. }
  3250. /// <summary>
  3251. /// Microsoft IMAPIv2 Disc Master
  3252. /// </summary>
  3253. [ComImport]
  3254. [Guid("27354130-7F64-5B0F-8F00-5D77AFBE261E")]
  3255. [CoClass(typeof(MsftDiscMaster2Class))]
  3256. public interface MsftDiscMaster2 : IDiscMaster2 //, DiscMaster2_Event
  3257. {
  3258. }
  3259. [ComImport, ComSourceInterfaces("DDiscMaster2Events\0")]
  3260. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3261. [Guid("2735412E-7F64-5B0F-8F00-5D77AFBE261E")]
  3262. [ClassInterface(ClassInterfaceType.None)]
  3263. public class MsftDiscMaster2Class
  3264. {
  3265. }
  3266. [ComImport]
  3267. [CoClass(typeof(MsftDiscRecorder2Class))]
  3268. [Guid("27354133-7F64-5B0F-8F00-5D77AFBE261E")]
  3269. public interface MsftDiscRecorder2 : IDiscRecorder2
  3270. {
  3271. }
  3272. [ComImport]
  3273. [Guid("2735412D-7F64-5B0F-8F00-5D77AFBE261E")]
  3274. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3275. [ClassInterface(ClassInterfaceType.None)]
  3276. public class MsftDiscRecorder2Class
  3277. {
  3278. }
  3279. [ComImport]
  3280. [Guid("27354151-7F64-5B0F-8F00-5D77AFBE261E")]
  3281. [CoClass(typeof(MsftMultisessionSequentialClass))]
  3282. public interface MsftMultisessionSequential : IMultisessionSequential
  3283. {
  3284. }
  3285. [ComImport]
  3286. [Guid("27354122-7F64-5B0F-8F00-5D77AFBE261E")]
  3287. [ClassInterface(ClassInterfaceType.None)]
  3288. public class MsftMultisessionSequentialClass
  3289. {
  3290. }
  3291. [ComImport]
  3292. [Guid("25983550-9D65-49CE-B335-40630D901227")]
  3293. [CoClass(typeof(MsftRawCDImageCreatorClass))]
  3294. public interface MsftRawCDImageCreator : IRawCDImageCreator
  3295. {
  3296. }
  3297. [ComImport]
  3298. [Guid("25983561-9D65-49CE-B335-40630D901227")]
  3299. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3300. [ClassInterface(ClassInterfaceType.None)]
  3301. public class MsftRawCDImageCreatorClass
  3302. {
  3303. }
  3304. [ComImport]
  3305. [Guid("27354135-7F64-5B0F-8F00-5D77AFBE261E")]
  3306. [CoClass(typeof(MsftWriteEngine2Class))]
  3307. public interface MsftWriteEngine2 : IWriteEngine2, DWriteEngine2_Event
  3308. {
  3309. }
  3310. [ComImport]
  3311. [Guid("2735412C-7F64-5B0F-8F00-5D77AFBE261E")]
  3312. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3313. [ComSourceInterfaces("DWriteEngine2Events\0")]
  3314. [ClassInterface(ClassInterfaceType.None)]
  3315. public class MsftWriteEngine2Class
  3316. {
  3317. }
  3318. [ComImport]
  3319. [CoClass(typeof(MsftWriteSpeedDescriptorClass))]
  3320. [Guid("27354144-7F64-5B0F-8F00-5D77AFBE261E")]
  3321. public interface MsftWriteSpeedDescriptor : IWriteSpeedDescriptor
  3322. {
  3323. }
  3324. [ComImport][ClassInterface(ClassInterfaceType.None)]
  3325. [Guid("27354123-7F64-5B0F-8F00-5D77AFBE261E")]
  3326. public class MsftWriteSpeedDescriptorClass
  3327. {
  3328. }
  3329. [ComImport]
  3330. [CoClass(typeof(BootOptionsClass))]
  3331. [Guid("2C941FD4-975B-59BE-A960-9A2A262853A5")]
  3332. public interface BootOptions : IBootOptions
  3333. {
  3334. }
  3335. [ComImport]
  3336. [ClassInterface(ClassInterfaceType.None)]
  3337. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3338. [Guid("2C941FCE-975B-59BE-A960-9A2A262853A5")]
  3339. public class BootOptionsClass
  3340. {
  3341. }
  3342. [ComImport]
  3343. [Guid("2C941FDA-975B-59BE-A960-9A2A262853A5")]
  3344. [CoClass(typeof(EnumFsiItemsClass))]
  3345. public interface EnumFsiItems : IEnumFsiItems
  3346. {
  3347. }
  3348. [ComImport]
  3349. [Guid("2C941FC6-975B-59BE-A960-9A2A262853A5")]
  3350. [ClassInterface(ClassInterfaceType.None)]
  3351. public class EnumFsiItemsClass
  3352. {
  3353. }
  3354. [ComImport]
  3355. [Guid("2C941FD6-975B-59BE-A960-9A2A262853A5")]
  3356. [CoClass(typeof(EnumProgressItemsClass))]
  3357. public interface EnumProgressItems : IEnumProgressItems
  3358. {
  3359. }
  3360. [ComImport]
  3361. [ClassInterface(ClassInterfaceType.None)]
  3362. [Guid("2C941FCA-975B-59BE-A960-9A2A262853A5")]
  3363. public class EnumProgressItemsClass
  3364. {
  3365. }
  3366. [ComImport]
  3367. [Guid("2C941FD8-975B-59BE-A960-9A2A262853A5")]
  3368. [CoClass(typeof(FileSystemImageResultClass))]
  3369. public interface FileSystemImageResult : IFileSystemImageResult
  3370. {
  3371. }
  3372. [ComImport]
  3373. [Guid("2C941FCC-975B-59BE-A960-9A2A262853A5")]
  3374. [ClassInterface(ClassInterfaceType.None)]
  3375. public class FileSystemImageResultClass
  3376. {
  3377. }
  3378. [ComImport]
  3379. [Guid("F7FB4B9B-6D96-4D7B-9115-201B144811EF")]
  3380. [CoClass(typeof(FsiDirectoryItemClass))]
  3381. public interface FsiDirectoryItem : IFsiDirectoryItem2
  3382. {
  3383. }
  3384. [ComImport]
  3385. [ClassInterface(ClassInterfaceType.None)]
  3386. [Guid("2C941FC8-975B-59BE-A960-9A2A262853A5")]
  3387. public class FsiDirectoryItemClass
  3388. {
  3389. }
  3390. [ComImport]
  3391. [CoClass(typeof(FsiFileItemClass))]
  3392. [Guid("199D0C19-11E1-40EB-8EC2-C8C822A07792")]
  3393. public interface FsiFileItem : IFsiFileItem2
  3394. {
  3395. }
  3396. [ComImport]
  3397. [ClassInterface(ClassInterfaceType.None)]
  3398. [Guid("2C941FC7-975B-59BE-A960-9A2A262853A5")]
  3399. public class FsiFileItemClass
  3400. {
  3401. }
  3402. [ComImport]
  3403. [Guid("ED79BA56-5294-4250-8D46-F9AECEE23459")]
  3404. [CoClass(typeof(FsiNamedStreamsClass))]
  3405. public interface FsiNamedStreams : IFsiNamedStreams
  3406. {
  3407. }
  3408. [ComImport]
  3409. [Guid("C6B6F8ED-6D19-44B4-B539-B159B793A32D")]
  3410. [ClassInterface(ClassInterfaceType.None)]
  3411. public class FsiNamedStreamsClass
  3412. {
  3413. }
  3414. [ComImport]
  3415. [Guid("0000000C-0000-0000-C000-000000000046")]
  3416. [CoClass(typeof(FsiStreamClass))]
  3417. public interface FsiStream : IStream
  3418. {
  3419. }
  3420. [ComImport]
  3421. [ClassInterface(ClassInterfaceType.None)]
  3422. [Guid("2C941FCD-975B-59BE-A960-9A2A262853A5")]
  3423. public class FsiStreamClass
  3424. {
  3425. }
  3426. [ComImport]
  3427. [CoClass(typeof(MsftFileSystemImageClass))]
  3428. [Guid("2C941FE1-975B-59BE-A960-9A2A262853A5")]
  3429. public interface MsftFileSystemImage : IFileSystemImage, DFileSystemImage_Event
  3430. {
  3431. }
  3432. [ComImport]
  3433. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3434. [Guid("2C941FC5-975B-59BE-A960-9A2A262853A5")]
  3435. [ComSourceInterfaces("DFileSystemImageEvents\0DFileSystemImageImportEvents\0")]
  3436. [ClassInterface(ClassInterfaceType.None)]
  3437. public class MsftFileSystemImageClass
  3438. {
  3439. }
  3440. [ComImport]
  3441. [Guid("6CA38BE5-FBBB-4800-95A1-A438865EB0D4")]
  3442. [CoClass(typeof(MsftIsoImageManagerClass))]
  3443. public interface MsftIsoImageManager : IIsoImageManager
  3444. {
  3445. }
  3446. [ComImport]
  3447. [ClassInterface(ClassInterfaceType.None)]
  3448. [Guid("CEEE3B62-8F56-4056-869B-EF16917E3EFC")]
  3449. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3450. public class MsftIsoImageManagerClass
  3451. {
  3452. }
  3453. [ComImport]
  3454. [Guid("2C941FD5-975B-59BE-A960-9A2A262853A5")]
  3455. [CoClass(typeof(ProgressItemClass))]
  3456. public interface ProgressItem : IProgressItem
  3457. {
  3458. }
  3459. [ComImport]
  3460. [Guid("2C941FCB-975B-59BE-A960-9A2A262853A5")]
  3461. [ClassInterface(ClassInterfaceType.None)]
  3462. public class ProgressItemClass
  3463. {
  3464. }
  3465. [ComImport]
  3466. [Guid("2C941FD7-975B-59BE-A960-9A2A262853A5")]
  3467. [CoClass(typeof(ProgressItemsClass))]
  3468. public interface ProgressItems : IProgressItems
  3469. {
  3470. }
  3471. [ComImport]
  3472. [Guid("2C941FC9-975B-59BE-A960-9A2A262853A5")]
  3473. [ClassInterface(ClassInterfaceType.None)]
  3474. public class ProgressItemsClass
  3475. {
  3476. }
  3477. }