<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>[c#]need some help with p/invoke and unions</title>
		<link>http://www.allegro.cc/forums/view/601802</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 10 Oct 2009 01:23:32 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello,<br />I&#39;m having a play with binding the allegro5 dll to .net and am getting an odd error with my marshalling of the event unions.</p><p>&quot;Could not load type ...because it contains an object field at offset 0 that is incorrectly aligned or overlapped by a non-object field&quot;</p><p>I&#39;ve read elsewhere it&#39;s to do with value/reference types but I&#39;m not really sure how to fix it. I verified what I was doing using the P/Invoke interop Assistant and it was quite happy.</p><p>Basically, what is throwing me is it seems to be giving me the error based on the size of the struct items and not object/value type mixing as I&#39;ve read elsewhere:</p><p>I&#39;ve cut things down hugely to show the error:
</p><div class="source-code snippet"><div class="inner"><pre>   <span class="k2">[</span>StructLayout<span class="k2">(</span>LayoutKind.Explicit<span class="k2">)</span><span class="k2">]</span>
    <span class="k1">public</span> <span class="k1">struct</span> GAME_EVENT
    <span class="k2">{</span>
       <span class="k2">[</span>FieldOffsetAttribute<span class="k2">(</span><span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
       <span class="k1">public</span> <span class="k1">int</span> type<span class="k2">;</span>
       <span class="k2">[</span>FieldOffsetAttribute<span class="k2">(</span><span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
       <span class="k1">public</span> ANY_EVENT display<span class="k2">;</span>
       <span class="k2">[</span>FieldOffsetAttribute<span class="k2">(</span><span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
       <span class="k1">public</span> JOYSTICK_EVENT joystick<span class="k2">;</span>
    <span class="k2">}</span><span class="k2">;</span>
</pre></div></div><p>

If I remove JOYSTICK_EVENT then the code works. JOYSTICK_EVENT has more data values than ANY_EVENT and if I remove, say, an int from JOYSTICK_EVENT it also works.</p><p>ANY_EVENT is described as:
</p><div class="source-code snippet"><div class="inner"><pre>    <span class="k2">[</span>StructLayout<span class="k2">(</span>LayoutKind.Sequential<span class="k2">)</span><span class="k2">]</span>
    <span class="k1">public</span> <span class="k1">struct</span> ANY_EVENT
    <span class="k2">{</span>
        <span class="k1">public</span>   type<span class="k2">;</span>
        <span class="k1">public</span> EVENT_SOURCE source<span class="k2">;</span>
        <span class="k1">public</span> <span class="k1">double</span> timestamp<span class="k2">;</span>
    <span class="k2">}</span><span class="k2">;</span>
</pre></div></div><p>

and JOYSTICK_EVENT is described exactly the same but has an extra int (in reality it isn&#39;t but I&#39;ve managed to get it to fail like this):
</p><div class="source-code snippet"><div class="inner"><pre>    <span class="k2">[</span>StructLayout<span class="k2">(</span>LayoutKind.Sequential<span class="k2">)</span><span class="k2">]</span>
    <span class="k1">public</span> <span class="k1">struct</span> ANY_EVENT
    <span class="k2">{</span>
        <span class="k1">public</span>   type<span class="k2">;</span>
        <span class="k1">public</span> EVENT_SOURCE source<span class="k2">;</span>
        <span class="k1">public</span> <span class="k1">double</span> timestamp<span class="k2">;</span>
        <span class="k1">int</span> value<span class="k2">;</span>      <span class="c">// the new value</span>
    <span class="k2">}</span><span class="k2">;</span>
</pre></div></div><p>

When I run my code I get the error as detailed. If I remove &#39;int value&#39; it works fine.</p><p>If I remove EVENT_SOURCE then it seems to work. So I&#39;m a little confused as to exactly what the fault is!</p><p>EVENT_SOURCE is:
</p><div class="source-code snippet"><div class="inner"><pre>    <span class="k2">[</span>StructLayout<span class="k2">(</span>LayoutKind.Sequential<span class="k2">)</span><span class="k2">]</span>
    <span class="k1">public</span> <span class="k1">struct</span> EVENT_SOURCE
    <span class="k2">{</span>
        <span class="c">/// int[32]</span>
        <span class="k2">[</span>MarshalAsAttribute<span class="k2">(</span>UnmanagedType.ByValArray, SizeConst<span class="k3">=</span><span class="n">32</span>, ArraySubType<span class="k3">=</span>UnmanagedType.I4<span class="k2">)</span><span class="k2">]</span>
        <span class="k1">public</span> <span class="k1">int</span><span class="k2">[</span><span class="k2">]</span> @__pad<span class="k2">;</span>
    <span class="k2">}</span><span class="k2">;</span>
</pre></div></div><p>

Any help would be much appreciated. Thanks.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Fri, 09 Oct 2009 05:19:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The second field should be an IntPtr, not an actual structure, like so:</p><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span>  <span class="k2">[</span>StructLayout<span class="k2">(</span>LayoutKind.Sequential, Pack <span class="k3">=</span> <span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
<span class="number">  2</span>  <span class="k1">public</span> <span class="k1">struct</span> AllegroInternalEventHeader
<span class="number">  3</span>  <span class="k2">{</span>
<span class="number">  4</span>    <span class="k1">public</span> uint type<span class="k2">;</span>
<span class="number">  5</span>    <span class="k1">public</span> IntPtr source<span class="k2">;</span>
<span class="number">  6</span>    <span class="k1">public</span> <span class="k1">double</span> timestamp<span class="k2">;</span>
<span class="number">  7</span>  <span class="k2">}</span>
<span class="number">  8</span>
<span class="number">  9</span>  <span class="k2">[</span>StructLayout<span class="k2">(</span>LayoutKind.Sequential, Pack <span class="k3">=</span> <span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
<span class="number"> 10</span>  <span class="k1">public</span> <span class="k1">struct</span> AllegroInternalDisplayEvent
<span class="number"> 11</span>  <span class="k2">{</span>
<span class="number"> 12</span>    <span class="k1">public</span> AllegroInternalEventHeader header<span class="k2">;</span>
<span class="number"> 13</span>    <span class="k1">public</span> <span class="k1">int</span> x, y<span class="k2">;</span>
<span class="number"> 14</span>    <span class="k1">public</span> <span class="k1">int</span> width, height<span class="k2">;</span>
<span class="number"> 15</span>  <span class="k2">}</span>
<span class="number"> 16</span>
<span class="number"> 17</span>  <span class="k2">[</span>StructLayout<span class="k2">(</span>LayoutKind.Sequential, Pack <span class="k3">=</span> <span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
<span class="number"> 18</span>  <span class="k1">public</span> <span class="k1">struct</span> AllegroInternalJoystickEvent
<span class="number"> 19</span>  <span class="k2">{</span>
<span class="number"> 20</span>    <span class="k1">public</span> AllegroInternalEventHeader header<span class="k2">;</span>
<span class="number"> 21</span>    <span class="k1">public</span> <span class="k1">int</span> stick<span class="k2">;</span>
<span class="number"> 22</span>    <span class="k1">public</span> <span class="k1">int</span> axis<span class="k2">;</span>
<span class="number"> 23</span>    <span class="k1">public</span> <span class="k1">float</span> pos<span class="k2">;</span>
<span class="number"> 24</span>    <span class="k1">public</span> <span class="k1">int</span> button<span class="k2">;</span>
<span class="number"> 25</span>  <span class="k2">}</span>
<span class="number"> 26</span>
<span class="number"> 27</span>  <span class="k2">[</span>StructLayout<span class="k2">(</span>LayoutKind.Sequential, Pack <span class="k3">=</span> <span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
<span class="number"> 28</span>  <span class="k1">public</span> <span class="k1">struct</span> AllegroInternalKeyboardEvent
<span class="number"> 29</span>  <span class="k2">{</span>
<span class="number"> 30</span>    <span class="k1">public</span> AllegroInternalEventHeader header<span class="k2">;</span>
<span class="number"> 31</span>    <span class="k1">public</span> IntPtr display<span class="k2">;</span>
<span class="number"> 32</span>    <span class="k1">public</span> <span class="k1">int</span> keycode<span class="k2">;</span>
<span class="number"> 33</span>    <span class="k1">public</span> uint unichar<span class="k2">;</span>
<span class="number"> 34</span>    <span class="k1">public</span> uint modifiers<span class="k2">;</span>
<span class="number"> 35</span>  <span class="k2">}</span>
<span class="number"> 36</span>
<span class="number"> 37</span>  <span class="k2">[</span>StructLayout<span class="k2">(</span>LayoutKind.Sequential, Pack <span class="k3">=</span> <span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
<span class="number"> 38</span>  <span class="k1">public</span> <span class="k1">struct</span> AllegroInternalMouseEvent
<span class="number"> 39</span>  <span class="k2">{</span>
<span class="number"> 40</span>    <span class="k1">public</span> AllegroInternalEventHeader header<span class="k2">;</span>
<span class="number"> 41</span>    <span class="k1">public</span> IntPtr display<span class="k2">;</span>
<span class="number"> 42</span>    <span class="k1">public</span> <span class="k1">int</span> x, y, z, w<span class="k2">;</span>
<span class="number"> 43</span>    <span class="k1">public</span> <span class="k1">int</span> dx, dy, dz, dw<span class="k2">;</span>
<span class="number"> 44</span>    <span class="k1">public</span> uint button<span class="k2">;</span>
<span class="number"> 45</span>  <span class="k2">}</span>
<span class="number"> 46</span>
<span class="number"> 47</span>  <span class="k2">[</span>StructLayout<span class="k2">(</span>LayoutKind.Sequential, Pack <span class="k3">=</span> <span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
<span class="number"> 48</span>  <span class="k1">public</span> <span class="k1">struct</span> AllegroInternalTimerEvent
<span class="number"> 49</span>  <span class="k2">{</span>
<span class="number"> 50</span>    <span class="k1">public</span> AllegroInternalEventHeader header<span class="k2">;</span>
<span class="number"> 51</span>    <span class="k1">public</span> <span class="k1">long</span> count<span class="k2">;</span>
<span class="number"> 52</span>    <span class="k1">public</span> <span class="k1">double</span> error<span class="k2">;</span>
<span class="number"> 53</span>  <span class="k2">}</span>
<span class="number"> 54</span>
<span class="number"> 55</span>  <span class="k2">[</span>StructLayout<span class="k2">(</span>LayoutKind.Explicit, Pack <span class="k3">=</span> <span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
<span class="number"> 56</span>  <span class="k1">public</span> <span class="k1">struct</span> AllegroInternalEvent
<span class="number"> 57</span>  <span class="k2">{</span>
<span class="number"> 58</span>    <span class="k2">[</span>FieldOffset<span class="k2">(</span><span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
<span class="number"> 59</span>    <span class="k1">public</span> uint type<span class="k2">;</span>
<span class="number"> 60</span>
<span class="number"> 61</span>    <span class="k2">[</span>FieldOffset<span class="k2">(</span><span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
<span class="number"> 62</span>    <span class="k1">public</span> AllegroInternalEventHeader any<span class="k2">;</span>
<span class="number"> 63</span>
<span class="number"> 64</span>    <span class="k2">[</span>FieldOffset<span class="k2">(</span><span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
<span class="number"> 65</span>    <span class="k1">public</span> AllegroInternalDisplayEvent display<span class="k2">;</span>
<span class="number"> 66</span>
<span class="number"> 67</span>    <span class="k2">[</span>FieldOffset<span class="k2">(</span><span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
<span class="number"> 68</span>    <span class="k1">public</span> AllegroInternalJoystickEvent joystick<span class="k2">;</span>
<span class="number"> 69</span>
<span class="number"> 70</span>    <span class="k2">[</span>FieldOffset<span class="k2">(</span><span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
<span class="number"> 71</span>    <span class="k1">public</span> AllegroInternalKeyboardEvent keyboard<span class="k2">;</span>
<span class="number"> 72</span>
<span class="number"> 73</span>    <span class="k2">[</span>FieldOffset<span class="k2">(</span><span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
<span class="number"> 74</span>    <span class="k1">public</span> AllegroInternalMouseEvent mouse<span class="k2">;</span>
<span class="number"> 75</span>
<span class="number"> 76</span>    <span class="k2">[</span>FieldOffset<span class="k2">(</span><span class="n">0</span><span class="k2">)</span><span class="k2">]</span>
<span class="number"> 77</span>    <span class="k1">public</span> AllegroInternalTimerEvent timer<span class="k2">;</span>
<span class="number"> 78</span>  <span class="k2">}</span>
</div></div><p>

That&#39;s how I wrap Allegro 5 WIP events in my game.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Erin Maus)</author>
		<pubDate>Fri, 09 Oct 2009 05:43:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ll try that, thanks. I use IntPtr in most places but I wanted to recreate the structs wherever it was possible. Regarding this error, what&#39;s the reason behind not being allowed to do this, and is there no way round it?</p><p>Also, without EVENT_SOURCE how did you do stuff like:<br /><span class="source-code"><span class="k1">public</span> <span class="k1">static</span> <span class="k1">extern</span> <span class="k1">void</span> al_init_user_event_source<span class="k2">(</span>ref ALLEGRO_EVENT_SOURCE src<span class="k2">)</span><span class="k2">;</span></span></p><p>Did you just use IntPtr as well? I was just trying to add some readability to the code where possible. I was even tempted to edit the allegro code and make the union just one big struct <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Fri, 09 Oct 2009 13:02:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Neil, a little bit of critique:</p><ul><li><p>Try to name your stuff by .NET standards; not Allegro standards. (PascalCase for public/protected members, camelCase for private members.)
</p></li><li><p>Use [DllImport(EntryPoint=&quot;foo&quot;)] rather than naming your methods awkwardly. Especially, use a constant for the name of the DLL, so that if it changes you only have to change it in one spot.
</p></li><li><p>Do [MarshalAs], not [MarshalAsAttribute].
</p></li><li><p>You don&#39;t have to specify [StructLayout(LayoutKind.Sequential)] for structs; they are sequential by default.
</p></li><li><p>Avoid specifying field offsets. It is unnecessary for almost all cases and burdens the code with more things that could change or just be incorrect.
</p></li><li><p>Your C#-side objects should be classes, and should behave like classes.
</p></li><li><p>Especially for resources like Bitmaps, they should implement IDisposable and have an appropriate finalizer.
</p></li><li><p>Use structs as memory blocks to communicate with the C-side.
</p></li><li><p>Follow the .NET guidelines for structs wherever possible -- ie. structs should be immutable.
</p></li><li><p>You can specify [StructLayout] for classes, and when marshalled, classes are passed as if they were by-ref structs.
</p></li><li><p>Read about [In] and [Out] as well as default marshaling for the out keyword, if you haven&#39;t already.
</p></li><li><p>Look out for callbacks, they can be complicated. You need the [UnmanagedFunctionPointer] attribute on your delegate type, and you generally need to specify the calling convention too. (Which you will only find out is incorrect if the callback has parameters.)
</p></li><li><p>If two C# objects refer to the same C resource, make sure that they are kept in sync.
</p></li><li><p>Use an IntPtr for anything that is opaque from the C# side.
</p></li></ul></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kibiz0r)</author>
		<pubDate>Fri, 09 Oct 2009 20:39:55 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks, there&#39;s so much to learn with p/invoke <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/601802/832638#target">Kibiz0r</a> said:</div><div class="quote"><p>Read about [In] and [Out]</p></div></div><p>Do have any good sources, this is something I&#39;ve seen a fair bit in code but have been unable to find any reference on the internet whatsoever to explain it as I find it impossible to construct a search to give me anything useful.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Try to name your stuff by .NET standards</p></div></div><p>I appreciate what you&#39;re saying and I do follow standards, but my goal in this instance was to make a direct equivalent where with minimal changes code could easily be written and ported. Otherwise you&#39;d end up with effectively a new library. What I plan on doing (if all works and the speed is sufficient in the bindings) add a proper class library around it. The only real concession I&#39;ve made to this api equivalence is where functions return pointer data (e.g. bitmap creation, etc) I use exceptions and I have some static constructors to automatically run the install methods for those requiring them (e.g. the add-ons, keyboard, etc)</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Do [MarshalAs], not [MarshalAsAttribute]</p></div></div><p>This is now redundant as I&#39;m using IntPtr. However, I got MarshalAsAttribute directly from MSDN pinvoke tool, so I assumed Microsoft knew what they were talking about in this case. Why do you say this?
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>You don&#39;t have to specify [StructLayout(LayoutKind.Sequential)] for structs</p></div></div><p>I prefer to explicitly state this for my readibility
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Avoid specifying field offsets</p></div></div><p>You need field offsets for unions, that&#39;s how create them (all with offset of 0)
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>they should implement IDisposable</p></div></div><p>That adds overhead, as I mentioned I wanted this thin wrapper layer and the posh stuff comes in a proper managed framework
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>You need the [UnmanagedFunctionPointer]</p></div></div><p>Ok, again I followed what pinvoke at MSDN gave me for function pointers and assumed they knew what they were doing, as this is my first p/invoke exploration
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>immutable structs</p></div></div><p>Rightly or wrongly, I did this as it&#39;s a low level library and didn&#39;t want the overhead of getter/setters.
</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>You can specify [StructLayout] for classes, and when marshalled, classes are passed as if they were by-ref structs</p></div></div><p>Cheers. I guess this is one way of handling the struct pointer functions without using IntPtr or having the issues with the object/value runtime error.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Fri, 09 Oct 2009 21:34:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/601802/832644#target">Neil Walker</a> said:</div><div class="quote"><p>Do have any good sources, this is something I&#39;ve seen a fair bit in code but have been unable to find any reference on the internet whatsoever to explain it as I find it impossible to construct a search to give me anything useful.</p></div></div><p>
There&#39;s a really good article on MSDN or maybe some MS-affiliate that I found a while back. I took a quick peek and didn&#39;t find it; if I do, I&#39;ll let you know.</p><p>Suffice it to say that there are behavioral and performance considerations to bear in mind when deciding how to decorate your parameters for P/Invoke methods. It especially comes into play with arrays, where you don&#39;t want to waste time copying 1,000 values back and forth between the boundaries. The attributes themselves do exactly what you expect -- [In] copies data into the method (presumably managed to unmanaged, but I think it switches with callbacks) and [Out] copies it back out of the method. (Mimicking passing by reference when language constructs preclude you from actually passing by reference, or for use with arrays.)</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>I appreciate what you&#39;re saying and I do follow standards, but my goal in this instance was to make a direct equivalent where with minimal changes code could easily be written and ported.</p></div></div><p>
If it&#39;s just for your use, I&#39;ll leave you to it. But if you intend for other people to use this, my gut feeling is that this is an auxiliary use case at best. Allegro is just one piece of a large puzzle that would have to be reassembled in C#, for little to no benefit.</p><p>I&#39;m a big advocate of making your code feel like the language that it&#39;s written in. The place I&#39;m writing for right now has one standard that they use for all languages, and it makes the code I&#39;m writing look completely out of place, and in some cases ruins the API.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>This is now redundant as I&#39;m using IntPtr. However, I got MarshalAsAttribute directly from MSDN pinvoke tool, so I assumed Microsoft knew what they were talking about in this case. Why do you say this?</p></div></div><p>
It&#39;s more concise and expressive, it&#39;s what shows up in IntelliSense, and [MarshalAsAttribute] can match either class MarshalAsAttribute or class MarshalAsAttributeAttribute. (and yes, I have seen attribute that look like that.)</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>You need field offsets for unions, that&#39;s how create them (all with offset of 0)</p></div></div><p>
Ah, I didn&#39;t know that. I never tried to make a direct mirror of a union on my A5 binding; instead I inspected the type of the event when I pulled it out and instantiated the correct layout right off the bat.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>That adds overhead, as I mentioned I wanted this thin wrapper layer and the posh stuff comes in a proper managed framework</p></div></div><p>
Then your proper managed framework is going to have overhead because you didn&#39;t cut right to the heart of the issue. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Ok, again I followed what pinvoke at MSDN gave me for function pointers and assumed they knew what they were doing, as this is my first p/invoke exploration</p></div></div><p>
I didn&#39;t see any callback code in what you posted, I&#39;m just telling you for when you do need to interact with some.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>Rightly or wrongly, I did this as it&#39;s a low level library and didn&#39;t want the overhead of getter/setters.</p></div></div><p>
I&#39;m not talking about getters and setters, I&#39;m talking about complete immutability. You can think of the structs as sort of messages that you send back and forth between C and C#.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kibiz0r)</author>
		<pubDate>Sat, 10 Oct 2009 00:59:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Read about [In] and [Out]
</p></div></div><p>
I&#39;m pretty sure google would turn up something useful for &quot;InAttribute msdn&quot; or similar.<br />In fact, <a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.inattribute.aspx">it does</a>.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Tobias Dammers)</author>
		<pubDate>Sat, 10 Oct 2009 01:23:32 +0000</pubDate>
	</item>
</rss>
