An IL question

May 1, 2007

I have this IL line:
Write (string szName, int32 lSize, int16& lpsData);

Question: What does int16& means? if I open this dll in C#, int16& changes to ref int16. So, I guess int16& means reference to Int16 object (similar to pass by reference in C/C++).

Now, here’s the interesting part. This dll actually a COM wrapper generated by aximp.exe. And the COM interface (IDL)indicates that the parameter should be a pointer to an unsigned short (Int16) array. If lpsData parameter IS a pointer, then shouldn’t the size be 32 bit and not 16? I haven’t got a clue on this matter. But if someone can give me an explanation, I’d be grateful.

Advertisements

One Response to “An IL question”

  1. Anonymous Says:

    I was about to comment on an earlier post about Endian-ness. But, the connection hit me. You’re dreaming about a language where you don’t have to think about endianness, then you ask about how many bits an integer is.

    The pointer is whatever the machine’s pointer size is. It’s pointing to an int16, in this case.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: