Leaked source code of windows server 2003
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.

310 lines
9.9 KiB

  1. <html>
  2. <head>
  3. <Title>Advanced System Information - Services</Title>
  4. <Script Language="JScript" Src="CommonFunc.js"></script>
  5. <link rel="STYLESHEET" type="text/css" href="hcp://system/css/shared.css">
  6. <link rel="STYLESHEET" type="text/css" href="msinfohss.css">
  7. <Script Language="JavaScript">
  8. var remoteServer = null;
  9. function OnLoadHandler() {
  10. _body.style.cursor= "wait";
  11. _body.scroll = "no";
  12. DisplayLocStrings();
  13. SetProgressBarImage();
  14. window.setTimeout("LoadChores(0)", TIMEOUT);
  15. }
  16. function DisplayLocStrings() {
  17. WaitMessage.innerHTML = MSG_WAIT;
  18. Refresh.innerHTML = TAG_REFRESH;
  19. with(Services.all) {
  20. Caption.innerHTML = TAG_SERVICES;
  21. Col1.innerHTML = TAG_SERVICE;
  22. Col2.innerHTML = TAG_EXECUTABLE;
  23. Col3.innerHTML = TAG_STATUS;
  24. Col4.innerHTML = TAG_STARTUP;
  25. }
  26. }
  27. var INCR_UNIT = 100;//move progress bar in increments of INCR_UNIT
  28. function LoadChores(taskId) {
  29. try {
  30. switch(taskId)
  31. {
  32. case 0:
  33. remoteServer = GetServerName();
  34. Title.innerHTML = (remoteServer ? (TAG_REMOTEADVINFO + " \\\\" + remoteServer) : TAG_LOCALADVINFO) + " - " + TAG_SERVICES;
  35. break;
  36. case 1:
  37. DrawProgressBar(INCR_UNIT, TAG_SERVICES);
  38. break;
  39. case 2:
  40. var oServices = new myServices;
  41. oServices.show();
  42. break;
  43. default:
  44. taskId = -1;
  45. _header.style.display = "none";
  46. _data.style.display = "";
  47. _body.style.cursor= "default";
  48. _body.scroll = "auto";
  49. }
  50. if(taskId >= 0)
  51. window.setTimeout("LoadChores(" + ++taskId + ")", TIMEOUT);
  52. }
  53. catch (e) {
  54. HandleErr(e);
  55. }
  56. }
  57. function ShowDetail(tr) {
  58. with (tr.all) {
  59. var msg = name.innerHTML + "\r" + exe.innerHTML + "\r" + state.innerHTML + "\r" + startMode.innerHTML;
  60. if(pchealth)
  61. pchealth.MessageBox(msg, "OK");
  62. }
  63. }
  64. //traverse the list and invoke display on each item.
  65. function displayTableSegment(outerDiv, head) {
  66. var strMsg = "<table width=\"100%\" cellspacing=0 cellpadding=0><tr class=\"sys-table-cell-bgcolor1 sys-font-body sys-color-body\"><td align='left' style=\"padding : 0.5em;\">%arg1%</td></tr></table>";
  67. var cnt = 1;
  68. var strHTML = "";
  69. var tableElement = null;
  70. if (document.all[outerDiv].length == null)
  71. tableElement = document.all[outerDiv];
  72. else
  73. tableElement = document.all[outerDiv][0];
  74. if (head==null)
  75. tableElement.outerHTML = strMsg.replace(/%arg1%/, TAG_NONE);
  76. else
  77. {
  78. var curr = head;
  79. while (curr!=null) {
  80. if (document.all[outerDiv].length == null)
  81. tableElement = document.all[outerDiv];
  82. else
  83. tableElement = document.all[outerDiv][0];
  84. if (cnt%2 == 0) {
  85. if (tableElement.all["tr_" + outerDiv])
  86. tableElement.all["tr_" + outerDiv].className = "sys-table-cell-bgcolor1";
  87. cnt = 1;
  88. }
  89. else {
  90. if (tableElement.all["tr_" + outerDiv])
  91. tableElement.all["tr_" + outerDiv].className = "sys-table-cell-bgcolor2";
  92. cnt++;
  93. }
  94. curr.show(tableElement);
  95. strHTML += tableElement.outerHTML;
  96. curr = curr.getNext();
  97. }
  98. tableElement.outerHTML = strHTML;
  99. }
  100. }
  101. //////////////////////
  102. //MyService
  103. function myServiceSetValues(name, exe, state, startMode) {
  104. this.m_name = intelliBreak(name, " ", 23);
  105. this.m_exe = intelliBreak(exe, " ", 20);;
  106. this.m_state = state;
  107. this.m_startMode = startMode;
  108. }
  109. function myServiceShow(tableElement) {
  110. tableElement.all["name"].innerHTML = this.m_name;
  111. tableElement.all["exe"].innerHTML = this.m_exe;
  112. tableElement.all["state"].innerHTML = this.m_state;
  113. tableElement.all["startMode"].innerHTML = this.m_startMode;
  114. }
  115. //constructor
  116. function myService() {
  117. this.m_name = null;
  118. this.m_exe = null;
  119. this.m_state = null;
  120. this.m_startMode = null;
  121. this.m_next = null;
  122. this.getName = new Function("return this.m_name;");
  123. this.setNext = new Function("ptr", "this.m_next = ptr;");
  124. this.getNext = new Function("return this.m_next;");
  125. this.setValues = myServiceSetValues;
  126. this.show = myServiceShow;
  127. }
  128. //EO MyService
  129. //////////////////////
  130. //////////////////////
  131. //MyServices
  132. function myServicesShow() {
  133. displayTableSegment("services", this.m_head);
  134. }
  135. //constructor
  136. function myServices() {
  137. this.m_head = null;
  138. this.show = myServicesShow;
  139. var loc = wbemlocator;
  140. var svcs = loc.ConnectServer(remoteServer);
  141. svcs.Security_.impersonationlevel = wbemImpersonationLevelImpersonate;
  142. var strQuery = "Select * From Win32_Service";
  143. var colItems = new Enumerator(svcs.ExecQuery(strQuery));
  144. for(; !colItems.atEnd(); colItems.moveNext())
  145. {
  146. var inst = colItems.item();
  147. var oService = new myService();
  148. with (inst)
  149. {
  150. //extract just the file name
  151. var arrExe = inst.PathName.split("\\");
  152. var stateval = GetPropValue(svcs, "State", State);
  153. var startmodeval = GetPropValue(svcs, "StartMode", StartMode);
  154. oService.setValues(Name, arrExe[arrExe.length-1], stateval, startmodeval);
  155. }
  156. oService.setNext(this.m_head); //add before
  157. this.m_head = oService;
  158. }
  159. }
  160. //EO MyServices
  161. //////////////////////
  162. </Script>
  163. </head>
  164. <body ID="_body" onLoad="OnLoadHandler()" STYLE="cursor: wait" class="sys-font-body sys-color-body sys-rhp-bgcolor">
  165. <Span ID="Title" align="left" class="sys-font-heading3 sys-rhp-color-title">&nbsp;</Span>
  166. <DIV ID="_header">
  167. <table width="100%" cellspacing="0" cellpadding="0" class="sys-font-body sys-color-body" style="padding : 0.5em 0.5em 0.5em 0em;">
  168. <tr>
  169. <td>
  170. &nbsp;
  171. </td>
  172. </tr>
  173. <tr>
  174. <td ID="WaitMessage" ALIGN="left" VALIGN=top class="sys-font-body-bold sys-color-body">
  175. &nbsp;
  176. </td>
  177. </tr>
  178. <tr>
  179. <td>
  180. <table ID="Progress" border=0 cellspacing="0" cellpadding="0">
  181. <tr>
  182. <td rowspan="3"><img ID="ImgProgLeft" src="Graphics/r1_c1.gif" width="4px" height="18px" border="0"></td>
  183. <td><img src="graphics\r1_c2.gif" width="352px" height="3px" border="0"></td>
  184. <td rowspan="3"><img ID="ImgProgRight" src="Graphics/r1_c3.gif" width="3px" height="18px" border="0"></td>
  185. </tr>
  186. <tr>
  187. <td valign="center"><img width="8px" height="12px" id="Bar" src="Graphics/greendot.jpg"></td>
  188. </tr>
  189. <tr>
  190. <td><img src="Graphics/r3_c2.gif" width="352px" height="3px" border="0"></td>
  191. </tr>
  192. </table>
  193. </td>
  194. </tr>
  195. <tr>
  196. <td>
  197. <Span ID="StatusPerCent" align="left" VALIGN=top width="5%"></Span>
  198. &nbsp;
  199. <Span ID="StatusMsg" align="left" VALIGN=top></Span>
  200. </td>
  201. </tr>
  202. </table>
  203. </DIV>
  204. <DIV ID="_data" STYLE="DISPLAY: none">
  205. <table width="100%" class="table-noborder sys-table-color-border" cellspacing="0" cellpadding="0">
  206. <tr>
  207. <td valign=top colspan="2">
  208. <table width="100%" cellspacing="0" cellpadding="0" class="sys-font-body sys-color-body">
  209. <tr>
  210. <td align="left" valign="bottom">
  211. <A class="sys-link-normal" ID="Refresh" href="#" onclick="window.location.reload()">refresh</a>
  212. </td>
  213. </tr>
  214. </table>
  215. </td>
  216. </tr>
  217. <tr>
  218. <td>&nbsp;
  219. </td>
  220. </tr>
  221. <tr>
  222. <td width="100%" valign=top>
  223. <table ID="Services" width="100%" class="table-border sys-table-color-border sys-font-body sys-color-body" cellspacing="0" cellpadding="0">
  224. <th valign="top" align="left" class="sys-table-header-bgcolor1 sys-toppane-header-color" style="padding : 0.5em;">
  225. <IMG height=16 src="Graphics/system.GIF" width=16 border=0 align="absmiddle">
  226. <span ID="Caption">&nbsp;</span>
  227. </th>
  228. <tr>
  229. <td valign="top">
  230. <table width="100%" cellspacing="0" cellpadding="0">
  231. <tr>
  232. <td colspan=4>
  233. <table width="100%" cellspacing="0" cellpadding="0" class="sys-font-body sys-color-body">
  234. <tr class="sys-table-cell-bgcolor1">
  235. <td ID="Col1" width="30%" align="left" valign="top" class="sys-font-body-bold table-rightborder table-bottomborder sys-table-color-border" style="padding : 0.5em;">&nbsp;</td>
  236. <td ID="Col2" width="23%" align="left" valign="top" class="sys-font-body-bold table-rightborder table-bottomborder sys-table-color-border" style="padding : 0.5em;">&nbsp;</td>
  237. <td ID="Col3" width="17%" align="left" valign="top" class="sys-font-body-bold table-rightborder table-bottomborder sys-table-color-border" style="padding : 0.5em;">&nbsp;</td>
  238. <td ID="Col4" width="20%" align="left" valign="top" class="sys-font-body-bold table-bottomborder sys-table-color-border" style="padding : 0.5em;">&nbsp;</td>
  239. </tr>
  240. </table>
  241. <table ID="services" width="100%" cellspacing="0" cellpadding="0" class="sys-font-body sys-color-body">
  242. <tr ondblclick="ShowDetail(this)" ID="tr_services">
  243. <td ID="name" width="30%" align="left" valign="top" class="table-rightborder sys-table-color-border" style="padding : 0.5em;">&nbsp;</td>
  244. <td ID="exe" width="23%" align="left" valign="top" class="table-rightborder sys-table-color-border" style="padding : 0.5em;">&nbsp;</td>
  245. <td ID="state" width="17%" align="left" valign="top" class="table-rightborder sys-table-color-border" style="padding : 0.5em;">&nbsp;</td>
  246. <td ID="startMode" width="20%" align="left" valign="top" style="padding : 0.5em;">&nbsp;</td>
  247. </tr>
  248. </table>
  249. </td>
  250. </tr>
  251. </table>
  252. </td>
  253. </tr>
  254. </table>
  255. </td>
  256. </tr>
  257. </table>
  258. </DIV>
  259. <OBJECT ID="wbemlocator" WIDTH=0 HEIGHT=0
  260. CLASSID="CLSID:76A64158-CB41-11D1-8B02-00600806D9B6">
  261. </OBJECT>
  262. <OBJECT ID="pchealth" WIDTH=0 HEIGHT=0
  263. CLASSID="CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7">
  264. </OBJECT>
  265. </body>
  266. </html>