Ignore:
Timestamp:
Aug 12, 2002, 5:54:49 PM (23 years ago)
Author:
umoeller
Message:

Minor updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/procstat.c

    r169 r206  
    519519{
    520520    #define BUFSIZE (256 * 1024) // 128000l
     521
    521522    PCHAR pBuf = NULL; // (PCHAR)malloc(BUFSIZE);
    522523
     
    572573        int i;
    573574        PQTHREAD32  t = pProcThis->pThreads;
    574         PQMODULE32 pModule = prc32FindModule(pInfo,
    575                                              pProcThis->usHModule);
    576 
    577         if (pModule)
     575        PQMODULE32  pModule;
     576
     577        if (pModule = prc32FindModule(pInfo,
     578                                      pProcThis->usHModule))
    578579        {
    579580            // the module name is fully qualified, so find the
     
    581582            if (pModule->pcName)
    582583            {
    583                 PSZ pLastBackslash = strrchr(pModule->pcName, '\\');
    584                 if (pLastBackslash)
     584                PSZ pLastBackslash;
     585                if (pLastBackslash = strrchr(pModule->pcName, '\\'))
    585586                    // found:
    586587                    if (stricmp(pLastBackslash + 1, pcszName) == 0)
     
    608609
    609610/*
     611 *@@ prc32FindProcessFromPID:
     612 *
     613 *@@added V0.9.21 (2002-08-12) [umoeller]
     614 */
     615
     616PQPROCESS32 prc32FindProcessFromPID(PQTOPLEVEL32 pInfo,
     617                                    ULONG pid)
     618{
     619    PQPROCESS32 pProcThis = pInfo->pProcessData;
     620    while (pProcThis && pProcThis->ulRecType == 1)
     621    {
     622        int i;
     623        PQTHREAD32  t = pProcThis->pThreads;
     624
     625        if (pProcThis->usPID == pid)
     626            return pProcThis;
     627
     628        // for next process, skip the threads info;
     629        // the next process block comes after the
     630        // threads
     631        for (i=0;
     632             i < pProcThis->usThreadCount;
     633             i++, t++)
     634            ;
     635
     636        pProcThis = (PQPROCESS32)t;
     637    }
     638
     639    return NULL;
     640}
     641
     642/*
    610643 *@@ prc32FindSem16:
    611644 *      attempts to find the specified 16-bit semaphore
Note: See TracChangeset for help on using the changeset viewer.