none
Linking against custom CEDDK RRS feed

  • Question

  • I have modified CEDDK and added some additional functions. Almost every device driver links against CEDDK.

    In my understanding CEDDK.dll should only be loaded once, but unfortunatly I see that local variables are getting initialized serveral times. As there are a lot of huger data structures required, it would be nice to only initialize them once to reduce overall memory consuption.

    Is there a gernal problem with my understanding of using shared libraries? Or do I need to link agains another library of my custom ceddk.lib in each device driver?

    Friday, August 6, 2010 8:39 AM

All replies

  • This may not be a question of how many times is ceddk.dll loaded, but rather a question about how you changed the code.  Since you didn't tell us that we are left to guess.  My guess is that you are doing something in the entry point of the dll.  What you may not have considered is that the entry point is called many times; on process attach and detach, and on thread attach and detach.


    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman

    Eurotech Inc.
    www.Eurotech.com
    Friday, August 6, 2010 1:16 PM
    Moderator
  • Thanks for your reply,

    We have added some addtional exports to DLL that may be called by other drivers (mainly to configure IO-pins). And we intend to use static structure variables that are getting initialized the first time the DLL is beeing loaded. I know that the dll entry function is called several times, but I noticed that these static variables are always re-initialized as the DLL is beeing attached. From my current understand this should not be the case.

    All drivers that use CEDDK functionality are kernel mode drivers. Therefore I thought that CEDDK.dll is available in physical memory only once.

    Tuesday, August 10, 2010 2:57 PM
  • *push*
    Tuesday, August 24, 2010 9:33 AM