I need write a class inherited from Object (as StringObject does), and I
need create instances of it when objects are created (in NewObject
helpers). I think that I followed all the steps:

   1.- I created a C# class in bcl/system/security directory (I want my
class be in that package).

   2.- I wrote the class that I want use in the Rotor. The fields of the
class match exactly with the fields in the C# class.

   3.- I modified the mscorlib.h file, to include my new class. And to map
the two classes previously writeen. I also add the constructor reference.

   4.- I created a global pointer to the method table of my class. I
initialized this with the FetchClass method in the class BinderClass.

   5.- I call CDI_GLOBAL_ADDRESS_DEBUG_ONLY in file Dump-types.h, to
specifie that the method table is a global variable.

The problem is that when I try to create an instance of this class I get
an assert in line 5144, in the file gcsmp.cpp. The text of the assert
is: "!curThread->GCForbidden()".

I don't know where is the problem, though I think that I missed some step
to incorporate the new class. The function in wich the assert is launched
is Alloc.

I tried yet with the AllocateObject(MethodTable*) function and with
AllocateObject(DWORD), and in both funcionts I have de same error.

Could anybody help me to resolve my problem.

Thank you.

Reply via email to