Re: [DOTNET-ROTOR] Getting an mdTypeDef for the type of a field

2005-05-11 Thread Arild Fines
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

Re: [DOTNET-ROTOR] Getting an mdTypeDef for the type of a field

2005-05-10 Thread Nam Tran
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

Re: [DOTNET-ROTOR] Getting an mdTypeDef for the type of a field

2005-05-10 Thread Arild Fines
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

Re: [DOTNET-ROTOR] Getting an mdTypeDef for the type of a field

2005-05-10 Thread Shri Borde
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

Re: [DOTNET-ROTOR] Getting an mdTypeDef for the type of a field

2005-05-10 Thread Serge Lidin
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

Re: [DOTNET-ROTOR] Getting an mdTypeDef for the type of a field

2005-05-10 Thread Shri Borde
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,