kernel32: Set ERROR_DLL_NOT_FOUND as error code in load_library for Win 9x compatibility.

Newer operating systems return ERROR_MOD_NOT_FOUND.

Signed-off-by: Michael Müller <michael@fds-team.de>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Müller 2016-03-31 06:04:14 +02:00 committed by Alexandre Julliard
parent 11f6df13eb
commit bd17022c90
1 changed files with 4 additions and 1 deletions

View File

@ -948,7 +948,10 @@ static HMODULE load_library( const UNICODE_STRING *libname, DWORD flags )
if (nts != STATUS_SUCCESS)
{
hModule = 0;
SetLastError( RtlNtStatusToDosError( nts ) );
if (nts == STATUS_DLL_NOT_FOUND && (GetVersion() & 0x80000000))
SetLastError( ERROR_DLL_NOT_FOUND );
else
SetLastError( RtlNtStatusToDosError( nts ) );
}
done:
HeapFree( GetProcessHeap(), 0, load_path );