Commit 57f83897 authored by krasimir's avatar krasimir
Browse files

[project @ 2002-03-29 20:46:50 by krasimir]

Latest Win32 implementation allows dynamic loading only for *.dll libraries. This commit add checking for *.drv libraries (drivers). This allows loading of winspool.drv needed for ObjectIO
parent 2dbdd850
/* -----------------------------------------------------------------------------
* $Id: Linker.c,v 1.84 2002/03/25 05:21:19 sof Exp $
* $Id: Linker.c,v 1.85 2002/03/29 20:46:50 krasimir Exp $
*
* (c) The GHC Team, 2000, 2001
*
......@@ -517,11 +517,17 @@ addDLL ( __attribute((unused)) char* path, char* dll_name )
buf = stgMallocBytes(strlen(dll_name) + 10, "addDLL");
sprintf(buf, "%s.DLL", dll_name);
instance = LoadLibrary(buf);
free(buf);
if (instance == NULL) {
sprintf(buf, "%s.DRV", dll_name); // KAA: allow loading of drivers (like winspool.drv)
instance = LoadLibrary(buf);
if (instance == NULL) {
free(buf);
/* LoadLibrary failed; return a ptr to the error msg. */
return "addDLL: unknown error";
}
}
free(buf);
o_dll = stgMallocBytes( sizeof(OpenedDLL), "addDLL" );
o_dll->name = stgMallocBytes(1+strlen(dll_name), "addDLL");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment