ntdll: Only add a module dependency if import_dll() returned a modref.

In particular, if import_dll() skips an unused import, it will return TRUE,
but set *pwm to NULL. This fixes a regression in 3DMark03 version 3.4.0,
introduced by commit 0dd37b02f9.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2021-11-18 18:52:20 +01:00 committed by Alexandre Julliard
parent 6944dc5189
commit deff68bb72
1 changed files with 1 additions and 1 deletions

View File

@ -1282,7 +1282,7 @@ static NTSTATUS fixup_imports( WINE_MODREF *wm, LPCWSTR load_path )
imp = NULL; imp = NULL;
status = STATUS_DLL_NOT_FOUND; status = STATUS_DLL_NOT_FOUND;
} }
else if (!is_import_dll_system( &wm->ldr, &imports[i] )) else if (imp && !is_import_dll_system( &wm->ldr, &imports[i] ))
{ {
add_module_dependency_after( wm->ldr.DdagNode, imp->ldr.DdagNode, dep_after ); add_module_dependency_after( wm->ldr.DdagNode, imp->ldr.DdagNode, dep_after );
} }