<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>We require <i>some </i>degree of C interop, so we require <i>some </i>degree of predictable layout.<br>What we have falls below my expectations, but perhaps if it is explained to me, it won't any longer.<br>Well, I guess we don't really require any predictable layout. I can give up on records for any interop and rely strictly on integer and pointer parameters. Or, well, I can do like for Posix and use a small copying layer and smush out anything vaguely unclear like this...<br><br> - Jay<br><br><br><div>> Date: Sun, 1 Sep 2013 17:07:31 -0500<br>> From: rodney_bates@lcwb.coop<br>> To: m3devel@elegosoft.com<br>> Subject: Re: [M3devel] another size/alignment/interop problem..<br>> <br>> <br>> <br>> On 08/31/2013 10:05 PM, Jay K wrote:<br>> >   TYPE FILETIME = RECORD<br>> >      dwLowDateTime : uint32_t;<br>> >      dwHighDateTime: uint32_t;<br>> >    END;<br>> ><br>> >    BY_HANDLE_FILE_INFORMATION = RECORD<br>> >      dwFileAttributes    : uint32_t;<br>> >      ftCreationTime      : FILETIME; (* This should be at offset 4 but is 8 on  64bit systems. *)<br>> >      (* the rest omitted *)<br>> >    END;<br>> ><br>> ><br>> > Why doesn't that just work?<br>> <br>> The only explanation I can think of is that the compiler gave record type FILETIME<br>> 64-bit alignment.  As far as I know, there is nothing in the language that says it<br>> is not perfectly within its rights to do so.  Why is another question.<br>> <br>> <br>> > It works with:<br>> >   TYPE FILETIME = BITS 64 FOR RECORD<br>> ><br>> <br>> Which is consistent with the language, if it doesn't refuse altogether.<br>> ><br>> >   but imho it should work without that.<br>> ><br>> ><br>> >    - Jay<br>> ><br>> ><br>> <br></div>                                      </div></body>
</html>