Changed some error handling a bit.

This commit is contained in:
Alexandre Julliard 1999-05-12 10:15:41 +00:00
parent bcb4bb6931
commit b6ecb9a2ab

View File

@ -211,8 +211,11 @@ FARPROC PE_FindExportedFunction(
assert(end-forward<256); assert(end-forward<256);
strncpy(module, forward, (end - forward)); strncpy(module, forward, (end - forward));
module[end-forward] = 0; module[end-forward] = 0;
wm = MODULE_FindModule( module ); if (!(wm = MODULE_FindModule( module )))
assert(wm); {
ERR_(win32)("module not found for forward '%s'\n", forward );
return NULL;
}
return MODULE_GetProcAddress( wm->module, end + 1, snoop ); return MODULE_GetProcAddress( wm->module, end + 1, snoop );
} }
return NULL; return NULL;
@ -238,8 +241,7 @@ DWORD fixup_imports( WINE_MODREF *wm )
/* first, count the number of imported non-internal modules */ /* first, count the number of imported non-internal modules */
pe_imp = pem->pe_import; pe_imp = pem->pe_import;
if (!pe_imp) if (!pe_imp) return 0;
ERR_(win32)("no import directory????\n");
/* We assume that we have at least one import with !0 characteristics and /* We assume that we have at least one import with !0 characteristics and
* detect broken imports with all characteristsics 0 (notably Borland) and * detect broken imports with all characteristsics 0 (notably Borland) and
@ -252,6 +254,7 @@ DWORD fixup_imports( WINE_MODREF *wm )
break; break;
i++; i++;
} }
if (!i) return 0; /* no imports */
/* Allocate module dependency list */ /* Allocate module dependency list */
wm->nDeps = i; wm->nDeps = i;