Commit 364df148 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ntoskrnl: Forbid unloading a driver with running root PnP devices.

parent 5bf72a75
......@@ -3842,6 +3842,7 @@ error:
NTSTATUS WINAPI ZwUnloadDriver( const UNICODE_STRING *service_name )
{
struct wine_rb_entry *entry;
struct wine_driver *driver;
UNICODE_STRING drv_name;
TRACE( "(%s)\n", debugstr_us(service_name) );
......@@ -3856,6 +3857,13 @@ NTSTATUS WINAPI ZwUnloadDriver( const UNICODE_STRING *service_name )
ERR( "failed to locate driver %s\n", debugstr_us(service_name) );
return STATUS_OBJECT_NAME_NOT_FOUND;
}
driver = WINE_RB_ENTRY_VALUE( entry, struct wine_driver, entry );
if (!list_empty( &driver->root_pnp_devices ))
{
ERR( "cannot unload driver %s which still has running PnP devices\n", debugstr_us(service_name) );
return STATUS_UNSUCCESSFUL;
}
unload_driver( entry, NULL );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment