Changeset 1078 for trunk/dll/misc.c


Ignore:
Timestamp:
Jul 19, 2008, 6:08:02 AM (17 years ago)
Author:
Steven Levine
Message:

More Fortify infrastructure enhancements
Rework Fortify_SetOwner
Add Fortify_BecomeOwner
Avoid more spurious leak reports

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/misc.c

    r1077 r1078  
    118118
    119119/**
    120  * Return tid for fm/2 window
     120 * Return thread ordinal for fm/2 window
    121121 * window must exist and must be created by fm/2
    122122 * @param hwnd is window handle
    123  * @returns tid or -1 if error
     123 * @returns thread ordinal or -1 if error
    124124 */
    125125
     
    128128    PIB *ppib;
    129129    TIB *ptib;
    130     LONG tid = -1;
     130    LONG ordinal = -1;
    131131    APIRET rc = DosGetInfoBlocks(&ptib, &ppib);
    132132
     
    143143        Runtime_Error(pszSrcFile, __LINE__, "hwnd %X not created by fm/2", hwnd);
    144144      else
    145         tid = ptib->tib_ptib2->tib2_ultid;
    146     }
    147     return tid;
     145        ordinal = ptib->tib_ptib2->tib2_ultid;
     146    }
     147    return ordinal;
     148}
     149
     150/**
     151 * Return thread ordinal for current thread
     152 * @returns thread ordinal or -1 if error
     153 */
     154
     155INT GetTidForThread(VOID)
     156{
     157    PIB *ppib;
     158    TIB *ptib;
     159    LONG ordinal = -1;
     160    APIRET rc = DosGetInfoBlocks(&ptib, &ppib);
     161
     162    if (rc) {
     163      Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
     164                "DosGetInfoBlocks");
     165    }
     166    else
     167      ordinal = ptib->tib_ptib2->tib2_ultid;
     168
     169    return ordinal;
    148170}
    149171
Note: See TracChangeset for help on using the changeset viewer.