Microsoft Developer Network > Página principal de foros > Phoenix > Linking to a dll from a Plugin
Formular una preguntaFormular una pregunta
 

PreguntaLinking to a dll from a Plugin

  • viernes, 06 de noviembre de 2009 15:32Yostal_Service Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    I would like to build a plugin that inserts call instructions into the code it is creating that will call a dll, as in the BBCount example.  However, the BBCount example uses the PEModuleUnit's built in features to allow for the creation of an import symbol.  I've looked as well at the LoopInstrumentation example, but the example does not actually have to link up to a separate dll.

    I think  the key component I am missing is the ability to create an ImportModuleSymbol.  My clumsy attempts to do so are what cause my Phoenix exceptions currently, and if I could do that, the rest of the BBCount code seems to be compatible with what I am doing.

    Thanks in advance for any help you can provide.

Todas las respuestas

  • lunes, 09 de noviembre de 2009 17:30Yostal_Service Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    For more detail on my difficulty, I'm trying to replace this code from the tool AddCall

    Phx::Symbols::ImportModuleSymbol ^ importmodulesym =
          module->FindImportModule(dllname);
    (AddCall project is in c++, obviously)

    with this code in my own project (which is in csharp):

    importmodulesym = (Phx.Symbols.ImportModuleSymbol) module.SymbolTable.Insert(
                        Phx.Symbols.ImportModuleSymbol.New(
                        module.SymbolTable, 0, dllname, false, null));

    I'm trying to create the import symbol for the dll, but so far, I am having no luck.  Again, any help would be greatly appreciated!