Discussion of the Rotor Shared Source CLI implementation wrote:
You might need to handle ELEMENT_TYPE_STRING, ELEMENT_TYPE_OBJECT,
ELEMENT_TYPE_SZARRAY, etc. Don't know what your intent is.
No need for that at the moment, ELEMENT_TYPE_CLASS will suffice. What
I'm doing only affects user-defined
When you're inside the EE, you can certainly get an IMetaDataImport pointer.
For example, if you have a Module*, you can get its IMetaDataImport pointer.
If you'd like to use the internal import interface, after doing a
GetSigOfFieldDef, you can use FieldSig class (siginfo.*pp) to pick out
Discussion of the Rotor Shared Source CLI implementation wrote:
IMDInternalImport::GetParentToken() is what you need.
No, that seems to give me the mdTypeDef corresponding to the enclosing
type. I.E:
public class Foo
{
public Bar Field;
}
If I have a mdFieldDef for Field here, calling
My bad. If you see EEClass::InitializeFieldDescs in vm\class.cpp, you
will see how to look up the type of the field using GetSigOfFieldDef (as
Nam also pointed out).
-Original Message-
From: Discussion of the Rotor Shared Source CLI implementation
[mailto:[EMAIL PROTECTED] On Behalf Of
You need to get the field's signature and decode this signature. In the
simplest case (public Bar Field) the signature will be:
{CALLCONV_FIELD,E_T_CLASS,compressed token of Bar} Or
{CALLCONV_FIELD,E_T_VALUETYPE,compressed token of Bar}
For calling convention and element type encoding, see
You might need to handle ELEMENT_TYPE_STRING, ELEMENT_TYPE_OBJECT,
ELEMENT_TYPE_SZARRAY, etc. Don't know what your intent is.
The best thing is to do whatever
MethodTableBuilder::InitializeFieldDescs does. There are encapsulations
for checking if a signature element refers to a reference type,