--- "William A. Rowe, Jr." <[EMAIL PROTECTED]>
wrote:

> Actually, you declared an empty struct, not an
> opaque one.
> 
> Try
> 
>     struct apr_table_t {
>         char foo[];
>     }
> 
> to declare a structure of indeterminant size.

All that does is cause an extra compiler warning:

warning C4200: nonstandard extension used : zero-sized
array in struct/union
Cannot generate copy-ctor or copy-assignment operator
when UDT contains a zero-sized array

and ILDASM shows that in both cases you get the same
CLI type:

.class public sequential ansi sealed apr_table_t
       extends [mscorlib]System.ValueType
{
  .pack 1
  .size 1
... some attributes deleted
} // end of class apr_table_t

I don't think structure size can possibly matter
because, if any marshalling of value type (as
described in MSDN) was going on here, I can not
imagine how anything could possibly work.

MSDN also mentions that pointers to structures inside
structures with known layout are marshalled as IntPtr.

That seems to be our case with request_rec and,
apparently, compiler gets confused when members of
request_rec (rather than request_rec pointer itself)
are passed as parameters to native functions.

That's my theory anyway.

Tony


                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250

Reply via email to