Imapi2Interop.cs 132 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192
  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. //防止进一步的添加到文件系统
  1622. [DispId(0x10d)]
  1623. bool ForceMediaToBeClosed { set; get; }
  1624. // Default is to maximize compatibility with DVD-ROM. May be disabled to
  1625. // reduce time to finish writing the disc or increase usable space on the
  1626. // media for later writing.
  1627. [DispId(270)]
  1628. bool DisableConsumerDvdCompatibilityMode { set; get; }
  1629. // Get the current physical media type
  1630. [DispId(0x10f)]
  1631. IMAPI_MEDIA_PHYSICAL_TYPE CurrentPhysicalMediaType { get; }
  1632. // The friendly name of the client (used to determine recorder reservation conflicts)
  1633. [DispId(0x110)]
  1634. string ClientName { set; get; }
  1635. // The last requested write speed
  1636. [DispId(0x111)]
  1637. int RequestedWriteSpeed { get; }
  1638. // The last requested rotation type
  1639. [DispId(0x112)]
  1640. bool RequestedRotationTypeIsPureCAV { get; }
  1641. // The drive's current write speed
  1642. [DispId(0x113)]
  1643. int CurrentWriteSpeed { get; }
  1644. // The drive's current rotation type.
  1645. [DispId(0x114)]
  1646. bool CurrentRotationTypeIsPureCAV { get; }
  1647. // Gets an array of the write speeds supported for the attached disc recorder and current media
  1648. [DispId(0x115)]
  1649. object[] SupportedWriteSpeeds { get; }
  1650. // Gets an array of the detailed write configurations supported for the attached disc recorder
  1651. // and current media
  1652. [DispId(0x116)]
  1653. object[] SupportedWriteSpeedDescriptors { get; }
  1654. // Forces the Datawriter to overwrite the disc on overwritable media types
  1655. [DispId(0x117)]
  1656. bool ForceOverwrite { set; get; }
  1657. // Returns the array of available multi-session interfaces. The array shall not be empty
  1658. [DispId(280)]
  1659. object[] MultisessionInterfaces { get; }
  1660. // Writes all the data provided in the IStream to the device
  1661. [DispId(0x200)]
  1662. void Write(IStream data);
  1663. // Cancels the current write operation
  1664. [DispId(0x201)]
  1665. void CancelWrite();
  1666. //设置连接的光盘刻录机的写入速度(以每秒扇区数为单位)
  1667. // Sets the write speed (in sectors per second) of the attached disc recorder
  1668. [DispId(0x202)]
  1669. void SetWriteSpeed(int RequestedSectorsPerSecond, bool RotationTypeIsPureCAV);
  1670. }
  1671. /// <summary>
  1672. /// Track-at-once Data Writer
  1673. /// </summary>
  1674. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1675. [Guid("2735413D-7F64-5B0F-8F00-5D77AFBE261E")]
  1676. public interface IDiscFormat2DataEventArgs
  1677. {
  1678. //
  1679. // IWriteEngine2EventArgs
  1680. //
  1681. // The starting logical block address for the current write operation.
  1682. [DispId(0x100)]
  1683. int StartLba { get; }
  1684. // The number of sectors being written for the current write operation.
  1685. [DispId(0x101)]
  1686. int SectorCount { get; }
  1687. // The last logical block address of data read for the current write operation.
  1688. [DispId(0x102)]
  1689. int LastReadLba { get; }
  1690. // The last logical block address of data written for the current write operation
  1691. [DispId(0x103)]
  1692. int LastWrittenLba { get; }
  1693. // The total bytes available in the system's cache buffer
  1694. [DispId(0x106)]
  1695. int TotalSystemBuffer { get; }
  1696. // The used bytes in the system's cache buffer
  1697. [DispId(0x107)]
  1698. int UsedSystemBuffer { get; }
  1699. // The free bytes in the system's cache buffer
  1700. [DispId(0x108)]
  1701. int FreeSystemBuffer { get; }
  1702. //
  1703. // IDiscFormat2DataEventArgs
  1704. //
  1705. // The total elapsed time for the current write operation
  1706. [DispId(0x300)]
  1707. int ElapsedTime { get; }
  1708. // The estimated time remaining for the write operation.
  1709. [DispId(0x301)]
  1710. int RemainingTime { get; }
  1711. // The estimated total time for the write operation.
  1712. [DispId(770)]
  1713. int TotalTime { get; }
  1714. // The current write action.
  1715. [DispId(0x303)]
  1716. IMAPI_FORMAT2_DATA_WRITE_ACTION CurrentAction { get; }
  1717. }
  1718. [ComImport, Guid("27354156-8F64-5B0F-8F00-5D77AFBE261E")]
  1719. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1720. public interface IDiscFormat2Erase
  1721. {
  1722. //
  1723. // IDiscFormat2
  1724. //
  1725. // Determines if the recorder object supports the given format
  1726. [DispId(0x800)]
  1727. bool IsRecorderSupported(IDiscRecorder2 Recorder);
  1728. // Determines if the current media in a supported recorder object supports the given format
  1729. [DispId(0x801)]
  1730. bool IsCurrentMediaSupported(IDiscRecorder2 Recorder);
  1731. // Determines if the current media is reported as physically blank by the drive
  1732. [DispId(0x700)]
  1733. bool MediaPhysicallyBlank { get; }
  1734. // Attempts to determine if the media is blank using heuristics (mainly for DVD+RW and DVD-RAM media)
  1735. [DispId(0x701)]
  1736. bool MediaHeuristicallyBlank { get; }
  1737. // Supported media types
  1738. [DispId(0x702)]
  1739. object[] SupportedMediaTypes { get; }
  1740. //
  1741. // IDiscFormat2Erase
  1742. //
  1743. // Sets the recorder object to use for an erase operation
  1744. [DispId(0x100)]
  1745. IDiscRecorder2 Recorder { set; get; }
  1746. //
  1747. [DispId(0x101)]
  1748. bool FullErase { set; get; }
  1749. // Get the current physical media type
  1750. [DispId(0x102)]
  1751. IMAPI_MEDIA_PHYSICAL_TYPE CurrentPhysicalMediaType { get; }
  1752. // The friendly name of the client (used to determine recorder reservation conflicts)
  1753. [DispId(0x103)]
  1754. string ClientName { set; get; }
  1755. // Erases the media in the active disc recorder
  1756. [DispId(0x201)]
  1757. void EraseMedia();
  1758. }
  1759. /// <summary>
  1760. /// CD Disc-At-Once RAW Writer
  1761. /// </summary>
  1762. [ComImport, Guid("27354155-8F64-5B0F-8F00-5D77AFBE261E")]
  1763. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1764. public interface IDiscFormat2RawCD
  1765. {
  1766. //
  1767. // IDiscFormat2
  1768. //
  1769. // Determines if the recorder object supports the given format
  1770. [DispId(0x800)]
  1771. bool IsRecorderSupported(IDiscRecorder2 Recorder);
  1772. // Determines if the current media in a supported recorder object supports the given format
  1773. [DispId(0x801)]
  1774. bool IsCurrentMediaSupported(IDiscRecorder2 Recorder);
  1775. // Determines if the current media is reported as physically blank by the drive
  1776. [DispId(0x700)]
  1777. bool MediaPhysicallyBlank { get; }
  1778. // Attempts to determine if the media is blank using heuristics (mainly for DVD+RW and DVD-RAM media)
  1779. [DispId(0x701)]
  1780. bool MediaHeuristicallyBlank { get; }
  1781. // Supported media types
  1782. [DispId(0x702)]
  1783. object[] SupportedMediaTypes { get; }
  1784. //
  1785. // IDiscFormat2RawCD
  1786. //
  1787. // Locks the current media for use by this writer
  1788. [DispId(0x200)]
  1789. void PrepareMedia();
  1790. // Writes a RAW image that starts at 95:00:00 (MSF) to the currently inserted blank CD media
  1791. [DispId(0x201)]
  1792. void WriteMedia(IStream data);
  1793. // Writes a RAW image to the currently inserted blank CD media. A stream starting at 95:00:00
  1794. // (-5 minutes) would use 5*60*75 + 150 sectors pregap == 22,650 for the number of sectors
  1795. [DispId(0x202)]
  1796. void WriteMedia2(IStream data, int streamLeadInSectors);
  1797. // Cancels the current write.
  1798. [DispId(0x203)]
  1799. void CancelWrite();
  1800. // Finishes use of the locked media.
  1801. [DispId(0x204)]
  1802. void ReleaseMedia();
  1803. // Sets the write speed (in sectors per second) of the attached disc recorder
  1804. [DispId(0x205)]
  1805. void SetWriteSpeed(int RequestedSectorsPerSecond, bool RotationTypeIsPureCAV);
  1806. // The disc recorder to use
  1807. [DispId(0x100)]
  1808. IDiscRecorder2 Recorder { set; get; }
  1809. // Buffer Underrun Free recording should be disabled
  1810. [DispId(0x102)]
  1811. bool BufferUnderrunFreeDisabled { set; get; }
  1812. // The first sector of the next session. May be negative for blank media
  1813. [DispId(0x103)]
  1814. int StartOfNextSession { get; }
  1815. // The last possible start for the leadout area. Can be used to
  1816. // calculate available space on media
  1817. [DispId(260)]
  1818. int LastPossibleStartOfLeadout { get; }
  1819. // Get the current physical media type
  1820. [DispId(0x105)]
  1821. IMAPI_MEDIA_PHYSICAL_TYPE CurrentPhysicalMediaType { get; }
  1822. // Supported data sector types for the current recorder
  1823. [DispId(0x108)]
  1824. object[] SupportedSectorTypes { get; }
  1825. // Requested data sector to use during write of the stream
  1826. [DispId(0x109)]
  1827. IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE RequestedSectorType { set; get; }
  1828. // The friendly name of the client (used to determine recorder reservation conflicts).
  1829. [DispId(0x10a)]
  1830. string ClientName { set; get; }
  1831. // The last requested write speed
  1832. [DispId(0x10b)]
  1833. int RequestedWriteSpeed { get; }
  1834. // The last requested rotation type.
  1835. [DispId(0x10c)]
  1836. bool RequestedRotationTypeIsPureCAV { get; }
  1837. // The drive's current write speed.
  1838. [DispId(0x10d)]
  1839. int CurrentWriteSpeed { get; }
  1840. // The drive's current rotation type
  1841. [DispId(270)]
  1842. bool CurrentRotationTypeIsPureCAV { get; }
  1843. // Gets an array of the write speeds supported for the attached disc
  1844. // recorder and current media
  1845. [DispId(0x10f)]
  1846. object[] SupportedWriteSpeeds { get; }
  1847. // Gets an array of the detailed write configurations supported for the
  1848. // attached disc recorder and current media
  1849. [DispId(0x110)]
  1850. object[] SupportedWriteSpeedDescriptors { get; }
  1851. }
  1852. /// <summary>
  1853. /// CD Disc-At-Once RAW Writer Event Arguments
  1854. /// </summary>
  1855. [ComImport, Guid("27354143-7F64-5B0F-8F00-5D77AFBE261E"), TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1856. public interface IDiscFormat2RawCDEventArgs
  1857. {
  1858. //
  1859. // IWriteEngine2EventArgs
  1860. //
  1861. // The starting logical block address for the current write operation.
  1862. [DispId(0x100)]
  1863. int StartLba { get; }
  1864. // The number of sectors being written for the current write operation.
  1865. [DispId(0x101)]
  1866. int SectorCount { get; }
  1867. // The last logical block address of data read for the current write operation.
  1868. [DispId(0x102)]
  1869. int LastReadLba { get; }
  1870. // The last logical block address of data written for the current write operation
  1871. [DispId(0x103)]
  1872. int LastWrittenLba { get; }
  1873. // The total bytes available in the system's cache buffer
  1874. [DispId(0x106)]
  1875. int TotalSystemBuffer { get; }
  1876. // The used bytes in the system's cache buffer
  1877. [DispId(0x107)]
  1878. int UsedSystemBuffer { get; }
  1879. // The free bytes in the system's cache buffer
  1880. [DispId(0x108)]
  1881. int FreeSystemBuffer { get; }
  1882. //
  1883. // IDiscFormat2RawCDEventArgs
  1884. //
  1885. // The current write action
  1886. [DispId(0x301)]
  1887. IMAPI_FORMAT2_RAW_CD_WRITE_ACTION CurrentAction { get; }
  1888. // The elapsed time for the current track write or media finishing operation
  1889. [DispId(770)]
  1890. int ElapsedTime { get; }
  1891. // The estimated time remaining for the current track write or media finishing operation
  1892. [DispId(0x303)]
  1893. int RemainingTime { get; }
  1894. }
  1895. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1896. [ComImport]
  1897. [Guid("27354154-8F64-5B0F-8F00-5D77AFBE261E")]
  1898. public interface IDiscFormat2TrackAtOnce
  1899. {
  1900. //
  1901. // IDiscFormat2
  1902. //
  1903. // Determines if the recorder object supports the given format
  1904. [DispId(0x800)]
  1905. bool IsRecorderSupported(IDiscRecorder2 Recorder);
  1906. // Determines if the current media in a supported recorder object supports the given format
  1907. [DispId(0x801)]
  1908. bool IsCurrentMediaSupported(IDiscRecorder2 Recorder);
  1909. // Determines if the current media is reported as physically blank by the drive
  1910. [DispId(0x700)]
  1911. bool MediaPhysicallyBlank { get; }
  1912. // Attempts to determine if the media is blank using heuristics (mainly for DVD+RW and DVD-RAM media)
  1913. [DispId(0x701)]
  1914. bool MediaHeuristicallyBlank { get; }
  1915. // Supported media types
  1916. [DispId(0x702)]
  1917. object[] SupportedMediaTypes { get; }
  1918. //
  1919. // IDiscFormat2TrackAtOnce
  1920. //
  1921. // Locks the current media for use by this writer.
  1922. [DispId(0x200)]
  1923. void PrepareMedia();
  1924. // Immediately writes a new audio track to the locked media
  1925. [DispId(0x201)]
  1926. void AddAudioTrack(IStream data);
  1927. // Cancels the current addition of a track
  1928. [DispId(0x202)]
  1929. void CancelAddTrack();
  1930. // Finishes use of the locked media
  1931. [DispId(0x203)]
  1932. void ReleaseMedia();
  1933. // Sets the write speed (in sectors per second) of the attached disc recorder
  1934. [DispId(0x204)]
  1935. void SetWriteSpeed(int RequestedSectorsPerSecond, bool RotationTypeIsPureCAV);
  1936. // The disc recorder to use
  1937. [DispId(0x100)]
  1938. IDiscRecorder2 Recorder { set; get; }
  1939. // Buffer Underrun Free recording should be disabled
  1940. [DispId(0x102)]
  1941. bool BufferUnderrunFreeDisabled { set; get; }
  1942. // Number of tracks already written to the locked media
  1943. [DispId(0x103)]
  1944. int NumberOfExistingTracks { get; }
  1945. // Total sectors available on locked media if writing one continuous audio track
  1946. [DispId(260)]
  1947. int TotalSectorsOnMedia { get; }
  1948. // Number of sectors available for adding a new track to the media
  1949. [DispId(0x105)]
  1950. int FreeSectorsOnMedia { get; }
  1951. // Number of sectors used on the locked media, including overhead (space between tracks)
  1952. [DispId(0x106)]
  1953. int UsedSectorsOnMedia { get; }
  1954. // Set the media to be left 'open' after writing, to allow multisession discs
  1955. [DispId(0x107)]
  1956. bool DoNotFinalizeMedia { set; get; }
  1957. // Get the current physical media type
  1958. [DispId(0x10a)]
  1959. object[] ExpectedTableOfContents { get; }
  1960. // Get the current physical media type
  1961. [DispId(0x10b)]
  1962. IMAPI_MEDIA_PHYSICAL_TYPE CurrentPhysicalMediaType { get; }
  1963. // The friendly name of the client (used to determine recorder reservation conflicts)
  1964. [DispId(270)]
  1965. string ClientName { set; get; }
  1966. // The last requested write speed
  1967. [DispId(0x10f)]
  1968. int RequestedWriteSpeed { get; }
  1969. // The last requested rotation type.
  1970. [DispId(0x110)]
  1971. bool RequestedRotationTypeIsPureCAV { get; }
  1972. // The drive's current write speed.
  1973. [DispId(0x111)]
  1974. int CurrentWriteSpeed { get; }
  1975. // The drive's current rotation type.
  1976. [DispId(0x112)]
  1977. bool CurrentRotationTypeIsPureCAV { get; }
  1978. // Gets an array of the write speeds supported for the attached disc recorder and current media
  1979. [DispId(0x113)]
  1980. object[] SupportedWriteSpeeds { get; }
  1981. // Gets an array of the detailed write configurations supported for the attached disc recorder and current media
  1982. [DispId(0x114)]
  1983. object[] SupportedWriteSpeedDescriptors { get; }
  1984. }
  1985. /// <summary>
  1986. /// CD Track-at-once Audio Writer Event Arguments
  1987. /// </summary>
  1988. [ComImport]
  1989. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  1990. [Guid("27354140-7F64-5B0F-8F00-5D77AFBE261E")]
  1991. public interface IDiscFormat2TrackAtOnceEventArgs
  1992. {
  1993. //
  1994. // IWriteEngine2EventArgs
  1995. //
  1996. // The starting logical block address for the current write operation.
  1997. [DispId(0x100)]
  1998. int StartLba { get; }
  1999. // The number of sectors being written for the current write operation.
  2000. [DispId(0x101)]
  2001. int SectorCount { get; }
  2002. // The last logical block address of data read for the current write operation.
  2003. [DispId(0x102)]
  2004. int LastReadLba { get; }
  2005. // The last logical block address of data written for the current write operation
  2006. [DispId(0x103)]
  2007. int LastWrittenLba { get; }
  2008. // The total bytes available in the system's cache buffer
  2009. [DispId(0x106)]
  2010. int TotalSystemBuffer { get; }
  2011. // The used bytes in the system's cache buffer
  2012. [DispId(0x107)]
  2013. int UsedSystemBuffer { get; }
  2014. // The free bytes in the system's cache buffer
  2015. [DispId(0x108)]
  2016. int FreeSystemBuffer { get; }
  2017. //
  2018. // IDiscFormat2TrackAtOnceEventArgs
  2019. //
  2020. // The total elapsed time for the current write operation
  2021. [DispId(0x300)]
  2022. int CurrentTrackNumber { get; }
  2023. // The current write action
  2024. [DispId(0x301)]
  2025. IMAPI_FORMAT2_TAO_WRITE_ACTION CurrentAction { get; }
  2026. // The elapsed time for the current track write or media finishing operation
  2027. [DispId(770)]
  2028. int ElapsedTime { get; }
  2029. // The estimated time remaining for the current track write or media finishing operation
  2030. [DispId(0x303)]
  2031. int RemainingTime { get; }
  2032. }
  2033. /// <summary>
  2034. /// IDiscMaster2 is used to get an enumerator for the set of CD/DVD (optical) devices on the system
  2035. /// </summary>
  2036. [ComImport]
  2037. [Guid("27354130-7F64-5B0F-8F00-5D77AFBE261E")]
  2038. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2039. public interface IDiscMaster2
  2040. {
  2041. // Enumerates the list of CD/DVD devices on the system (VT_BSTR)
  2042. [DispId(-4), TypeLibFunc((short)0x41)]
  2043. IEnumerator GetEnumerator();
  2044. // Gets a single recorder's ID (ZERO BASED INDEX)
  2045. [DispId(0)]
  2046. string this[int index] { get; }
  2047. // The current number of recorders in the system.
  2048. [DispId(1)]
  2049. int Count { get; }
  2050. // Whether IMAPI is running in an environment with optical devices and permission to access them.
  2051. [DispId(2)]
  2052. bool IsSupportedEnvironment { get; }
  2053. }
  2054. /// <summary>
  2055. /// Represents a single CD/DVD type device, and enables many common operations via a simplified API.
  2056. /// </summary>
  2057. [ComImport]
  2058. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2059. [Guid("27354133-7F64-5B0F-8F00-5D77AFBE261E")]
  2060. public interface IDiscRecorder2
  2061. {
  2062. // Ejects the media (if any) and opens the tray
  2063. [DispId(0x100)]
  2064. void EjectMedia();
  2065. // Close the media tray and load any media in the tray.
  2066. [DispId(0x101)]
  2067. void CloseTray();
  2068. // Acquires exclusive access to device. May be called multiple times.
  2069. [DispId(0x102)]
  2070. void AcquireExclusiveAccess(bool force, string clientName);
  2071. // Releases exclusive access to device. Call once per AcquireExclusiveAccess().
  2072. [DispId(0x103)]
  2073. void ReleaseExclusiveAccess();
  2074. // Disables Media Change Notification (MCN).
  2075. [DispId(260)]
  2076. void DisableMcn();
  2077. // Re-enables Media Change Notification after a call to DisableMcn()
  2078. [DispId(0x105)]
  2079. void EnableMcn();
  2080. // Initialize the recorder, opening a handle to the specified recorder.
  2081. [DispId(0x106)]
  2082. void InitializeDiscRecorder(string recorderUniqueId);
  2083. // The unique ID used to initialize the recorder.
  2084. // 唯一ID用于初始化记录器
  2085. [DispId(0)]
  2086. string ActiveDiscRecorder { get; }
  2087. // The vendor ID in the device's INQUIRY data.
  2088. [DispId(0x201)]
  2089. string VendorId { get; }
  2090. // The Product ID in the device's INQUIRY data.
  2091. [DispId(0x202)]
  2092. string ProductId { get; }
  2093. // The Product Revision in the device's INQUIRY data.
  2094. [DispId(0x203)]
  2095. string ProductRevision { get; }
  2096. // Get the unique volume name (this is not a drive letter).
  2097. [DispId(0x204)]
  2098. string VolumeName { get; }
  2099. // Drive letters and NTFS mount points to access the recorder.
  2100. [DispId(0x205)]
  2101. object[] VolumePathNames { [DispId(0x205)] get; }
  2102. // One of the volume names associated with the recorder.
  2103. [DispId(0x206)]
  2104. bool DeviceCanLoadMedia { [DispId(0x206)] get; }
  2105. // Gets the legacy 'device number' associated with the recorder. This number is not guaranteed to be static.
  2106. [DispId(0x207)]
  2107. int LegacyDeviceNumber { [DispId(0x207)] get; }
  2108. // Gets a list of all feature pages supported by the device
  2109. [DispId(520)]
  2110. object[] SupportedFeaturePages { [DispId(520)] get; }
  2111. // Gets a list of all feature pages with 'current' bit set to true
  2112. [DispId(0x209)]
  2113. object[] CurrentFeaturePages { [DispId(0x209)] get; }
  2114. // Gets a list of all profiles supported by the device
  2115. [DispId(0x20a)]
  2116. object[] SupportedProfiles { [DispId(0x20a)] get; }
  2117. // Gets a list of all profiles with 'currentP' bit set to true
  2118. [DispId(0x20b)]
  2119. object[] CurrentProfiles { [DispId(0x20b)] get; }
  2120. // Gets a list of all MODE PAGES supported by the device
  2121. [DispId(0x20c)]
  2122. object[] SupportedModePages { [DispId(0x20c)] get; }
  2123. // Queries the device to determine who, if anyone, has acquired exclusive access
  2124. [DispId(0x20d)]
  2125. string ExclusiveAccessOwner { [DispId(0x20d)] get; }
  2126. }
  2127. /// <summary>
  2128. /// Represents a single CD/DVD type device, enabling additional commands requiring advanced marshalling code
  2129. /// </summary>
  2130. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  2131. [Guid("27354132-7F64-5B0F-8F00-5D77AFBE261E")]
  2132. public interface IDiscRecorder2Ex
  2133. {
  2134. //
  2135. // Send a command to the device that does not transfer any data
  2136. //
  2137. void SendCommandNoData(
  2138. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)]
  2139. byte[] Cdb,
  2140. uint CdbSize,
  2141. [MarshalAs(UnmanagedType.LPArray, SizeConst = 18)]
  2142. byte[] SenseBuffer,
  2143. uint Timeout);
  2144. // Send a command to the device that requires data sent to the device
  2145. void SendCommandSendDataToDevice(
  2146. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)]
  2147. byte[] Cdb,
  2148. uint CdbSize,
  2149. [MarshalAs(UnmanagedType.LPArray, SizeConst = 18)]
  2150. byte[] SenseBuffer,
  2151. uint Timeout,
  2152. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 5)]
  2153. byte[] Buffer,
  2154. uint BufferSize);
  2155. // Send a command to the device that requests data from the device
  2156. void SendCommandGetDataFromDevice(
  2157. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)]
  2158. byte[] Cdb,
  2159. uint CdbSize,
  2160. [MarshalAs(UnmanagedType.LPArray, SizeConst = 18)]
  2161. byte[] SenseBuffer,
  2162. uint Timeout,
  2163. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 5)]
  2164. byte[] Buffer,
  2165. uint BufferSize,
  2166. out uint BufferFetched);
  2167. // Read a DVD Structure from the media
  2168. void ReadDvdStructure(uint format, uint address, uint layer, uint agid, out IntPtr data, out uint Count);
  2169. // Sends a DVD structure to the media
  2170. void SendDvdStructure(uint format,
  2171. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)]
  2172. byte[] data,
  2173. uint Count);
  2174. // Get the full adapter descriptor (via IOCTL_STORAGE_QUERY_PROPERTY).
  2175. void GetAdapterDescriptor(out IntPtr data, ref uint byteSize);
  2176. // Get the full device descriptor (via IOCTL_STORAGE_QUERY_PROPERTY).
  2177. void GetDeviceDescriptor(out IntPtr data, ref uint byteSize);
  2178. // Gets data from a READ_DISC_INFORMATION command
  2179. void GetDiscInformation(out IntPtr discInformation, ref uint byteSize);
  2180. // Gets data from a READ_TRACK_INFORMATION command
  2181. void GetTrackInformation(uint address, IMAPI_READ_TRACK_ADDRESS_TYPE addressType, out IntPtr trackInformation, ref uint byteSize);
  2182. // Gets a feature's data from a GET_CONFIGURATION command
  2183. void GetFeaturePage(IMAPI_FEATURE_PAGE_TYPE requestedFeature, sbyte currentFeatureOnly, out IntPtr featureData, ref uint byteSize);
  2184. // Gets data from a MODE_SENSE10 command
  2185. void GetModePage(IMAPI_MODE_PAGE_TYPE requestedModePage, IMAPI_MODE_PAGE_REQUEST_TYPE requestType, out IntPtr modePageData, ref uint byteSize);
  2186. // Sets mode page data using MODE_SELECT10 command
  2187. void SetModePage(IMAPI_MODE_PAGE_REQUEST_TYPE requestType,
  2188. [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)]
  2189. byte[] data,
  2190. uint byteSize);
  2191. // Gets a list of all feature pages supported by the device
  2192. void GetSupportedFeaturePages(sbyte currentFeatureOnly, out IntPtr featureData, ref uint byteSize);
  2193. // Gets a list of all PROFILES supported by the device
  2194. void GetSupportedProfiles(sbyte currentOnly, out IntPtr profileTypes, out uint validProfiles);
  2195. // Gets a list of all MODE PAGES supported by the device
  2196. void GetSupportedModePages(IMAPI_MODE_PAGE_REQUEST_TYPE requestType, out IntPtr modePageTypes, out uint validPages);
  2197. // The byte alignment requirement mask for this device.
  2198. uint GetByteAlignmentMask();
  2199. // The maximum non-page-aligned transfer size for this device.
  2200. uint GetMaximumNonPageAlignedTransferSize();
  2201. // The maximum non-page-aligned transfer size for this device.
  2202. uint GetMaximumPageAlignedTransferSize();
  2203. }
  2204. /// <summary>
  2205. /// FileSystemImage item enumerator
  2206. /// </summary>
  2207. [Guid("2C941FDA-975B-59BE-A960-9A2A262853A5")]
  2208. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  2209. public interface IEnumFsiItems
  2210. {
  2211. // Note: not listed in COM Interface, but it is in Interop.cs
  2212. void Next(uint celt, out IFsiItem rgelt, out uint pceltFetched);
  2213. // Remoting support for Next (allow NULL pointer for item count when requesting single item)
  2214. void RemoteNext(uint celt, out IFsiItem rgelt, out uint pceltFetched);
  2215. // Skip items in the enumeration
  2216. void Skip(uint celt);
  2217. // Reset the enumerator
  2218. void Reset();
  2219. // Make a copy of the enumerator
  2220. void Clone(out IEnumFsiItems ppEnum);
  2221. }
  2222. /// <summary>
  2223. /// FileSystemImageResult progress item enumerator
  2224. /// </summary>
  2225. [Guid("2C941FD6-975B-59BE-A960-9A2A262853A5")]
  2226. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  2227. public interface IEnumProgressItems
  2228. {
  2229. // Not in COM, but is in Interop.cs
  2230. void Next(uint celt, out IProgressItem rgelt, out uint pceltFetched);
  2231. // Remoting support for Next (allow NULL pointer for item count when requesting single item)
  2232. void RemoteNext(uint celt, out IProgressItem rgelt, out uint pceltFetched);
  2233. // Skip items in the enumeration
  2234. void Skip(uint celt);
  2235. // Reset the enumerator
  2236. void Reset();
  2237. // Make a copy of the enumerator
  2238. void Clone(out IEnumProgressItems ppEnum);
  2239. }
  2240. /// <summary>
  2241. /// File system image
  2242. /// </summary>
  2243. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2244. [Guid("2C941FE1-975B-59BE-A960-9A2A262853A5")]
  2245. public interface IFileSystemImage
  2246. {
  2247. // Root directory item
  2248. [DispId(0)]
  2249. IFsiDirectoryItem Root { get; }
  2250. // Disc start block for the image
  2251. [DispId(1)]
  2252. int SessionStartBlock { get; set; }
  2253. // Maximum number of blocks available for the image
  2254. [DispId(2)]
  2255. int FreeMediaBlocks { get; set; }
  2256. // Set maximum number of blocks available based on the recorder
  2257. // supported discs. 0 for unknown maximum may be set.
  2258. [DispId(0x24)]
  2259. void SetMaxMediaBlocksFromDevice(IDiscRecorder2 discRecorder);
  2260. // Number of blocks in use
  2261. [DispId(3)]
  2262. int UsedBlocks { get; }
  2263. // Volume name
  2264. [DispId(4)]
  2265. string VolumeName { get; set; }
  2266. // Imported Volume name
  2267. [DispId(5)]
  2268. string ImportedVolumeName { get; }
  2269. // Boot image and boot options
  2270. [DispId(6)]
  2271. IBootOptions BootImageOptions { get; set; }
  2272. // Number of files in the image
  2273. [DispId(7)]
  2274. int FileCount { get; }
  2275. // Number of directories in the image
  2276. [DispId(8)]
  2277. int DirectoryCount { get; }
  2278. // Temp directory for stash files
  2279. [DispId(9)]
  2280. string WorkingDirectory { get; set; }
  2281. // Change point identifier
  2282. [DispId(10)]
  2283. int ChangePoint { get; }
  2284. // Strict file system compliance option
  2285. [DispId(11)]
  2286. bool StrictFileSystemCompliance { get; set; }
  2287. // If true, indicates restricted character set is being used for file and directory names
  2288. [DispId(12)]
  2289. bool UseRestrictedCharacterSet { get; set; }
  2290. // File systems to create
  2291. [DispId(13)]
  2292. FsiFileSystems FileSystemsToCreate { get; set; }
  2293. // File systems supported
  2294. [DispId(14)]
  2295. FsiFileSystems FileSystemsSupported { get; }
  2296. // UDF revision
  2297. [DispId(0x25)]
  2298. int UDFRevision { set; get; }
  2299. // UDF revision(s) supported
  2300. [DispId(0x1f)]
  2301. object[] UDFRevisionsSupported { get; }
  2302. // Select filesystem types and image size based on the current media
  2303. [DispId(0x20)]
  2304. void ChooseImageDefaults(IDiscRecorder2 discRecorder);
  2305. // Select filesystem types and image size based on the media type
  2306. [DispId(0x21)]
  2307. void ChooseImageDefaultsForMediaType(IMAPI_MEDIA_PHYSICAL_TYPE value);
  2308. // ISO compatibility level to create
  2309. [DispId(0x22)]
  2310. int ISO9660InterchangeLevel { set; get; }
  2311. // ISO compatibility level(s) supported
  2312. [DispId(0x26)]
  2313. object[] ISO9660InterchangeLevelsSupported { get; }
  2314. // Create result image stream
  2315. [DispId(15)]
  2316. IFileSystemImageResult CreateResultImage();
  2317. // Check for existance an item in the file system
  2318. [DispId(0x10)]
  2319. FsiItemType Exists(string FullPath);
  2320. // Return a string useful for identifying the current disc
  2321. [DispId(0x12)]
  2322. string CalculateDiscIdentifier();
  2323. // Identify file systems on a given disc
  2324. [DispId(0x13)]
  2325. FsiFileSystems IdentifyFileSystemsOnDisc(IDiscRecorder2 discRecorder);
  2326. // Identify which of the specified file systems would be imported by default
  2327. [DispId(20)]
  2328. FsiFileSystems GetDefaultFileSystemForImport(FsiFileSystems fileSystems);
  2329. // Import the default file system on the current disc
  2330. [DispId(0x15)]
  2331. FsiFileSystems ImportFileSystem();
  2332. // Import a specific file system on the current disc
  2333. [DispId(0x16)]
  2334. void ImportSpecificFileSystem(FsiFileSystems fileSystemToUse);
  2335. // Roll back to the specified change point
  2336. [DispId(0x17)]
  2337. void RollbackToChangePoint(int ChangePoint);
  2338. // Lock in changes
  2339. [DispId(0x18)]
  2340. void LockInChangePoint();
  2341. // Create a directory item with the specified name
  2342. [DispId(0x19)]
  2343. IFsiDirectoryItem CreateDirectoryItem(string Name);
  2344. // Create a file item with the specified name
  2345. [DispId(0x1a)]
  2346. IFsiFileItem CreateFileItem(string Name);
  2347. // Volume Name UDF
  2348. [DispId(0x1b)]
  2349. string VolumeNameUDF { get; }
  2350. // Volume name Joliet
  2351. [DispId(0x1c)]
  2352. string VolumeNameJoliet { get; }
  2353. // Volume name ISO 9660
  2354. [DispId(0x1d)]
  2355. string VolumeNameISO9660 { get; }
  2356. // Indicates whether or not IMAPI should stage the filesystem before the burn
  2357. [DispId(30)]
  2358. bool StageFiles { get; set; }
  2359. // Get array of available multi-session interfaces.
  2360. [DispId(40)]
  2361. object[] MultisessionInterfaces { get; set; }
  2362. }
  2363. /// <summary>
  2364. /// File system image (rev.2)
  2365. /// </summary>
  2366. [ComImport]
  2367. [Guid("D7644B2C-1537-4767-B62F-F1387B02DDFD")]
  2368. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2369. public interface IFileSystemImage2
  2370. {
  2371. //
  2372. // IFileSystemImage
  2373. //
  2374. // Root directory item
  2375. [DispId(0)]
  2376. IFsiDirectoryItem Root { get; }
  2377. // Disc start block for the image
  2378. [DispId(1)]
  2379. int SessionStartBlock { get; set; }
  2380. // Maximum number of blocks available for the image
  2381. [DispId(2)]
  2382. int FreeMediaBlocks { get; set; }
  2383. // Set maximum number of blocks available based on the recorder
  2384. // supported discs. 0 for unknown maximum may be set.
  2385. [DispId(0x24)]
  2386. void SetMaxMediaBlocksFromDevice(IDiscRecorder2 discRecorder);
  2387. // Number of blocks in use
  2388. [DispId(3)]
  2389. int UsedBlocks { get; }
  2390. // Volume name
  2391. [DispId(4)]
  2392. string VolumeName { get; set; }
  2393. // Imported Volume name
  2394. [DispId(5)]
  2395. string ImportedVolumeName { get; }
  2396. // Boot image and boot options
  2397. [DispId(6)]
  2398. IBootOptions BootImageOptions { get; set; }
  2399. // Number of files in the image
  2400. [DispId(7)]
  2401. int FileCount { get; }
  2402. // Number of directories in the image
  2403. [DispId(8)]
  2404. int DirectoryCount { get; }
  2405. // Temp directory for stash files
  2406. [DispId(9)]
  2407. string WorkingDirectory { get; set; }
  2408. // Change point identifier
  2409. [DispId(10)]
  2410. int ChangePoint { get; }
  2411. // Strict file system compliance option
  2412. [DispId(11)]
  2413. bool StrictFileSystemCompliance { get; set; }
  2414. // If true, indicates restricted character set is being used for file and directory names
  2415. [DispId(12)]
  2416. bool UseRestrictedCharacterSet { get; set; }
  2417. // File systems to create
  2418. [DispId(13)]
  2419. FsiFileSystems FileSystemsToCreate { get; set; }
  2420. // File systems supported
  2421. [DispId(14)]
  2422. FsiFileSystems FileSystemsSupported { get; }
  2423. // UDF revision
  2424. [DispId(0x25)]
  2425. int UDFRevision { set; get; }
  2426. // UDF revision(s) supported
  2427. [DispId(0x1f)]
  2428. object[] UDFRevisionsSupported { get; }
  2429. // Select filesystem types and image size based on the current media
  2430. [DispId(0x20)]
  2431. void ChooseImageDefaults(IDiscRecorder2 discRecorder);
  2432. // Select filesystem types and image size based on the media type
  2433. [DispId(0x21)]
  2434. void ChooseImageDefaultsForMediaType(IMAPI_MEDIA_PHYSICAL_TYPE value);
  2435. // ISO compatibility level to create
  2436. [DispId(0x22)]
  2437. int ISO9660InterchangeLevel { set; get; }
  2438. // ISO compatibility level(s) supported
  2439. [DispId(0x26)]
  2440. object[] ISO9660InterchangeLevelsSupported { get; }
  2441. // Create result image stream
  2442. [DispId(15)]
  2443. IFileSystemImageResult CreateResultImage();
  2444. // Check for existance an item in the file system
  2445. [DispId(0x10)]
  2446. FsiItemType Exists(string FullPath);
  2447. // Return a string useful for identifying the current disc
  2448. [DispId(0x12)]
  2449. string CalculateDiscIdentifier();
  2450. // Identify file systems on a given disc
  2451. [DispId(0x13)]
  2452. FsiFileSystems IdentifyFileSystemsOnDisc(IDiscRecorder2 discRecorder);
  2453. // Identify which of the specified file systems would be imported by default
  2454. [DispId(20)]
  2455. FsiFileSystems GetDefaultFileSystemForImport(FsiFileSystems fileSystems);
  2456. // Import the default file system on the current disc
  2457. [DispId(0x15)]
  2458. FsiFileSystems ImportFileSystem();
  2459. // Import a specific file system on the current disc
  2460. [DispId(0x16)]
  2461. void ImportSpecificFileSystem(FsiFileSystems fileSystemToUse);
  2462. // Roll back to the specified change point
  2463. [DispId(0x17)]
  2464. void RollbackToChangePoint(int ChangePoint);
  2465. // Lock in changes
  2466. [DispId(0x18)]
  2467. void LockInChangePoint();
  2468. // Create a directory item with the specified name
  2469. [DispId(0x19)]
  2470. IFsiDirectoryItem CreateDirectoryItem(string Name);
  2471. // Create a file item with the specified name
  2472. [DispId(0x1a)]
  2473. IFsiFileItem CreateFileItem(string Name);
  2474. // Volume Name UDF
  2475. [DispId(0x1b)]
  2476. string VolumeNameUDF { get; }
  2477. // Volume name Joliet
  2478. [DispId(0x1c)]
  2479. string VolumeNameJoliet { get; }
  2480. // Volume name ISO 9660
  2481. [DispId(0x1d)]
  2482. string VolumeNameISO9660 { get; }
  2483. // Indicates whether or not IMAPI should stage the filesystem before the burn
  2484. [DispId(30)]
  2485. bool StageFiles { get; set; }
  2486. // Get array of available multi-session interfaces.
  2487. [DispId(40)]
  2488. object[] MultisessionInterfaces { get; set; }
  2489. //
  2490. // IFileSystemImage2
  2491. //
  2492. // Get boot options array for supporting multi-boot
  2493. [DispId(60)]
  2494. object[] BootImageOptionsArray { get; set; }
  2495. }
  2496. /// <summary>
  2497. /// File system image (rev.3)"),
  2498. /// </summary>
  2499. [ComImport]
  2500. [Guid("7CFF842C-7E97-4807-8304-910DD8F7C051")]
  2501. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2502. public interface IFileSystemImage3
  2503. {
  2504. //
  2505. // IFileSystemImage
  2506. //
  2507. // Root directory item
  2508. [DispId(0)]
  2509. IFsiDirectoryItem Root { get; }
  2510. // Disc start block for the image
  2511. [DispId(1)]
  2512. int SessionStartBlock { get; set; }
  2513. // Maximum number of blocks available for the image
  2514. [DispId(2)]
  2515. int FreeMediaBlocks { get; set; }
  2516. // Set maximum number of blocks available based on the recorder
  2517. // supported discs. 0 for unknown maximum may be set.
  2518. [DispId(0x24)]
  2519. void SetMaxMediaBlocksFromDevice(IDiscRecorder2 discRecorder);
  2520. // Number of blocks in use
  2521. [DispId(3)]
  2522. int UsedBlocks { get; }
  2523. // Volume name
  2524. [DispId(4)]
  2525. string VolumeName { get; set; }
  2526. // Imported Volume name
  2527. [DispId(5)]
  2528. string ImportedVolumeName { get; }
  2529. // Boot image and boot options
  2530. [DispId(6)]
  2531. IBootOptions BootImageOptions { get; set; }
  2532. // Number of files in the image
  2533. [DispId(7)]
  2534. int FileCount { get; }
  2535. // Number of directories in the image
  2536. [DispId(8)]
  2537. int DirectoryCount { get; }
  2538. // Temp directory for stash files
  2539. [DispId(9)]
  2540. string WorkingDirectory { get; set; }
  2541. // Change point identifier
  2542. [DispId(10)]
  2543. int ChangePoint { get; }
  2544. // Strict file system compliance option
  2545. [DispId(11)]
  2546. bool StrictFileSystemCompliance { get; set; }
  2547. // If true, indicates restricted character set is being used for file and directory names
  2548. [DispId(12)]
  2549. bool UseRestrictedCharacterSet { get; set; }
  2550. // File systems to create
  2551. [DispId(13)]
  2552. FsiFileSystems FileSystemsToCreate { get; set; }
  2553. // File systems supported
  2554. [DispId(14)]
  2555. FsiFileSystems FileSystemsSupported { get; }
  2556. // UDF revision
  2557. [DispId(0x25)]
  2558. int UDFRevision { set; get; }
  2559. // UDF revision(s) supported
  2560. [DispId(0x1f)]
  2561. object[] UDFRevisionsSupported { get; }
  2562. // Select filesystem types and image size based on the current media
  2563. [DispId(0x20)]
  2564. void ChooseImageDefaults(IDiscRecorder2 discRecorder);
  2565. // Select filesystem types and image size based on the media type
  2566. [DispId(0x21)]
  2567. void ChooseImageDefaultsForMediaType(IMAPI_MEDIA_PHYSICAL_TYPE value);
  2568. // ISO compatibility level to create
  2569. [DispId(0x22)]
  2570. int ISO9660InterchangeLevel { set; get; }
  2571. // ISO compatibility level(s) supported
  2572. [DispId(0x26)]
  2573. object[] ISO9660InterchangeLevelsSupported { get; }
  2574. // Create result image stream
  2575. [DispId(15)]
  2576. IFileSystemImageResult CreateResultImage();
  2577. // Check for existance an item in the file system
  2578. [DispId(0x10)]
  2579. FsiItemType Exists(string FullPath);
  2580. // Return a string useful for identifying the current disc
  2581. [DispId(0x12)]
  2582. string CalculateDiscIdentifier();
  2583. // Identify file systems on a given disc
  2584. [DispId(0x13)]
  2585. FsiFileSystems IdentifyFileSystemsOnDisc(IDiscRecorder2 discRecorder);
  2586. // Identify which of the specified file systems would be imported by default
  2587. [DispId(20)]
  2588. FsiFileSystems GetDefaultFileSystemForImport(FsiFileSystems fileSystems);
  2589. // Import the default file system on the current disc
  2590. [DispId(0x15)]
  2591. FsiFileSystems ImportFileSystem();
  2592. // Import a specific file system on the current disc
  2593. [DispId(0x16)]
  2594. void ImportSpecificFileSystem(FsiFileSystems fileSystemToUse);
  2595. // Roll back to the specified change point
  2596. [DispId(0x17)]
  2597. void RollbackToChangePoint(int ChangePoint);
  2598. // Lock in changes
  2599. [DispId(0x18)]
  2600. void LockInChangePoint();
  2601. // Create a directory item with the specified name
  2602. [DispId(0x19)]
  2603. IFsiDirectoryItem CreateDirectoryItem(string Name);
  2604. // Create a file item with the specified name
  2605. [DispId(0x1a)]
  2606. IFsiFileItem CreateFileItem(string Name);
  2607. // Volume Name UDF
  2608. [DispId(0x1b)]
  2609. string VolumeNameUDF { get; }
  2610. // Volume name Joliet
  2611. [DispId(0x1c)]
  2612. string VolumeNameJoliet { get; }
  2613. // Volume name ISO 9660
  2614. [DispId(0x1d)]
  2615. string VolumeNameISO9660 { get; }
  2616. // Indicates whether or not IMAPI should stage the filesystem before the burn
  2617. [DispId(30)]
  2618. bool StageFiles { get; set; }
  2619. // Get array of available multi-session interfaces.
  2620. [DispId(40)]
  2621. object[] MultisessionInterfaces { get; set; }
  2622. //
  2623. // IFileSystemImage2
  2624. //
  2625. // Get boot options array for supporting multi-boot
  2626. [DispId(60)]
  2627. object[] BootImageOptionsArray { get; set; }
  2628. //
  2629. // IFileSystemImage3
  2630. //
  2631. // If true, indicates that UDF Metadata and Metadata Mirror files are truly redundant,
  2632. // i.e. reference different extents
  2633. [DispId(0x3d)]
  2634. bool CreateRedundantUdfMetadataFiles { get; set; }
  2635. // Probe if a specific file system on the disc is appendable through IMAPI
  2636. [DispId(70)]
  2637. bool ProbeSpecificFileSystem(FsiFileSystems fileSystemToProbe);
  2638. }
  2639. /// <summary>
  2640. /// FileSystemImage result stream
  2641. /// </summary>
  2642. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2643. [Guid("2C941FD8-975B-59BE-A960-9A2A262853A5")]
  2644. public interface IFileSystemImageResult
  2645. {
  2646. // Image stream
  2647. [DispId(1)]
  2648. IStream ImageStream { get; }
  2649. // Progress item block mapping collection
  2650. [DispId(2)]
  2651. IProgressItems ProgressItems { get; }
  2652. // Number of blocks in the result image
  2653. [DispId(3)]
  2654. int TotalBlocks { get; }
  2655. // Number of bytes in a block
  2656. [DispId(4)]
  2657. int BlockSize { get; }
  2658. // Disc Identifier (for identifing imported session of multi-session disc)
  2659. [DispId(5)]
  2660. string DiscId { get; }
  2661. }
  2662. [Guid("2C941FDC-975B-59BE-A960-9A2A262853A5")]
  2663. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2664. public interface IFsiDirectoryItem
  2665. {
  2666. //
  2667. // IFsiItem
  2668. //
  2669. // Item name
  2670. [DispId(11)]
  2671. string Name { get; }
  2672. // Full path
  2673. [DispId(12)]
  2674. string FullPath { get; }
  2675. // Date and time of creation
  2676. [DispId(13)]
  2677. DateTime CreationTime { get; set; }
  2678. // Date and time of last access
  2679. [DispId(14)]
  2680. DateTime LastAccessedTime { get; set; }
  2681. // Date and time of last modification
  2682. [DispId(15)]
  2683. DateTime LastModifiedTime { get; set; }
  2684. // Flag indicating if item is hidden
  2685. [DispId(0x10)]
  2686. bool IsHidden { get; set; }
  2687. // Name of item in the specified file system
  2688. [DispId(0x11)]
  2689. string FileSystemName(FsiFileSystems fileSystem);
  2690. // Name of item in the specified file system
  2691. [DispId(0x12)]
  2692. string FileSystemPath(FsiFileSystems fileSystem);
  2693. //
  2694. // IFsiDirectoryItem
  2695. //
  2696. // Get an enumerator for the collection
  2697. [TypeLibFunc((short)0x41), DispId(-4)]
  2698. IEnumerator GetEnumerator();
  2699. // Get the item with the given relative path
  2700. [DispId(0)]
  2701. IFsiItem this[string path] { get; }
  2702. // Number of items in the collection
  2703. [DispId(1)]
  2704. int Count { get; }
  2705. // Get a non-variant enumerator
  2706. [DispId(2)]
  2707. IEnumFsiItems EnumFsiItems { get; }
  2708. // Add a directory with the specified relative path
  2709. [DispId(30)]
  2710. void AddDirectory(string path);
  2711. // Add a file with the specified relative path and data
  2712. [DispId(0x1f)]
  2713. void AddFile(string path, IStream fileData);
  2714. // Add files and directories from the specified source directory
  2715. [DispId(0x20)]
  2716. void AddTree(string sourceDirectory, bool includeBaseDirectory);
  2717. // Add an item
  2718. [DispId(0x21)]
  2719. void Add(IFsiItem Item);
  2720. // Remove an item with the specified relative path
  2721. [DispId(0x22)]
  2722. void Remove(string path);
  2723. // Remove a subtree with the specified relative path
  2724. [DispId(0x23)]
  2725. void RemoveTree(string path);
  2726. }
  2727. /// <summary>
  2728. /// FileSystemImage directory item (rev.2)
  2729. /// </summary>
  2730. [ComImport]
  2731. [Guid("F7FB4B9B-6D96-4D7B-9115-201B144811EF")]
  2732. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2733. public interface IFsiDirectoryItem2 : IFsiDirectoryItem
  2734. {
  2735. // Add files and directories from the specified source directory including named streams
  2736. [DispId(0x24)]
  2737. void AddTreeWithNamedStreams( string sourceDirectory, bool includeBaseDirectory);
  2738. }
  2739. /// <summary>
  2740. /// FileSystemImage file item
  2741. /// </summary>
  2742. [Guid("2C941FDB-975B-59BE-A960-9A2A262853A5")]
  2743. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2744. public interface IFsiFileItem
  2745. {
  2746. //
  2747. // IFsiItem
  2748. //
  2749. // Item name
  2750. [DispId(11)]
  2751. string Name { get; }
  2752. // Full path
  2753. [DispId(12)]
  2754. string FullPath { get; }
  2755. // Date and time of creation
  2756. [DispId(13)]
  2757. DateTime CreationTime { get; set; }
  2758. // Date and time of last access
  2759. [DispId(14)]
  2760. DateTime LastAccessedTime { get; set; }
  2761. // Date and time of last modification
  2762. [DispId(15)]
  2763. DateTime LastModifiedTime { get; set; }
  2764. // Flag indicating if item is hidden
  2765. [DispId(0x10)]
  2766. bool IsHidden { get; set; }
  2767. // Name of item in the specified file system
  2768. [DispId(0x11)]
  2769. string FileSystemName(FsiFileSystems fileSystem);
  2770. // Name of item in the specified file system
  2771. [DispId(0x12)]
  2772. string FileSystemPath(FsiFileSystems fileSystem);
  2773. //
  2774. // IFsiFileItem
  2775. //
  2776. // Data byte count
  2777. [DispId(0x29)]
  2778. long DataSize { get; }
  2779. // Lower 32 bits of the data byte count
  2780. [DispId(0x2a)]
  2781. int DataSize32BitLow { get; }
  2782. // Upper 32 bits of the data byte count
  2783. [DispId(0x2b)]
  2784. int DataSize32BitHigh { get; }
  2785. // Data stream
  2786. [DispId(0x2c)]
  2787. IStream Data { get; set; }
  2788. }
  2789. /// <summary>
  2790. /// FileSystemImage file item (rev.2)
  2791. /// </summary>
  2792. [ComImport]
  2793. [Guid("199D0C19-11E1-40EB-8EC2-C8C822A07792")]
  2794. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2795. public interface IFsiFileItem2
  2796. {
  2797. //
  2798. // IFsiItem
  2799. //
  2800. // Item name
  2801. [DispId(11)]
  2802. string Name { get; }
  2803. // Full path
  2804. [DispId(12)]
  2805. string FullPath { get; }
  2806. // Date and time of creation
  2807. [DispId(13)]
  2808. DateTime CreationTime { get; set; }
  2809. // Date and time of last access
  2810. [DispId(14)]
  2811. DateTime LastAccessedTime { get; set; }
  2812. // Date and time of last modification
  2813. [DispId(15)]
  2814. DateTime LastModifiedTime { get; set; }
  2815. // Flag indicating if item is hidden
  2816. [DispId(0x10)]
  2817. bool IsHidden { get; set; }
  2818. // Name of item in the specified file system
  2819. [DispId(0x11)]
  2820. string FileSystemName(FsiFileSystems fileSystem);
  2821. // Name of item in the specified file system
  2822. [DispId(0x12)]
  2823. string FileSystemPath(FsiFileSystems fileSystem);
  2824. //
  2825. // IFsiFileItem
  2826. //
  2827. // Data byte count
  2828. [DispId(0x29)]
  2829. long DataSize { get; }
  2830. // Lower 32 bits of the data byte count
  2831. [DispId(0x2a)]
  2832. int DataSize32BitLow { get; }
  2833. // Upper 32 bits of the data byte count
  2834. [DispId(0x2b)]
  2835. int DataSize32BitHigh { get; }
  2836. // Data stream
  2837. [DispId(0x2c)]
  2838. IStream Data { get; set; }
  2839. //
  2840. // IFsiFileItem2
  2841. //
  2842. // Get the list of the named streams of the file
  2843. [DispId(0x2d)]
  2844. FsiNamedStreams FsiNamedStreams { get; }
  2845. // Flag indicating if file item is a named stream of a file
  2846. [DispId(0x2e)]
  2847. bool IsNamedStream { get; }
  2848. // Add a new named stream to the collection
  2849. [DispId(0x2f)]
  2850. void AddStream( string Name, FsiStream streamData);
  2851. // Remove a specific named stream from the collection
  2852. [DispId(0x30)]
  2853. void RemoveStream( string Name);
  2854. // Flag indicating if file is Real-Time
  2855. [DispId(0x31)]
  2856. bool IsRealTime { get; set; }
  2857. }
  2858. /// <summary>
  2859. /// FileSystemImage item
  2860. /// </summary>
  2861. [Guid("2C941FD9-975B-59BE-A960-9A2A262853A5")]
  2862. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2863. public interface IFsiItem
  2864. {
  2865. // Item name
  2866. [DispId(11)]
  2867. string Name { get; }
  2868. // Full path
  2869. [DispId(12)]
  2870. string FullPath { get; }
  2871. // Date and time of creation
  2872. [DispId(13)]
  2873. DateTime CreationTime { get; set; }
  2874. // Date and time of last access
  2875. [DispId(14)]
  2876. DateTime LastAccessedTime { get; set; }
  2877. // Date and time of last modification
  2878. [DispId(15)]
  2879. DateTime LastModifiedTime { get; set; }
  2880. // Flag indicating if item is hidden
  2881. [DispId(0x10)]
  2882. bool IsHidden { get; set; }
  2883. // Name of item in the specified file system
  2884. [DispId(0x11)]
  2885. string FileSystemName(FsiFileSystems fileSystem);
  2886. // Name of item in the specified file system
  2887. [DispId(0x12)]
  2888. string FileSystemPath(FsiFileSystems fileSystem);
  2889. }
  2890. /// <summary>
  2891. /// Named stream collection
  2892. /// </summary>
  2893. [ComImport]
  2894. [Guid("ED79BA56-5294-4250-8D46-F9AECEE23459")]
  2895. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2896. public interface IFsiNamedStreams : IEnumerable
  2897. {
  2898. // Get a named stream from the collection
  2899. [DispId(0)]
  2900. FsiFileItem this[int Index] { get; }
  2901. // Number of named streams in the collection
  2902. [DispId(0x51)]
  2903. int Count { [DispId(0x51)] get; }
  2904. // Get a non-variant enumerator for the named stream collection
  2905. [DispId(0x52)]
  2906. EnumFsiItems EnumNamedStreams { get; }
  2907. }
  2908. /// <summary>
  2909. /// ISO Image Manager: Helper object for ISO image file manipulation
  2910. /// </summary>
  2911. [ComImport]
  2912. [TypeLibType(TypeLibTypeFlags.FDispatchable)]
  2913. [Guid("6CA38BE5-FBBB-4800-95A1-A438865EB0D4")]
  2914. public interface IIsoImageManager
  2915. {
  2916. // Path to the ISO image file
  2917. [DispId(0x100)]
  2918. string path { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] get; }
  2919. // Stream from the ISO image
  2920. [DispId(0x101)]
  2921. FsiStream Stream { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] get; }
  2922. // Set path to the ISO image file, overwrites stream
  2923. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  2924. void SetPath( string Val);
  2925. // Set stream from the ISO image, overwrites path
  2926. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  2927. void SetStream([In, MarshalAs(UnmanagedType.Interface)] FsiStream Data);
  2928. // Validate if the ISO image file is a valid file
  2929. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
  2930. void Validate();
  2931. }
  2932. [ComImport]
  2933. [Guid("27354150-7F64-5B0F-8F00-5D77AFBE261E")]
  2934. [TypeLibType(TypeLibTypeFlags.FDispatchable)]
  2935. public interface IMultisession
  2936. {
  2937. // Is it possible to write this multi-session type on the current media in its present state
  2938. [DispId(0x100)]
  2939. bool IsSupportedOnCurrentMediaState { get; }
  2940. // Is this multi-session type the one to use on current media
  2941. [DispId(0x101)]
  2942. bool InUse { set; get; }
  2943. // The disc recorder to use to import previous session(s)
  2944. [DispId(0x102)]
  2945. MsftDiscRecorder2 ImportRecorder { get; }
  2946. }
  2947. [ComImport]
  2948. [Guid("27354151-7F64-5B0F-8F00-5D77AFBE261E")]
  2949. [TypeLibType(TypeLibTypeFlags.FDispatchable)]
  2950. public interface IMultisessionSequential
  2951. {
  2952. //
  2953. // IMultisession
  2954. //
  2955. // Is it possible to write this multi-session type on the current media in its present state
  2956. [DispId(0x100)]
  2957. bool IsSupportedOnCurrentMediaState { get; }
  2958. // Is this multi-session type the one to use on current media
  2959. [DispId(0x101)]
  2960. bool InUse { set; get; }
  2961. // The disc recorder to use to import previous session(s)
  2962. [DispId(0x102)]
  2963. MsftDiscRecorder2 ImportRecorder { get; }
  2964. //
  2965. // IMultisessionSequential
  2966. //
  2967. // Is this the first data session on the media?
  2968. [DispId(0x200)]
  2969. bool IsFirstDataSession { get; }
  2970. // The first sector in the previous session on the media.
  2971. [DispId(0x201)]
  2972. int StartAddressOfPreviousSession { get; }
  2973. // The last sector in the previous session on the media
  2974. [DispId(0x202)]
  2975. int LastWrittenAddressOfPreviousSession { get; }
  2976. // Next writable address on the media (also used sectors).
  2977. [DispId(0x203)]
  2978. int NextWritableAddress { get; }
  2979. // Free sectors available on the media
  2980. [DispId(0x204)]
  2981. int FreeSectorsOnMedia { get; }
  2982. }
  2983. /// <summary>
  2984. /// FileSystemImageResult progress item
  2985. /// </summary>
  2986. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  2987. [Guid("2C941FD5-975B-59BE-A960-9A2A262853A5")]
  2988. public interface IProgressItem
  2989. {
  2990. // Progress item description
  2991. [DispId(1)]
  2992. string Description { get; }
  2993. // First block in the range of blocks used by the progress item
  2994. [DispId(2)]
  2995. uint FirstBlock { get; }
  2996. // Last block in the range of blocks used by the progress item
  2997. [DispId(3)]
  2998. uint LastBlock { get; }
  2999. // Number of blocks used by the progress item
  3000. [DispId(4)]
  3001. uint BlockCount { get; }
  3002. }
  3003. /// <summary>
  3004. /// FileSystemImageResult progress item
  3005. /// </summary>
  3006. [Guid("2C941FD7-975B-59BE-A960-9A2A262853A5")]
  3007. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  3008. public interface IProgressItems
  3009. {
  3010. // Get an enumerator for the collection
  3011. [DispId(-4), TypeLibFunc((short)0x41)]
  3012. IEnumerator GetEnumerator();
  3013. // Find the block mapping from the specified index
  3014. [DispId(0)]
  3015. IProgressItem this[int Index] { get; }
  3016. // Number of items in the collection
  3017. [DispId(1)]
  3018. int Count { get; }
  3019. // Find the block mapping from the specified block
  3020. [DispId(2)]
  3021. IProgressItem ProgressItemFromBlock(uint block);
  3022. // Find the block mapping from the specified item description
  3023. [DispId(3)]
  3024. IProgressItem ProgressItemFromDescription(string Description);
  3025. // Get a non-variant enumerator
  3026. [DispId(4)]
  3027. IEnumProgressItems EnumProgressItems { get; }
  3028. }
  3029. [ComImport]
  3030. [Guid("25983550-9D65-49CE-B335-40630D901227")]
  3031. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  3032. public interface IRawCDImageCreator
  3033. {
  3034. // Creates the result stream
  3035. [DispId(0x200)]
  3036. IStream CreateResultImage();
  3037. // Adds a track to the media (defaults to audio, always 2352 bytes/sector)
  3038. [DispId(0x201)]
  3039. int AddTrack(IMAPI_CD_SECTOR_TYPE dataType, [In, MarshalAs(UnmanagedType.Interface)] IStream data);
  3040. // Adds a special pregap to the first track, and implies an audio CD
  3041. [DispId(0x202)]
  3042. void AddSpecialPregap([In, MarshalAs(UnmanagedType.Interface)] IStream data);
  3043. // Adds an R-W subcode generation object to supply R-W subcode (i.e. CD-Text or CD-G).
  3044. [DispId(0x203)]
  3045. void AddSubcodeRWGenerator([In, MarshalAs(UnmanagedType.Interface)] IStream subcode);
  3046. [DispId(0x100)]
  3047. IMAPI_FORMAT2_RAW_CD_DATA_SECTOR_TYPE ResultingImageType { set; get; }
  3048. // Equal to (final user LBA+1), defines minimum disc size image can be written to.
  3049. [DispId(0x101)]
  3050. int StartOfLeadout { get; }
  3051. //
  3052. [DispId(0x102)]
  3053. int StartOfLeadoutLimit { set; get; }
  3054. // Disables gapless recording of consecutive audio tracks
  3055. [DispId(0x103)]
  3056. bool DisableGaplessAudio { set; get; }
  3057. // The Media Catalog Number for the CD image
  3058. [DispId(260)]
  3059. string MediaCatalogNumber { set; get; }
  3060. // The starting track number (only for pure audio CDs)
  3061. [DispId(0x105)]
  3062. int StartingTrackNumber { set; get; }
  3063. [DispId(0x106)]
  3064. IRawCDImageTrackInfo this[int trackIndex] { [DispId(0x106)] get; }
  3065. [DispId(0x107)]
  3066. int NumberOfExistingTracks { get; }
  3067. [DispId(0x108)]
  3068. int LastUsedUserSectorInImage { get; }
  3069. [DispId(0x109)]
  3070. object[] ExpectedTableOfContents { get; }
  3071. }
  3072. [ComImport]
  3073. [Guid("25983551-9D65-49CE-B335-40630D901227")]
  3074. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  3075. public interface IRawCDImageTrackInfo
  3076. {
  3077. // The LBA of the first user sector in this track
  3078. [DispId(0x100)]
  3079. int StartingLba { get; }
  3080. // The number of user sectors in this track
  3081. [DispId(0x101)]
  3082. int SectorCount { get; }
  3083. // The track number assigned for this track
  3084. [DispId(0x102)]
  3085. int TrackNumber { get; }
  3086. // The type of data being recorded on the current sector.
  3087. [DispId(0x103)]
  3088. IMAPI_CD_SECTOR_TYPE SectorType { get; }
  3089. // The International Standard Recording Code (ISRC) for this track.
  3090. [DispId(260)]
  3091. string ISRC { get; set; }
  3092. // The digital audio copy setting for this track
  3093. [DispId(0x105)]
  3094. IMAPI_CD_TRACK_DIGITAL_COPY_SETTING DigitalAudioCopySetting { get; set; }
  3095. // The audio provided already has preemphasis applied (rare).
  3096. [DispId(0x106)]
  3097. bool AudioHasPreemphasis { get; set; }
  3098. // The list of current track-relative indexes within the CD track.
  3099. [DispId(0x107)]
  3100. object[] TrackIndexes { get; }
  3101. // Add the specified LBA (relative to the start of the track) as an index.
  3102. [DispId(0x200)]
  3103. void AddTrackIndex( int lbaOffset);
  3104. // Removes the specified LBA (relative to the start of the track) as an index.
  3105. [DispId(0x201)]
  3106. void ClearTrackIndex( int lbaOffset);
  3107. }
  3108. /// <summary>
  3109. /// Write Engine
  3110. /// </summary>
  3111. [ComImport]
  3112. [Guid("27354135-7F64-5B0F-8F00-5D77AFBE261E")]
  3113. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  3114. public interface IWriteEngine2
  3115. {
  3116. // Writes data provided in the IStream to the device
  3117. [DispId(0x200)]
  3118. void WriteSection(IStream data, int startingBlockAddress, int numberOfBlocks);
  3119. // Cancels the current write operation
  3120. [DispId(0x201)]
  3121. void CancelWrite();
  3122. // The disc recorder to use
  3123. [DispId(0x100)]
  3124. IDiscRecorder2Ex Recorder { set; get; }
  3125. // If true, uses WRITE12 with the AV bit set to one; else uses WRITE10
  3126. [DispId(0x101)]
  3127. bool UseStreamingWrite12 { set; get; }
  3128. // The approximate number of sectors per second the device can write at
  3129. // the start of the write process. This is used to optimize sleep time
  3130. // in the write engine.
  3131. [DispId(0x102)]
  3132. int StartingSectorsPerSecond { set; get; }
  3133. // The approximate number of sectors per second the device can write at
  3134. // the end of the write process. This is used to optimize sleep time
  3135. // in the write engine.
  3136. [DispId(0x103)]
  3137. int EndingSectorsPerSecond { set; get; }
  3138. // The number of bytes to use for each sector during writing.
  3139. [DispId(260)]
  3140. int BytesPerSector { set; get; }
  3141. // Simple check to see if the object is currently writing to media.
  3142. [DispId(0x105)]
  3143. bool WriteInProgress { get; }
  3144. }
  3145. /// <summary>
  3146. /// CD Write Engine
  3147. /// </summary>
  3148. [ComImport]
  3149. [TypeLibType(TypeLibTypeFlags.FDual | TypeLibTypeFlags.FDispatchable | TypeLibTypeFlags.FNonExtensible)]
  3150. [Guid("27354136-7F64-5B0F-8F00-5D77AFBE261E")]
  3151. public interface IWriteEngine2EventArgs
  3152. {
  3153. // The starting logical block address for the current write operation.
  3154. [DispId(0x100)]
  3155. int StartLba { get; }
  3156. // The number of sectors being written for the current write operation.
  3157. [DispId(0x101)]
  3158. int SectorCount { get; }
  3159. // The last logical block address of data read for the current write operation.
  3160. [DispId(0x102)]
  3161. int LastReadLba { get; }
  3162. // The last logical block address of data written for the current write operation
  3163. [DispId(0x103)]
  3164. int LastWrittenLba { get; }
  3165. // The total bytes available in the system's cache buffer
  3166. [DispId(0x106)]
  3167. int TotalSystemBuffer { get; }
  3168. // The used bytes in the system's cache buffer
  3169. [DispId(0x107)]
  3170. int UsedSystemBuffer { get; }
  3171. // The free bytes in the system's cache buffer
  3172. [DispId(0x108)]
  3173. int FreeSystemBuffer { get; }
  3174. }
  3175. /// <summary>
  3176. /// A single optical drive Write Speed Configuration
  3177. /// </summary>
  3178. [ComImport]
  3179. [Guid("27354144-7F64-5B0F-8F00-5D77AFBE261E")]
  3180. [TypeLibType(TypeLibTypeFlags.FDispatchable|TypeLibTypeFlags.FDual)]
  3181. public interface IWriteSpeedDescriptor
  3182. {
  3183. // The type of media that this descriptor is valid for
  3184. [DispId(0x101)]
  3185. IMAPI_MEDIA_PHYSICAL_TYPE MediaType { get; }
  3186. // Whether or not this descriptor represents a writing configuration that uses
  3187. // Pure CAV rotation control
  3188. [DispId(0x102)]
  3189. bool RotationTypeIsPureCAV { get; }
  3190. // The maximum speed at which the media will be written in the write configuration
  3191. // represented by this descriptor
  3192. [DispId(0x103)]
  3193. int WriteSpeed { get; }
  3194. }
  3195. #endregion // Interfaces
  3196. [ComImport]
  3197. [CoClass(typeof(MsftDiscFormat2DataClass))]
  3198. [Guid("27354153-9F64-5B0F-8F00-5D77AFBE261E")]
  3199. public interface MsftDiscFormat2Data : IDiscFormat2Data, DiscFormat2Data_Event
  3200. {
  3201. }
  3202. [ComImport]
  3203. [ComSourceInterfaces("DDiscFormat2DataEvents\0")]
  3204. [Guid("2735412A-7F64-5B0F-8F00-5D77AFBE261E")]
  3205. [TypeLibType(TypeLibTypeFlags.FCanCreate), ClassInterface(ClassInterfaceType.None)]
  3206. public class MsftDiscFormat2DataClass
  3207. {
  3208. }
  3209. [ComImport]
  3210. [Guid("27354156-8F64-5B0F-8F00-5D77AFBE261E")]
  3211. [CoClass(typeof(MsftDiscFormat2EraseClass))]
  3212. public interface MsftDiscFormat2Erase : IDiscFormat2Erase, DiscFormat2Erase_Event
  3213. {
  3214. }
  3215. [ComImport]
  3216. [Guid("2735412B-7F64-5B0F-8F00-5D77AFBE261E")]
  3217. [ComSourceInterfaces("DDiscFormat2EraseEvents\0")]
  3218. [TypeLibType(TypeLibTypeFlags.FCanCreate), ClassInterface(ClassInterfaceType.None)]
  3219. public class MsftDiscFormat2EraseClass
  3220. {
  3221. }
  3222. [ComImport]
  3223. [CoClass(typeof(MsftDiscFormat2RawCDClass))]
  3224. [Guid("27354155-8F64-5B0F-8F00-5D77AFBE261E")]
  3225. public interface MsftDiscFormat2RawCD : IDiscFormat2RawCD, DiscFormat2RawCD_Event
  3226. {
  3227. }
  3228. [ComImport]
  3229. [Guid("27354128-7F64-5B0F-8F00-5D77AFBE261E")]
  3230. [ComSourceInterfaces("DDiscFormat2RawCDEvents\0")]
  3231. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3232. [ClassInterface(ClassInterfaceType.None)]
  3233. public class MsftDiscFormat2RawCDClass
  3234. {
  3235. }
  3236. /// <summary>
  3237. /// Microsoft IMAPIv2 Track-at-Once Audio CD Writer
  3238. /// </summary>
  3239. [ComImport]
  3240. [Guid("27354154-8F64-5B0F-8F00-5D77AFBE261E")]
  3241. [CoClass(typeof(MsftDiscFormat2TrackAtOnceClass))]
  3242. public interface MsftDiscFormat2TrackAtOnce : IDiscFormat2TrackAtOnce, DiscFormat2TrackAtOnce_Event
  3243. {
  3244. }
  3245. [ComImport]
  3246. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3247. [ComSourceInterfaces("DDiscFormat2TrackAtOnceEvents\0")]
  3248. [Guid("27354129-7F64-5B0F-8F00-5D77AFBE261E")]
  3249. [ClassInterface(ClassInterfaceType.None)]
  3250. public class MsftDiscFormat2TrackAtOnceClass
  3251. {
  3252. }
  3253. /// <summary>
  3254. /// Microsoft IMAPIv2 Disc Master
  3255. /// </summary>
  3256. [ComImport]
  3257. [Guid("27354130-7F64-5B0F-8F00-5D77AFBE261E")]
  3258. [CoClass(typeof(MsftDiscMaster2Class))]
  3259. public interface MsftDiscMaster2 : IDiscMaster2 //, DiscMaster2_Event
  3260. {
  3261. }
  3262. [ComImport, ComSourceInterfaces("DDiscMaster2Events\0")]
  3263. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3264. [Guid("2735412E-7F64-5B0F-8F00-5D77AFBE261E")]
  3265. [ClassInterface(ClassInterfaceType.None)]
  3266. public class MsftDiscMaster2Class
  3267. {
  3268. }
  3269. [ComImport]
  3270. [CoClass(typeof(MsftDiscRecorder2Class))]
  3271. [Guid("27354133-7F64-5B0F-8F00-5D77AFBE261E")]
  3272. public interface MsftDiscRecorder2 : IDiscRecorder2
  3273. {
  3274. }
  3275. [ComImport]
  3276. [Guid("2735412D-7F64-5B0F-8F00-5D77AFBE261E")]
  3277. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3278. [ClassInterface(ClassInterfaceType.None)]
  3279. public class MsftDiscRecorder2Class
  3280. {
  3281. }
  3282. [ComImport]
  3283. [Guid("27354151-7F64-5B0F-8F00-5D77AFBE261E")]
  3284. [CoClass(typeof(MsftMultisessionSequentialClass))]
  3285. public interface MsftMultisessionSequential : IMultisessionSequential
  3286. {
  3287. }
  3288. [ComImport]
  3289. [Guid("27354122-7F64-5B0F-8F00-5D77AFBE261E")]
  3290. [ClassInterface(ClassInterfaceType.None)]
  3291. public class MsftMultisessionSequentialClass
  3292. {
  3293. }
  3294. [ComImport]
  3295. [Guid("25983550-9D65-49CE-B335-40630D901227")]
  3296. [CoClass(typeof(MsftRawCDImageCreatorClass))]
  3297. public interface MsftRawCDImageCreator : IRawCDImageCreator
  3298. {
  3299. }
  3300. [ComImport]
  3301. [Guid("25983561-9D65-49CE-B335-40630D901227")]
  3302. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3303. [ClassInterface(ClassInterfaceType.None)]
  3304. public class MsftRawCDImageCreatorClass
  3305. {
  3306. }
  3307. [ComImport]
  3308. [Guid("27354135-7F64-5B0F-8F00-5D77AFBE261E")]
  3309. [CoClass(typeof(MsftWriteEngine2Class))]
  3310. public interface MsftWriteEngine2 : IWriteEngine2, DWriteEngine2_Event
  3311. {
  3312. }
  3313. [ComImport]
  3314. [Guid("2735412C-7F64-5B0F-8F00-5D77AFBE261E")]
  3315. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3316. [ComSourceInterfaces("DWriteEngine2Events\0")]
  3317. [ClassInterface(ClassInterfaceType.None)]
  3318. public class MsftWriteEngine2Class
  3319. {
  3320. }
  3321. [ComImport]
  3322. [CoClass(typeof(MsftWriteSpeedDescriptorClass))]
  3323. [Guid("27354144-7F64-5B0F-8F00-5D77AFBE261E")]
  3324. public interface MsftWriteSpeedDescriptor : IWriteSpeedDescriptor
  3325. {
  3326. }
  3327. [ComImport][ClassInterface(ClassInterfaceType.None)]
  3328. [Guid("27354123-7F64-5B0F-8F00-5D77AFBE261E")]
  3329. public class MsftWriteSpeedDescriptorClass
  3330. {
  3331. }
  3332. [ComImport]
  3333. [CoClass(typeof(BootOptionsClass))]
  3334. [Guid("2C941FD4-975B-59BE-A960-9A2A262853A5")]
  3335. public interface BootOptions : IBootOptions
  3336. {
  3337. }
  3338. [ComImport]
  3339. [ClassInterface(ClassInterfaceType.None)]
  3340. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3341. [Guid("2C941FCE-975B-59BE-A960-9A2A262853A5")]
  3342. public class BootOptionsClass
  3343. {
  3344. }
  3345. [ComImport]
  3346. [Guid("2C941FDA-975B-59BE-A960-9A2A262853A5")]
  3347. [CoClass(typeof(EnumFsiItemsClass))]
  3348. public interface EnumFsiItems : IEnumFsiItems
  3349. {
  3350. }
  3351. [ComImport]
  3352. [Guid("2C941FC6-975B-59BE-A960-9A2A262853A5")]
  3353. [ClassInterface(ClassInterfaceType.None)]
  3354. public class EnumFsiItemsClass
  3355. {
  3356. }
  3357. [ComImport]
  3358. [Guid("2C941FD6-975B-59BE-A960-9A2A262853A5")]
  3359. [CoClass(typeof(EnumProgressItemsClass))]
  3360. public interface EnumProgressItems : IEnumProgressItems
  3361. {
  3362. }
  3363. [ComImport]
  3364. [ClassInterface(ClassInterfaceType.None)]
  3365. [Guid("2C941FCA-975B-59BE-A960-9A2A262853A5")]
  3366. public class EnumProgressItemsClass
  3367. {
  3368. }
  3369. [ComImport]
  3370. [Guid("2C941FD8-975B-59BE-A960-9A2A262853A5")]
  3371. [CoClass(typeof(FileSystemImageResultClass))]
  3372. public interface FileSystemImageResult : IFileSystemImageResult
  3373. {
  3374. }
  3375. [ComImport]
  3376. [Guid("2C941FCC-975B-59BE-A960-9A2A262853A5")]
  3377. [ClassInterface(ClassInterfaceType.None)]
  3378. public class FileSystemImageResultClass
  3379. {
  3380. }
  3381. [ComImport]
  3382. [Guid("F7FB4B9B-6D96-4D7B-9115-201B144811EF")]
  3383. [CoClass(typeof(FsiDirectoryItemClass))]
  3384. public interface FsiDirectoryItem : IFsiDirectoryItem2
  3385. {
  3386. }
  3387. [ComImport]
  3388. [ClassInterface(ClassInterfaceType.None)]
  3389. [Guid("2C941FC8-975B-59BE-A960-9A2A262853A5")]
  3390. public class FsiDirectoryItemClass
  3391. {
  3392. }
  3393. [ComImport]
  3394. [CoClass(typeof(FsiFileItemClass))]
  3395. [Guid("199D0C19-11E1-40EB-8EC2-C8C822A07792")]
  3396. public interface FsiFileItem : IFsiFileItem2
  3397. {
  3398. }
  3399. [ComImport]
  3400. [ClassInterface(ClassInterfaceType.None)]
  3401. [Guid("2C941FC7-975B-59BE-A960-9A2A262853A5")]
  3402. public class FsiFileItemClass
  3403. {
  3404. }
  3405. [ComImport]
  3406. [Guid("ED79BA56-5294-4250-8D46-F9AECEE23459")]
  3407. [CoClass(typeof(FsiNamedStreamsClass))]
  3408. public interface FsiNamedStreams : IFsiNamedStreams
  3409. {
  3410. }
  3411. [ComImport]
  3412. [Guid("C6B6F8ED-6D19-44B4-B539-B159B793A32D")]
  3413. [ClassInterface(ClassInterfaceType.None)]
  3414. public class FsiNamedStreamsClass
  3415. {
  3416. }
  3417. [ComImport]
  3418. [Guid("0000000C-0000-0000-C000-000000000046")]
  3419. [CoClass(typeof(FsiStreamClass))]
  3420. public interface FsiStream : IStream
  3421. {
  3422. }
  3423. [ComImport]
  3424. [ClassInterface(ClassInterfaceType.None)]
  3425. [Guid("2C941FCD-975B-59BE-A960-9A2A262853A5")]
  3426. public class FsiStreamClass
  3427. {
  3428. }
  3429. [ComImport]
  3430. [CoClass(typeof(MsftFileSystemImageClass))]
  3431. [Guid("2C941FE1-975B-59BE-A960-9A2A262853A5")]
  3432. public interface MsftFileSystemImage : IFileSystemImage, DFileSystemImage_Event
  3433. {
  3434. }
  3435. [ComImport]
  3436. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3437. [Guid("2C941FC5-975B-59BE-A960-9A2A262853A5")]
  3438. [ComSourceInterfaces("DFileSystemImageEvents\0DFileSystemImageImportEvents\0")]
  3439. [ClassInterface(ClassInterfaceType.None)]
  3440. public class MsftFileSystemImageClass
  3441. {
  3442. }
  3443. [ComImport]
  3444. [Guid("6CA38BE5-FBBB-4800-95A1-A438865EB0D4")]
  3445. [CoClass(typeof(MsftIsoImageManagerClass))]
  3446. public interface MsftIsoImageManager : IIsoImageManager
  3447. {
  3448. }
  3449. [ComImport]
  3450. [ClassInterface(ClassInterfaceType.None)]
  3451. [Guid("CEEE3B62-8F56-4056-869B-EF16917E3EFC")]
  3452. [TypeLibType(TypeLibTypeFlags.FCanCreate)]
  3453. public class MsftIsoImageManagerClass
  3454. {
  3455. }
  3456. [ComImport]
  3457. [Guid("2C941FD5-975B-59BE-A960-9A2A262853A5")]
  3458. [CoClass(typeof(ProgressItemClass))]
  3459. public interface ProgressItem : IProgressItem
  3460. {
  3461. }
  3462. [ComImport]
  3463. [Guid("2C941FCB-975B-59BE-A960-9A2A262853A5")]
  3464. [ClassInterface(ClassInterfaceType.None)]
  3465. public class ProgressItemClass
  3466. {
  3467. }
  3468. [ComImport]
  3469. [Guid("2C941FD7-975B-59BE-A960-9A2A262853A5")]
  3470. [CoClass(typeof(ProgressItemsClass))]
  3471. public interface ProgressItems : IProgressItems
  3472. {
  3473. }
  3474. [ComImport]
  3475. [Guid("2C941FC9-975B-59BE-A960-9A2A262853A5")]
  3476. [ClassInterface(ClassInterfaceType.None)]
  3477. public class ProgressItemsClass
  3478. {
  3479. }
  3480. }