Commit 53ffeb67 authored by Alexandre Julliard's avatar Alexandre Julliard

winedevice: Add the drivers directory to the dll search path.

parent 5f19e9c3
......@@ -3691,7 +3691,7 @@ static HMODULE load_driver( const WCHAR *driver_name, const UNICODE_STRING *keyn
TRACE( "loading driver %s\n", wine_dbgstr_w(str) );
module = LoadLibraryExW( str, 0, LOAD_WITH_ALTERED_SEARCH_PATH );
module = LoadLibraryExW( str, 0, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS );
if (module && load_image_notify_routine_count)
{
......
......@@ -115,6 +115,7 @@ static DWORD WINAPI service_handler( DWORD ctrl, DWORD event_type, LPVOID event_
static void WINAPI ServiceMain( DWORD argc, LPWSTR *argv )
{
WCHAR driver_dir[MAX_PATH];
const WCHAR *service_group = (argc >= 2) ? argv[1] : argv[0];
if (!(stop_event = CreateEventW( NULL, TRUE, FALSE, NULL )))
......@@ -124,6 +125,10 @@ static void WINAPI ServiceMain( DWORD argc, LPWSTR *argv )
if (!(service_handle = RegisterServiceCtrlHandlerExW( winedeviceW, service_handler, (void *)service_group )))
return;
GetSystemDirectoryW( driver_dir, MAX_PATH );
wcscat( driver_dir, L"\\drivers" );
AddDllDirectory( driver_dir );
TRACE( "starting service group %s\n", wine_dbgstr_w(service_group) );
set_service_status( service_handle, SERVICE_RUNNING,
SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN );
......
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