Windows Server 2008 R2上的常见对话框:GetOpenFileName崩溃



我们有一个相当大的应用程序,用C++编写,运行在Windows Server 2003和Windows Server 2008 R2上。它使用GetOpenFileName API打开"打开文件"对话框,用于选择视频文件。

我们看到,在Windows Server 2008 R2上,"打开文件"对话框偶尔会崩溃。主GUI线程正在等待一个工作线程,而该工作线程正在获取访问冲突异常。堆栈跟踪如下所示:

linkinfo.dll!_IsValidLinkInfo@4()   
shell32.dll!LinkInfo_LoadFromStream()  + 0x7d bytes 
shell32.dll!CShellLink::_LoadFromStream()  + 0x14b bytes    
shell32.dll!CShellLink::Initialize()  + 0x1a bytes  
shell32.dll!InitializeFileHandlerWithStream()  + 0xc4 bytes 
shell32.dll!CFileSysItemString::HandlerCreateInstance()  + 0x13b bytes  
shell32.dll!CFileSysItemString::LoadHandler()  - 0x9f1d bytes   
shell32.dll!CFSFolder::_CreatePerInstanceDefExtIcon()  + 0x9b bytes 
shell32.dll!CFSFolder::_CreateDefExtIcon()  + 0xb6 bytes    
shell32.dll!CFSFolder::s_GetExtractIcon()  + 0x1e bytes 
shell32.dll!CFSFolder::_BindHandler()  - 0xd759 bytes   
shell32.dll!CFSFolder::GetThumbnailHandler()  + 0x51 bytes  
shell32.dll!_CreateThumbnailHandler()  + 0x61 bytes 
shell32.dll!CShellItem::BindToHandler()  - 0x20a93 bytes    
shell32.dll!_GetExtractIconW@16()  + 0x63 bytes 
shell32.dll!_GetILIndexFromItem()  + 0x5f bytes 
shell32.dll!_SHGetIconIndexFromPIDL@20()  - 0x3857d bytes   
shell32.dll!CFSFolder::GetIconOf()  + 0xa57c3 bytes 
shell32.dll!_SHGetIconIndexFromPIDL@20()  + 0x24 bytes  
shell32.dll!_SHIconIndexFromPIDL@16()  + 0x3d bytes 
shell32.dll!CRegFolder::GetIconOf()  + 0x10a892 bytes   
shell32.dll!_SHGetIconIndexFromPIDL@20()  + 0x24 bytes  
shell32.dll!_SHIconIndexFromPIDL@16()  + 0x3d bytes 
explorerframe.dll!CNscIconTask::_Extract()  + 0x1f bytes    
explorerframe.dll!CNscOverlayTask::InternalResumeRT()  + 0x31 bytes 
explorerframe.dll!CRunnableTask::Run()  + 0xa2 bytes    
shell32.dll!CShellTask::TT_Run()  + 0x5b bytes  
shell32.dll!CShellTaskThread::ThreadProc()  + 0x99 bytes    
shell32.dll!CShellTaskThread::s_ThreadProc()  + 0x1b bytes  
shlwapi.dll!_ExecuteWorkItemThreadProc@4()  + 0xe bytes 
ntdll.dll!_RtlpTpWorkCallback@8()  + 0xdf bytes 
ntdll.dll!_TppWorkerThread@4()  - 0x1185 bytes  
kernel32.dll!@BaseThreadInitThunk@12()  + 0x12 bytes    
ntdll.dll!___RtlUserThreadStart@8()  + 0x27 bytes   
ntdll.dll!__RtlUserThreadStart@8()  + 0x1b bytes    

似乎其他一些人也遇到过类似的问题:2011年的MSDN线程。

"我遇到的情况与打开公共对话框(8R2)时应用程序崩溃的情况相同。有时重新启动应用程序并重试会有所帮助。。有时不会。由于这种情况发生在来自不同供应商的几个应用程序上,所以更可能是常见对话框的问题">

"我想在这里插话一下,我们在2008 R2机器上也遇到了同样的问题。它可以是任何程序(我在Notepad.exe中见过一次)。当你查看事件查看器时,你会发现崩溃发生在公共对话框调用的不同模块中。它发生在32位程序和64位程序中。这种情况并非100%发生,而是大约50%。我们还没有看到何时以及为什么会发生这种情况的任何模式">

我们的假设是"打开文件"对话框试图从视频文件中获取一些缩略图信息,但视频解码器正在崩溃。

有其他人遇到这个问题吗?如果是,你能找出根本原因是什么吗?你知道为什么IsValidLinkInfo会出现访问违规吗?

我们有什么变通办法可以在这里申请吗?我们正计划尝试删除此特定文件类型(.ts)的文件关联。有什么方法可以告诉"打开文件"对话框不要创建缩略图吗?

更新:

我们在ServerFault上发现另一个线程报告了类似的问题("通常,当您单击File/Open或File/Save时,它会崩溃,但不是每次都会崩溃")。另一位用户(PG)根据微软的建议,将该应用程序排除在数据执行预防之外,从而解决了问题。

我们检查了数据执行保护设置,发现它被设置为"为除我选择的程序和服务之外的所有程序和服务打开DEP"。将其更改为"仅为重要的Windows程序和服务启用DEP"后,问题不再发生。

最新更新