From 9d075c0f5c958becf8fe661b8c2877115501f044 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Tue, 1 Mar 2016 20:11:57 +0100
Subject: kernel32: Set ERROR_DLL_NOT_FOUND as error code for Win 9X instead of
 ERROR_MOD_NOT_FOUND.

---
 dlls/kernel32/module.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/kernel32/module.c b/dlls/kernel32/module.c
index dac66c1..badfe1d 100644
--- a/dlls/kernel32/module.c
+++ b/dlls/kernel32/module.c
@@ -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 );
-- 
2.7.1

