[Mono-dev] Marshal Variable length structure Array in Mono

Robert Jordan robertj at gmx.net
Tue Sep 6 06:50:09 EDT 2005


Hi Kornél,

> I think this is not the case that Jordan mentioned. EnumPrinterDrivers and

It's actually Robert ;-)

> EnumPrinters return an array of fixed size structures. The size of
> structures depend on Level parameter but all of them have the same size.

Indeed, variable length != variable count.
But the returned structures must be manually marshaled:

http://www.pinvoke.net/default.aspx/winspool.EnumPrinters

Rob


> 
> Kornél
> 
> ----- Original Message -----
> From: "Robert Jordan" <robertj at gmx.net>
> To: <mono-devel-list at lists.ximian.com>
> Sent: Tuesday, September 06, 2005 11:29 AM
> Subject: Re: [Mono-dev] Marshal Variable length structure Array in Mono
> 
> 
>> Hi Jonathan,
>>
>>> Quick question: does anybody know of a "standard" Win32, POSIX, or
>>> GLib/GTK/Gnome-related function that uses variable length structures?
>>> I'd like to use one as a canonical example in the Marshaling guide:
>>>
>>> http://www.mono-project.com/Interop_with_Native_Libraries
>>
>>
>> Win32: The horrible Printer API: EnumPrinterDrivers, EnumPrinters, ...
>>
>> Rob
>>
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>




More information about the Mono-devel-list mailing list