[cffi-devel] Re: corrupted foreign structure testcase with latest CFFI and LW 4.4.6

Jack Unrue jdunrue at gmail.com
Sun Jun 4 23:00:19 UTC 2006


OK, the mailing list manager scrubbed my other two attachments.
Here is the Lisp code inline:

(cffi:load-foreign-library "structs.dll")

(cffi:defcfun
  ("dump_blah" dump-blah)
  :void
  (ptr :pointer))

(cffi:defcstruct blah
  (cbsize    :unsigned-int)
  (style     :unsigned-int))

(defun dump-it ()
  (cffi:with-foreign-object (ptr 'blah)
    (cffi:with-foreign-slots ((cbsize style) ptr blah)
      (setf cbsize 4)
      (setf style #x01ABCDEF))
    (dump-blah ptr)))

-- 
Jack Unrue



More information about the cffi-devel mailing list