[racket] ffi: handling return values in arguments?

From: John Clements (clements at brinckerhoff.org)
Date: Tue Nov 16 12:24:04 EST 2010

On Nov 16, 2010, at 9:09 AM, Altenburg, Robert wrote:

> This is probably a simple question, but I can't seem
> to make this work:
> The Windows SDK defines the following function:
> NET_API_STATUS NetWkstaGetInfo(
>  __in   LPWSTR servername,
>  __in   DWORD level,
>  __out  LPBYTE *bufptr
> );
> In this case "bufptr" points to a structure allocated by
> the system that contains the results.
> How does one indicate this to get-ffi-obj, and get the
> returned value from the buffer?

I could be wrong, but it looks like this is a standard use of the "o" style parameter; the ffi interface will allocate it for you at call time, and you can retrieve the contents after the call returns.

Apologies if I'm misunderstanding your request.  


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4669 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20101116/a9b60d0f/attachment.p7s>

Posted on the users mailing list.