From 65da5070c105e58bddb8033269a2b3f974fec7b6 Mon Sep 17 00:00:00 2001 From: Dave Lane <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:44:54 -0500 Subject: [PATCH 1/2] fix(build): link the Windows display client to OneCore The Windows SDK exposes CompareObjectHandles through OneCore.lib. Use the same import library for MSVC and MinGW so the Windows unit tests and driver tools link on the stock Windows SDK. --- src/driver/CMakeLists.txt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/driver/CMakeLists.txt b/src/driver/CMakeLists.txt index 8ca0f3e..1450180 100644 --- a/src/driver/CMakeLists.txt +++ b/src/driver/CMakeLists.txt @@ -17,13 +17,8 @@ if(LIBVIRTUALDISPLAY_ENABLE_FRAME_TRANSPORT) endif() if(WIN32) - target_link_libraries(${MODULE} PRIVATE setupapi d3d11 dxgi) - if(MINGW) - # MinGW ships CompareObjectHandles in libonecore.a, not libkernelbase.a. - target_link_libraries(${MODULE} PRIVATE onecore) - else() - target_link_libraries(${MODULE} PRIVATE kernelbase) - endif() + # The Windows SDK and MinGW both provide CompareObjectHandles through OneCore. + target_link_libraries(${MODULE} PRIVATE setupapi d3d11 dxgi onecore) endif() if(CMAKE_SYSTEM_NAME STREQUAL "Linux") From ccd0eb2b717338925df07e340080a491f83db502 Mon Sep 17 00:00:00 2001 From: Dave Lane <42013603+ReenigneArcher@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:55:30 -0500 Subject: [PATCH 2/2] fix(build): declare the IddCx monitor lookup return type MSVC must know the helper's return type when compiling the earlier cursor callbacks. Return the monitor map iterator explicitly. --- src/driver/windows_driver/driver_main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/driver/windows_driver/driver_main.cpp b/src/driver/windows_driver/driver_main.cpp index dd630c7..deef22e 100644 --- a/src/driver/windows_driver/driver_main.cpp +++ b/src/driver/windows_driver/driver_main.cpp @@ -3443,7 +3443,18 @@ namespace { } } - auto find_current_monitor_locked(const std::uint64_t display_id, const IDDCX_MONITOR monitor) { + /** + * @brief Find the current record for an IddCx monitor handle. + * + * @param display_id Display identifier associated with the handle. + * @param monitor IddCx monitor handle to match. + * @return The matching record, or the end iterator if the handle is stale or unknown. + * @pre The caller holds the monitor mutex. + */ + std::map::iterator find_current_monitor_locked( + const std::uint64_t display_id, + const IDDCX_MONITOR monitor + ) { const auto record = monitors_.find(display_id); if (record == monitors_.end() || record->second.monitor != monitor) { return monitors_.end();