[plt-scheme] Simple ffi problem

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue Jun 27 21:04:45 EDT 2006

At Mon, 19 Jun 2006 07:49:59 -0600, Evan Farrer wrote:
> > Under Windows, I think #f searches only exports of the current
> > program's ".exe", whereas #f under Unix searches all shared libraries
> > that are part of the program.
> It appears that there has been some change in the behavior of how Windows 
> handles #f to ffi-lib.  Looking at mzlib/os.ss the truncate-file function does 
> a file security check via ffi before proceding the code that it uses is:
> (define msvcrt
>   (if (eq? 'windows (system-type))
>     (delay (ffi-lib "msvcrt"))
>     (delay #f)))
> I'm pretty sure that at one time this worked but it's currently broken.

I imagine it worked before I added the security check, and I forgot to
test after adding it.

I've changed v350.2 for Windows so that `(ffi-lib #f)' represents all
DLLs open in the process. So, the specific "msvcrt" lookup isn't needed
anymore, and the file-security-check function is also found correctly.


Posted on the users mailing list.