Skip to content

msxml3: generate 64-bit msxml3r.dll resource stub for win64 prefixes#2497

Open
SurenIV wants to merge 1 commit intoWinetricks:masterfrom
SurenIV:fix/msxml3r-x64
Open

msxml3: generate 64-bit msxml3r.dll resource stub for win64 prefixes#2497
SurenIV wants to merge 1 commit intoWinetricks:masterfrom
SurenIV:fix/msxml3r-x64

Conversation

@SurenIV
Copy link
Copy Markdown
Contributor

@SurenIV SurenIV commented Mar 24, 2026

Replaces #2231 with a different approach.

The current load_msxml3() installs the 32-bit msxml3r.dll (resource-only DLL) from msxml3.msi (SP7), and then updates msxml3.dll itself to the SP11 version from win7sp1 for both architectures. However, the 64-bit msxml3r.dll is never installed:

  • msxml3.msi (SP7) only contains the 32-bit version
  • win7sp1 cab does not include msxml3r.dll
  • No publicly available Microsoft update (KB973687, KB2939576, KB3125574 convenience rollup) contains the 64-bit msxml3r.dll for Windows 7 x64

After winetricks msxml3 in a win64 prefix:

  • syswow64/msxml3r.dll — present (32-bit, from msxml3.msi)
  • system32/msxml3r.dll — missing (64-bit)

Without the 64-bit msxml3r.dll, the native msxml3.dll fails to load as a COM server:
err:ole:apartment_add_dll couldn't load in-process dll L"C:\windows\system32\msxml3.dll"

On Windows 7, msxml3r.dll is a 2 KB MUI stub (part of the OS image, not distributed in any update). The actual string resources are in en-US/msxml3r.dll.mui (43 KB). I verified this by extracting both files from a Windows 7 SP1 x64 install.wim.

According to Microsoft's https://learn.microsoft.com/en-us/previous-versions/troubleshoot/msxml/list-of-xml-parser-versions, msxml3r.dll was shipped with MSXML 3.0 through SP11 (version 8.110.7600.16385). The final version (Post SP11, 8.110.7600.16605) no longer ships msxml3r.dll — resources were embedded into the main DLL.

The 64-bit msxml3r.dll contains only two resources:

  • MUI resource (NAMED "MUI") — a Multilingual User Interface stub that tells Windows which resource types (RT_STRING, RT_MESSAGETABLE, RT_VERSION) are language-dependent
  • RT_VERSION — standard version information

The native msxml3.dll checks for a valid msxml3r.dll during DllMain initialization. If the file is missing or has an invalid PE resource structure, DllMain returns FALSE and the DLL is unloaded.

Since there is no publicly available download source for this file, this PR generates a minimal 64-bit PE32+ resource-only DLL at install time using base64 (part of coreutils, already used indirectly by winetricks). The generated DLL (2048 bytes, 2732 chars base64) contains:

  • Valid PE32+ headers with DOS stub
  • MUI resource stub indicating RT_STRING, RT_MESSAGETABLE, and RT_VERSION as language-dependent resource types
  • VERSION_INFO with version 8.110.7600.16385 matching the win7sp1 msxml3.dll

The DLL is not a copy of any Microsoft binary — it was generated from scratch following the https://learn.microsoft.com/en-us/windows/win32/debug/pe-format and https://learn.microsoft.com/en-us/windows/win32/intl/multilingual-user-interface. VERSION_INFO metadata uses "Wine Project" as CompanyName and "Generated for Wine compatibility" as LegalCopyright.

generate_msxml3r.py

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.

1 participant