Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 29, 2025

QuickLook crashes when run with different privilege levels than Directory Opus or MultiCommander due to Windows UIPI blocking WM_COPYDATA messages, leaving XML buffer uninitialized and triggering RapidXML assertion at line 1405.

Changes

DOpus.cpp

  • Initialize pXmlBuffer = nullptr to prevent uninitialized access
  • Validate buffer non-null before XML parsing and cleanup
  • Add null/size checks in WM_COPYDATA handler before allocation
  • Define MAX_BUFFER_SIZE (10MB) to prevent memory exhaustion

MultiCommander.cpp

  • Add null check for pCurrentItemPath before dereferencing
  • Validate COPYDATASTRUCT in WM_COPYDATA handler
  • Apply same 10MB buffer size limit

Memory safety

  • Reset pointers to nullptr after deletion
  • Clean up existing buffers before new allocations
  • Prevent use-after-free and double-free scenarios

Example

// Before: crash on null buffer
doc.parse<0>(pXmlBuffer);  // Assert fails if UIPI blocks message

// After: graceful handling
if (pXmlBuffer == nullptr)
    return;
doc.parse<0>(pXmlBuffer);

Both integrations now gracefully handle IPC failures instead of crashing when privilege levels differ.

Original prompt

This section details on the original issue you should resolve

<issue_title>Error in Directory Opus</issue_title>
<issue_description>It gives me this error when I click preview on any file or even folders in Directory Opus.

Image


Microsoft Visual C++ Runtime Library

Assertion failed!

Program: ...Ta\Local\Programs\QuickLook\QuickLook.Native64.Dll
File: D:\GitHub\QuickLook\QuickLook.Native\Qui...\rapidxml.Hpp
Line: 1405

Expression: text


After many mistakes and suffering, I found out that this happens If one or the other program is running as an administrator.
I need to preview in Everything, which I need to run as an administrator. But if I run QuickLook as an administrator, I get an error in Directory Opus.</issue_description>

<agent_instructions>我也复现了只有当QL管理员启动用于Dpous会报错,不是管理员启动则不会!</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix error in Directory Opus preview feature Fix crash in Directory Opus/MultiCommander integration due to UIPI blocking WM_COPYDATA Oct 29, 2025
Copilot AI requested a review from emako October 29, 2025 14:07
Copilot finished work on behalf of emako October 29, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error in Directory Opus

2 participants