debdump.cpp
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 1k
Category:

Windows Kernel

Development Platform:

Visual C++

  1. #include "shellprv.h"
  2. #pragma  hdrstop
  3. #include "sfviewp.h"
  4. #include "docfindx.h"
  5. #define DM_FIXME    0       // trace/break when hit unknown guy
  6. struct DBClassInfo {
  7.     int     cbSize;
  8.     TCHAR * pszName;
  9. };
  10. #define TABENT(c)   { SIZEOF(c), TEXT(#c) }
  11. static const struct DBClassInfo DBClassInfoTab[] =
  12. {
  13.     // BUGBUG tons of table entries missing
  14.     // maybe drive off same file as debug extensions dumpers?
  15.     TABENT(CDefView),
  16.     TABENT(CDFFolder),
  17.     TABENT(CDocFindSFVCB),
  18.     { 0 },
  19. };
  20. #undef  TABENT
  21. //***   DBGetClassSymbolic -- map size to class name (guess)
  22. // NOTES
  23. //  we just take the 1st hit, so if there are multiple classes w/ the
  24. //  same size you get the wrong answer.  if that turns out to be a pblm
  25. //  we can add special-case heuristics for the relevant classes.
  26. //
  27. //  BUGBUG TODO: should use a generic DWORD value/data pair lookup
  28. //  helper func.
  29. //
  30. TCHAR *DBGetClassSymbolic(int cbSize)
  31. {
  32.     const  struct DBClassInfo *p;
  33.     for (p = DBClassInfoTab; p->cbSize != 0; p++) {
  34.         if (p->cbSize == cbSize)
  35.             return p->pszName;
  36.     }
  37.     if (DM_FIXME) {
  38.         TraceMsg(DM_FIXME, "DBgcs: cbSize=%d  no entry", cbSize);
  39.         ASSERT(0);
  40.     }
  41.     return NULL;
  42. }