Changeset 286


Ignore:
Timestamp:
Apr 1, 2007, 10:44:04 AM (18 years ago)
Author:
cinc
Message:

Fixed DLL registering with the GC. See ticket #7.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/nom/src/nomgc.c

    r284 r286  
    146146#endif
    147147
    148 /*
    149   Find a library record in the buffer filled by DosQuerySysState().
     148/**
     149  Find a library record in the buffer filled by DosQuerySysState(). This function
     150  searches in the list of all known libs, not in the process libs list.
    150151 */
    151152static qsLrec_t* qsFindModuleRec(const qsPtrRec_t * hRegisterDLL,  USHORT hMod){
     
    157158    {
    158159      a++;
    159       /* printf("%d Checking: %x -> %04X (%s)\n", a, pModRec, pModRec->hmte, pModRec->pName); */
     160      /* g_message("%d Checking: %x -> %04X (%s)", a, pModRec, pModRec->hmte, pModRec->pName); */
    160161
    161162      if (NULLHANDLE==pModRec->pObjInfo   && pModRec->ctObj > 0)
     
    178179}
    179180
     181/**
     182   Get the info about the current DLLs from OS/2. Go over all found
     183   DLLs and insert them in a list. For all found DLLs go over the imports
     184   of them and add them to the list etc. Duplicates are ignored.
     185 */
    180186#define BUFSIZE 1024*1024
    181187NOMEXTERN HREGDLL NOMLINK nomBeginRegisterDLLWithGC(void)
     
    213219    pRegDLL->pMainAnchor=(qsPtrRec_t*) buf;
    214220
     221    /* Pointer to process information */
    215222    p=pRegDLL->pMainAnchor->pProcRec;
    216223
    217224    while(p && p->RecType == 1)
    218225      {
    219 
    220         if (p->cLib) {
     226        qsLrec_t * pModRec; /* Info about a DLL */
     227
     228        /* Get record for executable */
     229        pModRec=qsFindModuleRec(pRegDLL->pMainAnchor,  p->hMte);
     230        if(pModRec){
     231          //if(pModRec->pName)
     232          //g_message("exe) %s", pModRec->pName);
     233          qsAddDLLToList(pRegDLL, pModRec);
     234        }
     235
     236        if (p->cLib) { /* Number of lib imports */
    221237          int i;
    222238
    223239          for (i=0; i<p->cLib; i++){
    224             qsLrec_t * pModRec;
    225 
    226240            pModRec=qsFindModuleRec(pRegDLL->pMainAnchor,  p->pLibRec[i]);
    227241
    228242            if(pModRec){
    229               //  if(pModRec->pName)
    230               //g_message("%s", pModRec->pName);
     243              //if(pModRec->pName)
     244              //g_message("a) %s", pModRec->pName);
    231245              qsAddDLLToList(pRegDLL, pModRec);
    232246            }
     
    262276                if(pModImp){
    263277                  //if(pModImp->pName)
    264                   //  g_message("%s", pModImp->pName);
     278                  //g_message("b) %s", pModImp->pName);
    265279                  qsAddDLLToList(pRegDLL, pModImp);
    266280                }
     
    293307  GSList* lTemp;
    294308
    295   //g_message("Trying to register DLL %s\n", chrDLLName);
     309  //g_message("Trying to register DLL %s", chrDLLName);
    296310  lTemp=hRegisterDLL->dllList;
    297311  while(lTemp)
     
    301315      pModRec=(qsLrec_t*)lTemp->data;
    302316      if(pModRec){
    303         //g_message("DLL name: %s\n", pModRec->pName);
     317        //  g_message("DLL name: %s", pModRec->pName);
    304318        if(pModRec->pName && (NULLHANDLE!=strstr( pModRec->pName, chrDLLName)))
    305319          {
Note: See TracChangeset for help on using the changeset viewer.