Changeset 1373 for trunk/dll/errutil.c


Ignore:
Timestamp:
Jan 4, 2009, 2:49:16 AM (17 years ago)
Author:
Steven Levine
Message:

Show thread id in DbgMsg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/errutil.c

    r907 r1373  
    2828  14 Aug 07 SHL Use GetMSecTimer in DbgMsg
    2929  05 Jan 08 SHL Renamed from error.c to match errutil.h
     30  18 Dec 08 SHL Show thread id in DbgMsg
    3031
    3132***********************************************************************/
     
    3637
    3738#define INCL_DOS
     39#define INCL_WIN
    3840#define INCL_DOSERRORS
    39 #define INCL_WIN
     41#define INCL_DOSPROCESS                 // PPIB PTIB
    4042
    4143#include "errutil.h"
     
    6062VOID DbgMsg(PCSZ pszSrcFile, UINT uSrcLineNo, PCSZ pszFmt, ...)
    6163{
     64  PIB *ppib;
     65  TIB *ptib;
     66  ULONG ultid;
     67  APIRET apiret;
    6268  va_list va;
    6369
     
    8187#endif
    8288
     89  apiret = DosGetInfoBlocks(&ptib, &ppib);
     90  if (apiret)
     91    ultid = 0;
     92  else
     93    ultid = ptib->tib_ptib2->tib2_ultid;
     94
    8395  // OK for source file name to be null
    84   fprintf(stderr, "%s %u", pszSrcFile ? pszSrcFile : "n/a", uSrcLineNo);
     96  fprintf(stderr, "%s %u (%lu)", pszSrcFile ? pszSrcFile : "n/a", uSrcLineNo, ultid);
    8597  // If format null want just file and line
    8698  if (pszFmt) {
Note: See TracChangeset for help on using the changeset viewer.