Changeset 21604 for trunk/src


Ignore:
Timestamp:
Mar 24, 2011, 11:14:27 PM (14 years ago)
Author:
dmik
Message:

kernel32: Report ERROR_MOD_NOT_FOUND from LoadLibrary() when it fails to load a DLL due to missing import modules, to mimic Win32 behavior.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/oslibdos.cpp

    r21569 r21604  
    31783178  rc = DosLoadModule(name, CCHMAXPATH, szOemModName, &hModule);
    31793179  if(rc) {
    3180       SetLastError(error2WinError(rc,ERROR_FILE_NOT_FOUND));
     3180      dprintf(("DosLoadModule([%s]) failed with %d and [%s]",
     3181               szModName, rc, name));
     3182      if (rc == ERROR_FILE_NOT_FOUND &&
     3183          stricmp(szOemModName, name) != 0) {
     3184          // the DLL could not be loaded due to some missing import module;
     3185          // Win32 seems to report this with ERROR_MOD_NOT_FOUND, mimic this
     3186          // behavior
     3187          SetLastError(ERROR_MOD_NOT_FOUND);
     3188      } else {
     3189          SetLastError(error2WinError(rc,ERROR_FILE_NOT_FOUND));
     3190      }
    31813191      return 0;
    31823192  }
Note: See TracChangeset for help on using the changeset viewer.