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.

188 lines
6.1 KiB

  1. //=============================================================================
  2. // Copyright (c) 1998 Microsoft Corporation
  3. // File: mib.c
  4. // Abstract:
  5. //
  6. // Author: K.S.Lokesh (lokeshs@) 1-1-98
  7. //=============================================================================
  8. #include "pchdvmrp.h"
  9. #pragma hdrstop
  10. //-----------------------------------------------------------------------------
  11. // Functions to display the MibTable on the TraceWindow periodically
  12. //-----------------------------------------------------------------------------
  13. #ifdef MIB_DEBUG
  14. #define ClearScreen(h) { \
  15. DWORD _dwin,_dwout; \
  16. COORD _c = {0, 0}; \
  17. CONSOLE_SCREEN_BUFFER_INFO _csbi; \
  18. GetConsoleScreenBufferInfo(h,&_csbi); \
  19. _dwin = _csbi.dwSize.X * _csbi.dwSize.Y; \
  20. FillConsoleOutputCharacter(h,' ',_dwin,_c,&_dwout); \
  21. }
  22. #define WRITELINE(h,c,fmt,arg) { \
  23. DWORD _dw; \
  24. CHAR _sz[200], _fmt[200]; \
  25. wsprintf(_fmt,"%-100s",fmt); \
  26. wsprintf(_sz,_fmt,arg); \
  27. WriteConsoleOutputCharacter(h,_sz,lstrlen(_sz),c,&_dw); \
  28. ++(c).Y; \
  29. }
  30. #define WRITE_NEWLINE(h,c) \
  31. WRITELINE( \
  32. hConsole, c, "%s", \
  33. "" \
  34. );
  35. #define WRITELINE2(h,c,fmt,arg1, arg2) { \
  36. DWORD _dw; \
  37. CHAR _sz[200], _fmt[200]; \
  38. wsprintf(_fmt,"%-100s",fmt); \
  39. wsprintf(_sz,_fmt,arg1, arg2); \
  40. WriteConsoleOutputCharacter(h,_sz,lstrlen(_sz),c,&_dw); \
  41. ++(c).Y; \
  42. }
  43. #define WRITELINE3(h,c,fmt,arg1, arg2, arg3) { \
  44. DWORD _dw; \
  45. CHAR _sz[200], _fmt[200]; \
  46. wsprintf(_fmt,"%-100s",fmt); \
  47. wsprintf(_sz,_fmt,arg1, arg2, arg3); \
  48. WriteConsoleOutputCharacter(h,_sz,lstrlen(_sz),c,&_dw); \
  49. ++(c).Y; \
  50. }
  51. #define WRITELINE4(h,c,fmt,arg1, arg2, arg3, arg4) { \
  52. DWORD _dw; \
  53. CHAR _sz[200], _fmt[200]; \
  54. wsprintf(_fmt,"%-100s",fmt); \
  55. wsprintf(_sz,_fmt,arg1, arg2, arg3, arg4); \
  56. WriteConsoleOutputCharacter(h,_sz,lstrlen(_sz),c,&_dw); \
  57. ++(c).Y; \
  58. }
  59. #define WRITELINE5(h,c,fmt,arg1, arg2, arg3, arg4, arg5) { \
  60. DWORD _dw; \
  61. CHAR _sz[200], _fmt[200]; \
  62. wsprintf(_fmt,"%-100s",fmt); \
  63. wsprintf(_sz,_fmt,arg1, arg2, arg3, arg4, arg5); \
  64. WriteConsoleOutputCharacter(h,_sz,lstrlen(_sz),c,&_dw); \
  65. ++(c).Y; \
  66. }
  67. #define WRITELINE6(h,c,fmt,arg1, arg2, arg3, arg4, arg5, arg6) { \
  68. DWORD _dw; \
  69. CHAR _sz[200], _fmt[200]; \
  70. wsprintf(_fmt,"%-100s",fmt); \
  71. wsprintf(_sz,_fmt,arg1, arg2, arg3, arg4, arg5, arg6); \
  72. WriteConsoleOutputCharacter(h,_sz,lstrlen(_sz),c,&_dw); \
  73. ++(c).Y; \
  74. }
  75. #define WRITELINE9(h,c,fmt,arg1, arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9) {\
  76. DWORD _dw; \
  77. CHAR _sz[200], _fmt[200]; \
  78. wsprintf(_fmt,"%-100s",fmt); \
  79. wsprintf(_sz,_fmt,arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);\
  80. WriteConsoleOutputCharacter(h,_sz,lstrlen(_sz),c,&_dw); \
  81. ++(c).Y; \
  82. }
  83. #endif MIB_DEBUG
  84. DWORD
  85. APIENTRY
  86. MibGet(
  87. IN DWORD dwInputSize,
  88. IN PVOID pInputData,
  89. IN OUT PDWORD pdwOutputSize,
  90. OUT PVOID pOutputData
  91. )
  92. {
  93. DWORD Error = NO_ERROR;
  94. return Error;
  95. }
  96. DWORD
  97. APIENTRY
  98. MibGetFirst(
  99. IN DWORD dwInputSize,
  100. IN PVOID pInputData,
  101. IN OUT PDWORD pdwOutputSize,
  102. OUT PVOID pOutputData
  103. )
  104. {
  105. DWORD Error=NO_ERROR;
  106. return Error;
  107. }
  108. DWORD
  109. APIENTRY
  110. MibGetNext(
  111. IN DWORD dwInputSize,
  112. IN PVOID pInputData,
  113. IN OUT PDWORD pdwOutputSize,
  114. OUT PVOID pOutputData
  115. )
  116. {
  117. DWORD Error = NO_ERROR;
  118. return Error;
  119. }
  120. DWORD
  121. APIENTRY
  122. MibCreate(
  123. IN DWORD dwInputSize,
  124. IN PVOID pInputData
  125. )
  126. {
  127. //
  128. // Not supported
  129. //
  130. return NO_ERROR;
  131. }
  132. DWORD
  133. APIENTRY
  134. MibDelete(
  135. IN DWORD dwInputSize,
  136. IN PVOID pInputData
  137. )
  138. {
  139. //
  140. // Not supported
  141. //
  142. return NO_ERROR;
  143. }
  144. DWORD
  145. APIENTRY
  146. MibSet(
  147. IN DWORD dwInputSize,
  148. IN PVOID pInputData
  149. )
  150. {
  151. //
  152. // Not supported
  153. //
  154. return NO_ERROR;
  155. }