Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.8 KiB

  1. #include "priv.h"
  2. #include "resource.h" // IDM_AB_* fir this!
  3. #include "hlframe.h"
  4. #include "basesb.h"
  5. #include "nsc.h"
  6. #include "nsctask.h"
  7. #ifdef DEBUG // {
  8. #define DM_FIXME 0 // trace/break when hit unknown guy
  9. struct DBClassInfo {
  10. int cbSize;
  11. TCHAR * pszName;
  12. };
  13. //
  14. // EXTERNALOBJECTS is a macro which simply expands to X(C,0) X(D,1)
  15. // X(E, 2)...
  16. // where C, D, E, ... are classes whose sizes are defined externally.
  17. //
  18. #define EXTERNALOBJECTS \
  19. X(CSDWindows, 0) \
  20. #define TABENT(c) { SIZEOF(c), TEXT(#c) }
  21. #define X(c, n) { 0, TEXT(#c) },
  22. struct DBClassInfo DBClassInfoTab[] =
  23. {
  24. // tons of table entries missing
  25. // maybe drive off same file as debug extensions dumpers?
  26. TABENT(CBASEBROWSER), // 0
  27. TABENT(CIEFrameAuto), // 1
  28. TABENT(CNscTree),
  29. #define NUM_INTERNAL_OBJECTS 4
  30. EXTERNALOBJECTS // 5...
  31. { 0 },
  32. };
  33. #undef TABENT
  34. #undef X
  35. #define X(c, n) extern "C" extern const int SIZEOF_##c;
  36. EXTERNALOBJECTS
  37. #undef X
  38. //*** DBGetClassSymbolic -- map size to class name (guess)
  39. // NOTES
  40. // we just take the 1st hit, so if there are multiple classes w/ the
  41. // same size you get the wrong answer. if that turns out to be a pblm
  42. // we can add special-case heuristics for the relevant classes.
  43. //
  44. // TODO: should use a generic DWORD value/data pair lookup
  45. // helper func.
  46. //
  47. TCHAR *DBGetClassSymbolic(int cbSize)
  48. {
  49. struct DBClassInfo *p;
  50. #define X(c, n) \
  51. DBClassInfoTab[NUM_INTERNAL_OBJECTS+n].cbSize = SIZEOF_##c;
  52. EXTERNALOBJECTS
  53. #undef X
  54. for (p = DBClassInfoTab; p->cbSize != 0; p++) {
  55. if (p->cbSize == cbSize)
  56. return p->pszName;
  57. }
  58. if (DM_FIXME) {
  59. TraceMsg(DM_FIXME, "DBgcs: cbSize=%d no entry", cbSize);
  60. ASSERT(0);
  61. }
  62. return NULL;
  63. }
  64. #endif // }