imapi

Is there a relatively straightforward way to finalize a CD or DVD in C# or PowerShell?

浪子不回头ぞ 提交于 2019-11-29 02:53:15
问题 First, some clarification of terms. By finalize, I don't mean closing a session; I mean writing a lead-out to a CD or DVD in such a way that information can no longer be added to it via the usual means (Roxio, Nero, Windows Explorer, etc.) I've done a fair amount of research on this. There are some open-source programs like InfraRecorder from which we could draw some inspiration, but they all seem to involve rather elaborate reams of C++ code using IMAPI, which seems like a very low-level way

Create ISO image using PowerShell: how to save IStream to file?

早过忘川 提交于 2019-11-28 03:32:35
问题 I want to create an ISO image, so a .iso file, on Windows. This is possible to do using COM component IMAPI2FS.MsftFileSystemImage, and I found instructions on how to do this using PowerShell in an MSDN blog post entitled "Writing optical discs using IMAPI 2 in powershell". After step 3, those instructions say that "at this step you can stop and save resulted image to the local hard disc, this will be a pure iso image." My question: How do I take $resultStream, i.e., a COM object that results

PowerShell: how to convert a COM object to an .NET interop type?

天大地大妈咪最大 提交于 2019-11-27 07:48:37
问题 As described in my question Create ISO image using PowerShell: how to save IStream to file?, in PowerShell I create an IStream object as follows: $is = (New-Object -ComObject IMAPI2FS.MsftFileSystemImage).CreateResultImage().ImageStream This object is of (PowerShell) type System.__ComObject . And somehow PowerShell knows that it is an IStream : PS C:\> $is -is [System.Runtime.InteropServices.ComTypes.IConnectionPoint] False PS C:\> $is -is [System.Runtime.InteropServices.ComTypes.IStream]