win32u: Allow drivers to set the null user driver.

Allow passing NULL as the user driver to __wine_set_user_driver(),
to set the internal null user driver. This is useful for drivers
that may need to tentatively set their own user driver during setup
and reset it on failure.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
This commit is contained in:
Alexandros Frantzis 2023-02-28 19:22:54 +02:00 committed by Alexandre Julliard
parent 50c1b1974f
commit 243c19098e

View file

@ -1241,7 +1241,7 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version
}
driver = malloc( sizeof(*driver) );
*driver = *funcs;
*driver = funcs ? *funcs : null_user_driver;
#define SET_USER_FUNC(name) \
do { if (!driver->p##name) driver->p##name = nulldrv_##name; } while(0)