【发布时间】:2016-08-21 19:59:24
【问题描述】:
我正在使用带有 C#.NET windows 应用程序的 IMAPI 编写 CD/DVD。 我在 CD 上写入的数据包含一个可执行文件 (test.exe),该文件也是用 C#.NET 开发的,并使用 Turbo Virtualization Studio 虚拟化(sandobx)。 所有要写入 CD 的数据都放在 C 盘上的一个文件夹(源路径)中。
以下是小代码sn-p:-
IStream stream = null;
try
{
System.Diagnostics.Debug.Print("Adding - " + thisFileItem.SourcePath);
if (thisFileItem.SourcePath != null)
Win32.SHCreateStreamOnFile(thisFileItem.SourcePath, Win32.STGM_READ | Win32.STGM_SHARE_DENY_WRITE, ref stream);
if (stream != null)
{
fileSystemImage.Root.AddFile(thisFileItem.DestPath + thisFileItem.DisplayName, stream);
}
}
finally
{
if (stream != null)
{
Marshal.FinalReleaseComObject(stream);
}
}
在添加 test.exe 时调用“fileSystemImage.Root.AddFile”方法会引发 COMException -1062555360“发生内部文件系统错误。”所有其他文件都可以正确添加和写入。
异常详情:-
COMException -1062555360
Internal file system error occurred.
at ImapiInterop.IFsiDirectoryItem.AddFile(String path, IStream fileData)
at ImapiImplementation.CDWriter.objBackgroundWorker_DoWork(Object sender, DoWorkEventArgs e) in C:\.........\CDWriter.cs:line 405
如果我将源文件夹放在其他位置(桌面或 D 驱动器),所有写入过程(包括 test.exe)都会正常进行而不会出错。
我怀疑这个问题是由于虚拟化造成的,但不确定。 请帮忙。
【问题讨论】:
-
-1062555360 == 0xC0AAB120 == IMAPI_E_IMAGE_SIZE_LIMIT == “添加‘文件名’会导致结果图像的大小大于当前配置的限制”。 IMAPI 当然不知道文件的来源。