On Thu Nov 28 10:51:44 2024 +0000, Sven Baars wrote:
The problem seems to be twofold. The first problem is that `__wine_set_user_driver( NULL )` doesn't do anything because of `prev = InterlockedCompareExchangePointer( (void **)&user_driver, driver, (void *)&lazy_load_driver );`. We could replace that with
if (!funcs) prev = InterlockedExchangePointer( (void **)&user_driver, driver ); else prev = InterlockedCompareExchangePointer( (void **)&user_driver, driver, (void *)&lazy_load_driver );
but then we run into a second problem, which seems to be that we never call `load_driver()` before using the driver. I can fix this issue by adding
if (!funcs) send_message( get_desktop_window(), WM_NULL, 0, 0 );
to `__wine_set_user_driver` (this is usually done in `load_desktop_driver`). I'm unsure of how exactly that fixes the issue though. Setting the driver back to the `lazy_load_driver` seemed like a safer option.
Note that right after setting the driver back to the lazy driver, it is still set to the null driver, but then following the usual `load_driver() -> load_desktop_driver()` path.