Skip to content

Conversation

@stephenegriffin
Copy link
Member

This pull request refactors and enhances how the code locates and prioritizes MAPI DLL paths, especially focusing on Outlook's olmapi32.dll. It introduces a preference flag for olmapi32.dll, improves the search order for MAPI DLLs, and generalizes the mechanism for finding Outlook-related components. The changes also add new configuration options and refactor related functions for clarity and maintainability.

These changes align with recent changes in mapi-rs to load MAPI in environments where New Outlook and 365 are installed, but Outlook desktop is not:
Support Office installations without requiring Outlook for MAPI detection

Enhancements to MAPI DLL path discovery and prioritization:

  • Added a global preference flag (s_fPreferOlmapi32) and a new function PreferOlmapi32 to allow prioritizing olmapi32.dll paths in the returned list of possible MAPI DLLs. (library/stubutils.cpp, library/stubutils.h) [1] [2] [3]
  • Refactored GetMAPIPaths to document and enforce a clear order of preference for MAPI DLL discovery, and to bubble olmapi32.dll paths to the top if the preference is set. (library/stubutils.cpp)

Generalization and refactoring of Outlook MAPI path lookup:

  • Replaced GetOutlookPath with a more flexible GetOLMAPI32Path function that iterates through a list of possible Outlook qualifiers to find the correct path to olmapi32.dll. (library/stubutils.cpp, library/stubutils.h) [1] [2]
  • Introduced a global vector g_OutlookQualifiers containing possible Outlook-related executables and DLLs to use as qualifiers for component lookup. (library/stubutils.cpp)
  • Updated related functions to use the new GetOLMAPI32Path mechanism, simplifying logic and improving maintainability. (library/stubutils.cpp)

@github-actions
Copy link

github-actions bot commented Sep 23, 2025

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit c9e47d6. ± Comparison against base commit 33740da.

♻️ This comment has been updated with latest results.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances MAPI DLL path discovery and prioritization by introducing better fallback mechanisms for finding olmapi32.dll. The changes improve support for Office installations without requiring Outlook desktop to be installed.

Key changes include:

  • Added preference system for prioritizing olmapi32.dll paths in MAPI DLL discovery
  • Refactored Outlook path lookup to use a flexible qualifier-based approach with multiple fallback options
  • Enhanced the search order documentation and implementation for better maintainability

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
library/stubutils.h Updated function signature from GetOutlookPath to GetOLMAPI32Path and added PreferOlmapi32 function declaration
library/stubutils.cpp Added qualifier vector, preference flag, refactored path lookup logic, and enhanced GetMAPIPaths with better ordering and olmapi32 prioritization

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@stephenegriffin stephenegriffin merged commit 9f41d04 into main Sep 24, 2025
17 checks passed
@stephenegriffin stephenegriffin deleted the u/sgriffin/monarch branch September 24, 2025 12:53
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.

3 participants