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.

238 lines
6.2 KiB

  1. //==========================================================================;
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. // PURPOSE.
  7. //
  8. // Copyright (c) 1992 - 1994 Microsoft Corporation. All Rights Reserved.
  9. //--------------------------------------------------------------------------;
  10. //
  11. // aasysinf.c
  12. //
  13. // Description:
  14. //
  15. //
  16. //
  17. //==========================================================================;
  18. #include <windows.h>
  19. #include <windowsx.h>
  20. #include <mmsystem.h>
  21. #include <memory.h>
  22. #include <mmreg.h>
  23. #include <msacm.h>
  24. #include "appport.h"
  25. #include "acmapp.h"
  26. #include "debug.h"
  27. //--------------------------------------------------------------------------;
  28. //
  29. // BOOL AcmAppDisplaySystemInfo
  30. //
  31. // Description:
  32. //
  33. //
  34. // Arguments:
  35. // HWND hedit:
  36. //
  37. // Return (BOOL):
  38. //
  39. //
  40. //--------------------------------------------------------------------------;
  41. BOOL FNLOCAL AcmAppDisplaySystemInfo
  42. (
  43. HWND hedit
  44. )
  45. {
  46. static TCHAR szDisplayTitle[] = TEXT("[System Information]\r\n");
  47. TCHAR ach[APP_MAX_STRING_RC_BYTES];
  48. PTSTR pch, pch1;
  49. UINT u;
  50. DWORD dw;
  51. //
  52. //
  53. //
  54. MEditPrintF(hedit, szDisplayTitle);
  55. AppGetWindowsVersion(ach, NULL);
  56. MEditPrintF(hedit, TEXT("~%23s: "), (LPTSTR)TEXT("Operating System"));
  57. for (pch = ach; '\0' != *pch; )
  58. {
  59. pch1 = pch;
  60. while ((*pch1 != '\0') && (*pch1 != '\n'))
  61. pch1++;
  62. if ('\n' == *pch1)
  63. *pch1++ = '\0';
  64. MEditPrintF(hedit, TEXT("%s"), (LPTSTR)pch);
  65. if ('\0' == *pch1)
  66. break;
  67. MEditPrintF(hedit, TEXT("~%25s"), (LPTSTR)gszNull);
  68. pch = pch1;
  69. }
  70. AppGetWindowsVersion(NULL, ach);
  71. MEditPrintF(hedit, TEXT("%23s: %s"), (LPTSTR)TEXT("Platform"), (LPTSTR)ach);
  72. //
  73. //
  74. //
  75. u = mmsystemGetVersion();
  76. MEditPrintF(hedit, TEXT("%23s: %u.%.02u"),
  77. #ifdef WIN32
  78. (LPTSTR)TEXT("WinMM Version"),
  79. #else
  80. (LPTSTR)TEXT("MMSystem Version"),
  81. #endif
  82. (u >> 8), u & 0x00FF);
  83. //
  84. //
  85. //
  86. MEditPrintF(hedit, TEXT("~%23s: "), (LPTSTR)TEXT("ACM Version"));
  87. dw = acmGetVersion();
  88. if (0L == dw)
  89. {
  90. MEditPrintF(hedit, TEXT("Not Installed"));
  91. return (TRUE);
  92. }
  93. //
  94. // if the 'build' number is zero, it is a _retail_ version of the
  95. // ACM that is installed. if it is non-zero, it is the debug version.
  96. //
  97. if (0 == LOWORD(dw))
  98. {
  99. MEditPrintF(hedit, TEXT("%u.%.02u (retail)"),
  100. HIWORD(dw) >> 8, HIWORD(dw) & 0x00FF);
  101. }
  102. else
  103. {
  104. MEditPrintF(hedit, TEXT("%u.%.02u (debug build %u)"),
  105. HIWORD(dw) >> 8, HIWORD(dw) & 0x00FF, LOWORD(dw));
  106. }
  107. //
  108. //
  109. //
  110. acmMetrics(NULL, ACM_METRIC_COUNT_DRIVERS, &dw);
  111. MEditPrintF(hedit, TEXT("\r\n%23s: %lu"), (LPTSTR)TEXT("Enabled Drivers"), dw);
  112. acmMetrics(NULL, ACM_METRIC_COUNT_DISABLED, &dw);
  113. MEditPrintF(hedit, TEXT("%23s: %lu"), (LPTSTR)TEXT("Disabled Drivers"), dw);
  114. acmMetrics(NULL, ACM_METRIC_COUNT_CODECS, &dw);
  115. MEditPrintF(hedit, TEXT("%23s: %lu"), (LPTSTR)TEXT("Total CODEC's"), dw);
  116. acmMetrics(NULL, ACM_METRIC_COUNT_CONVERTERS, &dw);
  117. MEditPrintF(hedit, TEXT("%23s: %lu"), (LPTSTR)TEXT("Total Converters"), dw);
  118. acmMetrics(NULL, ACM_METRIC_COUNT_FILTERS, &dw);
  119. MEditPrintF(hedit, TEXT("%23s: %lu"), (LPTSTR)TEXT("Total Filters"), dw);
  120. acmMetrics(NULL, ACM_METRIC_COUNT_HARDWARE, &dw);
  121. MEditPrintF(hedit, TEXT("%23s: %lu"), (LPTSTR)TEXT("Hardware Drivers"), dw);
  122. acmMetrics(NULL, ACM_METRIC_COUNT_LOCAL_DRIVERS, &dw);
  123. MEditPrintF(hedit, TEXT("\r\n%23s: %lu"), (LPTSTR)TEXT("Enabled Local Drivers"), dw);
  124. acmMetrics(NULL, ACM_METRIC_COUNT_LOCAL_DISABLED, &dw);
  125. MEditPrintF(hedit, TEXT("%23s: %lu"), (LPTSTR)TEXT("Disabled Local Drivers"), dw);
  126. acmMetrics(NULL, ACM_METRIC_COUNT_LOCAL_CODECS, &dw);
  127. MEditPrintF(hedit, TEXT("%23s: %lu"), (LPTSTR)TEXT("Total Local CODEC's"), dw);
  128. acmMetrics(NULL, ACM_METRIC_COUNT_LOCAL_CONVERTERS, &dw);
  129. MEditPrintF(hedit, TEXT("%23s: %lu"), (LPTSTR)TEXT("Total Local Converters"), dw);
  130. acmMetrics(NULL, ACM_METRIC_COUNT_LOCAL_FILTERS, &dw);
  131. MEditPrintF(hedit, TEXT("%23s: %lu"), (LPTSTR)TEXT("Total Local Filters"), dw);
  132. acmMetrics(NULL, ACM_METRIC_MAX_SIZE_FORMAT, &dw);
  133. MEditPrintF(hedit, TEXT("\r\n%23s: %lu"), (LPTSTR)TEXT("Max Format Bytes"), dw);
  134. acmMetrics(NULL, ACM_METRIC_MAX_SIZE_FILTER, &dw);
  135. MEditPrintF(hedit, TEXT("%23s: %lu"), (LPTSTR)TEXT("Max Filter Bytes"), dw);
  136. return (TRUE);
  137. } // AcmAppDisplaySystemInfo()
  138. //--------------------------------------------------------------------------;
  139. //
  140. // BOOL AcmAppSystemInfoDlgProc
  141. //
  142. // Description:
  143. //
  144. //
  145. // Arguments:
  146. // HWND hwnd:
  147. //
  148. // UINT uMsg:
  149. //
  150. // WPARAM wParam:
  151. //
  152. // LPARAM lParam:
  153. //
  154. // Return (BOOL):
  155. //
  156. //--------------------------------------------------------------------------;
  157. BOOL FNEXPORT AcmAppSystemInfoDlgProc
  158. (
  159. HWND hwnd,
  160. UINT uMsg,
  161. WPARAM wParam,
  162. LPARAM lParam
  163. )
  164. {
  165. HWND hedit;
  166. UINT uId;
  167. switch (uMsg)
  168. {
  169. case WM_INITDIALOG:
  170. hedit = GetDlgItem(hwnd, IDD_AADETAILS_EDIT_DETAILS);
  171. SetWindowFont(hedit, ghfontApp, FALSE);
  172. //
  173. // clear the display
  174. //
  175. AppHourGlass(TRUE);
  176. SetWindowRedraw(hedit, FALSE);
  177. MEditPrintF(hedit, NULL);
  178. AcmAppDisplaySystemInfo(hedit);
  179. Edit_SetSel(hedit, (WPARAM)0, (LPARAM)0);
  180. SetWindowRedraw(hedit, TRUE);
  181. AppHourGlass(FALSE);
  182. return (TRUE);
  183. case WM_COMMAND:
  184. uId = GET_WM_COMMAND_ID(wParam, lParam);
  185. if ((IDOK == uId) || (IDCANCEL == uId))
  186. {
  187. EndDialog(hwnd, (IDOK == uId));
  188. }
  189. break;
  190. }
  191. return (FALSE);
  192. } // AcmAppSystemInfoDlgProc()