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.

209 lines
3.8 KiB

  1. struct _FORMATS_MEM_WIN {
  2. DWORD cBits;
  3. FMTTYPE fmtType;
  4. DWORD radix;
  5. DWORD fTwoFields;
  6. DWORD cchMax;
  7. PTSTR lpszDescription;
  8. };
  9. extern _FORMATS_MEM_WIN g_FormatsMemWin[];
  10. extern const int g_nMaxNumFormatsMemWin;
  11. //
  12. // Enum type and string identifier
  13. //
  14. extern struct _INTERFACE_TYPE_NAMES {
  15. INTERFACE_TYPE type;
  16. PTSTR psz;
  17. } rgInterfaceTypeNames[MaximumInterfaceType];
  18. extern struct _BUS_TYPE_NAMES {
  19. BUS_DATA_TYPE type;
  20. PTSTR psz;
  21. } rgBusTypeNames[MaximumBusDataType];
  22. struct GEN_MEMORY_DATA {
  23. MEMORY_TYPE memtype;
  24. int nDisplayFormat;
  25. ANY_MEMORY_DATA any;
  26. };
  27. #define IDC_MEM_PREVIOUS 1234
  28. #define IDC_MEM_NEXT 1235
  29. class MEMWIN_DATA : public EDITWIN_DATA {
  30. public:
  31. char m_OffsetExpr[MAX_OFFSET_EXPR];
  32. BOOL m_UpdateExpr;
  33. ULONG64 m_OffsetRead;
  34. GEN_MEMORY_DATA m_GenMemData;
  35. HWND m_FormatCombo;
  36. HWND m_PreviousButton;
  37. HWND m_NextButton;
  38. ULONG m_Columns;
  39. BOOL m_AllowWrite;
  40. BOOL m_UpdateValue;
  41. char m_ValueExpr[MAX_OFFSET_EXPR];
  42. ULONG m_WindowDataSize;
  43. MEMWIN_DATA();
  44. virtual void Validate();
  45. virtual BOOL HasEditableProperties();
  46. virtual BOOL EditProperties();
  47. virtual HRESULT ReadState(void);
  48. virtual BOOL OnCreate(void);
  49. virtual LRESULT OnCommand(WPARAM wParam, LPARAM lParam);
  50. virtual void OnSize(void);
  51. virtual void OnTimer(WPARAM TimerId);
  52. virtual LRESULT OnNotify(WPARAM wParam, LPARAM lParam);
  53. virtual void OnUpdate(UpdateType Type);
  54. virtual void UpdateColors(void);
  55. void ScrollLower(void);
  56. void ScrollHigher(void);
  57. void WriteValue(ULONG64 Offset);
  58. void UpdateOptions(void);
  59. ULONG64 GetAddressOfCurValue(
  60. PULONG pCharIndex,
  61. CHARRANGE *pCRange
  62. );
  63. };
  64. typedef MEMWIN_DATA *PMEMWIN_DATA;
  65. INT_PTR
  66. DisplayOptionsPropSheet(
  67. HWND hwndOwner,
  68. HINSTANCE hinst,
  69. MEMORY_TYPE memtypeStartPage
  70. );
  71. #if 0
  72. #define MAX_CHUNK_TOREAD 4096 // maximum chunk of memory to read at one go
  73. LRESULT
  74. CALLBACK
  75. MemoryEditProc(
  76. HWND hwnd,
  77. UINT message,
  78. WPARAM wParam,
  79. LPARAM lParam
  80. );
  81. /*
  82. void ViewMem(int view, BOOL fVoidCache);
  83. extern TCHAR memText[MAX_MSG_TXT]; //the selected text for memory dlg
  84. */
  85. struct memItem {
  86. char iStart;
  87. char cch;
  88. char iFmt;
  89. };
  90. struct memWinDesc {
  91. int iFormat;
  92. ATOM atmAddress;
  93. BOOL fLive;
  94. BOOL fHaveAddr;
  95. BOOL fBadRead; // dis we really read mem or just ??
  96. PTSTR lpbBytes;
  97. memItem *lpMi;
  98. UINT cMi;
  99. BOOL fEdit;
  100. BOOL fFill;
  101. UINT cPerLine;
  102. //ADDR addr;
  103. //ADDR orig_addr;
  104. //ADDR old_addr;
  105. TCHAR szAddress[MAX_MSG_TXT]; //the mem address expression in ascii
  106. UINT cbRead;
  107. };
  108. /*
  109. extern struct memWinDesc MemWinDesc[MAX_VIEWS];
  110. extern struct memWinDesc TempMemWinDesc;
  111. //
  112. // Define the set of memory formats
  113. //
  114. enum {
  115. MW_ASCII = 0,
  116. MW_BYTE,
  117. MW_SHORT,
  118. MW_SHORT_HEX,
  119. MW_SHORT_UNSIGNED,
  120. MW_LONG,
  121. MW_LONG_HEX,
  122. MW_LONG_UNSIGNED,
  123. MW_QUAD,
  124. MW_QUAD_HEX,
  125. MW_QUAD_UNSIGNED,
  126. MW_REAL,
  127. MW_REAL_LONG,
  128. MW_REAL_TEN
  129. };
  130. */
  131. #if 0
  132. #define MEM_FORMATS {\
  133. 1, /* ASCII */ \
  134. 1, /* BYTE */ \
  135. 2, /* SHORT */ \
  136. 2, /* SHORT_HEX */ \
  137. 2, /* SHORT_UNSIGNED */ \
  138. 4, /* LONG */ \
  139. 4, /* LONG_HEX */ \
  140. 4, /* LONG_UNSIGNED */ \
  141. 8, /* QUAD */ \
  142. 8, /* QUAD_HEX */ \
  143. 8, /* QUAD_UNSIGNED */ \
  144. 4, /* REAL */ \
  145. 8, /* REAL_LONG */ \
  146. 10, /* REAL_TEN */ \
  147. 16 /* */ \
  148. }
  149. #endif
  150. #endif