fix(dgw): resolve WER APIs dynamically to support Windows Server 2016#1751
Conversation
Let maintainers know that an action is required on their side
|
0011fe6 to
7c7b5f9
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes DevolutionsGateway startup failures on older Windows Server 2016 builds by removing a static import of WER APIs that may not exist on those systems, and replacing it with runtime resolution.
Changes:
- Replace static WER imports with runtime
GetProcAddresslookup cached viaOnceLock. - Adjust Windows vs Linux tests to account for best-effort WER dump exclusion on Windows Server 2016 RTM.
- Update
secure-memoryWindows crate feature flags to dropWin32_System_ErrorReportingand addWin32_System_LibraryLoader.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
crates/secure-memory/src/windows.rs |
Dynamically resolves WER exclusion APIs at runtime to avoid loader failures on WinServer 2016 RTM. |
crates/secure-memory/src/lib.rs |
Updates platform expectations in tests: Linux still expects Full protection; Windows validates core protections without requiring dump exclusion. |
crates/secure-memory/Cargo.toml |
Swaps Windows feature flags to support dynamic symbol lookup (LibraryLoader) instead of static ErrorReporting imports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7c7b5f9 to
f714a65
Compare
`WerRegisterExcludedMemoryBlock` is absent from `wer.dll` on Windows Server 2016 RTM (NT 10.0.14393). The static import introduced in v2026.1.1 caused the Windows loader to refuse starting DevolutionsGateway.exe on those hosts with a "procedure entry point not found" error. Replace the static import with runtime resolution via `GetModuleHandleW` and `GetProcAddress`, cached in a `OnceLock`. The binary now starts on any Windows 10/Server 2016 build and silently skips WER dump exclusion when the API is unavailable; all other protections (guard pages, `VirtualLock`, `PAGE_READONLY`) still apply.
f714a65 to
8d7e239
Compare
WerRegisterExcludedMemoryBlockis absent fromwer.dllon Windows Server 2016 RTM (NT 10.0.14393). The static import introduced in v2026.1.1 caused the Windows loader to refuse starting DevolutionsGateway.exe on those hosts with a "procedure entry point not found" error.Replace the static import with runtime resolution via
GetModuleHandleWandGetProcAddress, cached in aOnceLock. The binary now starts on any Windows 10/Server 2016 build and silently skips WER dump exclusion when the API is unavailable; all other protections (guard pages,VirtualLock,PAGE_READONLY) still apply.Issue: DGW-368