Skip to content

Restore property copy and paste source state - #1026

Merged
Stephen Griffin (stephenegriffin) merged 10 commits into
mainfrom
investigate/570-property-copy-paste
Oct 22, 2026
Merged

Stephen Griffin (stephenegriffin) merged 10 commits into
mainfrom
investigate/570-property-copy-paste

Conversation

@stephenegriffin

Copy link
Copy Markdown
Member

Summary

Fixes #570.

Property copy stopped retaining the raw MAPI source object during the 2021 property-bag refactor, but Paste routing and menu enablement still required that object. This made hierarchy Paste silently do nothing and disabled property-pane Paste.

  • Restore an independently owned source-object reference in the shared clipboard cache, preserving existing flags/getter contracts and row-only behavior.
  • Keep the source property bag alive across modal dialogs without releasing its borrowed MAPI pointer.
  • Use the existing single-property retrieval helper, free the result, and report missing/error-valued results instead of retagging and writing them.
  • Add nine permanent native regressions for cache readiness, ownership/lifetime, getter references, row-only sources, and attachment/property clipboard transitions.

Validation

  • Debug x64 and x86 builds pass.
  • All nine cache regressions pass on both architectures; six failed before the production fix.
  • 24 actual-handler x64 PST scenarios pass across hierarchy/base-dialog and property-menu Paste, absent/existing targets, CopyProps and GetProps/SetProps, both cancellation points, missing-source errors, and clipboard replacement during a modal dialog. Assertions include exact values after reopening the target, dialog/commit/SetProps/refresh counts, error notifications, and source-reference balance.
  • Four direct provider controls preserve exact binary data after reopening. Two stream probes explicitly return MAPI_E_INTERFACE_NOT_SUPPORTED and leave the target unchanged; they are not counted as successful copies.
  • clang-format 17 dry-run and git diff --check pass.
  • Temporary diagnostic profiles/PSTs were removed and cleanup verified; no normal profile, mailbox, or Windows clipboard was used.

Live provider/UI validation is limited to an isolated x64 PST. The older 2019 empty-value symptom and Exchange retention-policy behavior were not reproduced and are not claimed fixed. Copy defaults and stream behavior are unchanged.

Cache an owned MAPI source reference for property copy, preserve borrowed source ownership during paste, and handle property retrieval failures safely. Add nine cache ownership and clipboard-transition regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
macienMSFT
macienMSFT previously approved these changes Oct 21, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Test Results

    8 files  ±  0      8 suites  ±0   56s ⏱️ +4s
  316 tests + 13    316 ✅ + 13  0 💤 ±0  0 ❌ ±0 
2 528 runs  +104  2 528 ✅ +104  0 💤 ±0  0 ❌ ±0 

Results for commit f681b63. ± Comparison against base commit 9f4a0d0.

♻️ This comment has been updated with latest results.

Keep parallel execution and code coverage while collecting test sequences, minidumps and detailed logs after a two-minute hang. Bound the test step to eight minutes so artifacts can upload.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the exact UnitTest DLL and PDB beside test logs and minidumps so native stacks from hosted runners can be resolved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Guard empty property arrays before PpropFindProp and assert that cache regressions never trigger MAPI resolution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@stephenegriffin
Stephen Griffin (stephenegriffin) merged commit 552c33a into main Oct 22, 2026
21 checks passed
@stephenegriffin
Stephen Griffin (stephenegriffin) deleted the investigate/570-property-copy-paste branch October 22, 2026 20:00
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.

Cannot use MFCMAPI to copy and paste personal retention policy tags from one folder to another

2 participants