repairs for Windows 9x

svn: r3342
This commit is contained in:
Matthew Flatt 2006-06-12 19:04:51 +00:00
parent bc086b3e3c
commit ac5b92d5a3
2 changed files with 31 additions and 13 deletions

View File

@ -35,7 +35,7 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /DELAYLOAD:libmzschxxxxxxx.dll /DELAYLOAD:libmzgcxxxxxxx.dll"
AdditionalDependencies="delayimp.lib"
AdditionalDependencies="unicows.lib delayimp.lib"
OutputFile="..\..\..\$(ProjectName).exe"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
@ -104,7 +104,7 @@ cd ..\..\worksp\mzscheme
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 /DELAYLOAD:libmzschxxxxxxx.dll /DELAYLOAD:libmzgcxxxxxxx.dll"
AdditionalDependencies="delayimp.lib"
AdditionalDependencies="unicows.lib delayimp.lib"
OutputFile="..\..\..\$(ProjectName).exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"

View File

@ -1,22 +1,40 @@
#include <windows.h>
#include <stdio.h>
#ifdef LIBMZ_EXPORTS
# define MZ_EXTERN extern __declspec(dllexport)
#else
# define MZ_EXTERN extern __declspec(dllimport)
#endif
MZ_EXTERN char *scheme_get_dll_path(char *);
static int warned;
HMODULE LoadUnicowsProc(void)
{
char *s;
/* We can't use Unicode functions, so we can't
use the library path as returned by scheme_get_dll_path().
Instead, just search for UnicoWS.dll in the standard
place. */
HMODULE h;
char *name;
int i;
s = scheme_get_dll_path("UnicoWS.dll");
h = LoadLibrary("UnicoWS.dll");
if (h) return h;
return LoadLibrary(s);
name = (char *)GlobalAlloc(GMEM_FIXED, 1050);
GetModuleFileName(NULL, name, 1024);
name[1023] = 0;
for (i = 0; name[i]; i++) { }
--i;
while (i && (name[i] != '\\')) {
--i;
}
memcpy(name + i, "\\lib\\UnicoWS.dll", 17);
h = LoadLibrary(name);
if (h) return h;
if (!warned) {
warned = 1;
MessageBox(NULL, name, "Can't load UnicoWS", MB_OK);
}
return NULL;
}
extern FARPROC _PfnLoadUnicows = (FARPROC) &LoadUnicowsProc;