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.

124 lines
2.9 KiB

  1. <HTML>
  2. <HEAD>
  3. <META NAME="GENERATOR" Content="Microsoft Developer Studio">
  4. <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
  5. <OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
  6. <TITLE>Document Title</TITLE>
  7. </HEAD>
  8. <BODY>
  9. <SCRIPT LANGUAGE=javascript>
  10. <!--
  11. var g_dc;
  12. function dc_onStatusChange( dc, status )
  13. {
  14. Print( "onStatusChange " + status );
  15. Print( "Change = " + dc.Status );
  16. }
  17. function dc_onProgress( dc, lDone, lTotal )
  18. {
  19. Print( "onProgress " + lDone + " " + lTotal );
  20. Print( "Change = " + dc.Status );
  21. Print( "Percent = " + dc.PercentDone );
  22. }
  23. function dc_onComplete( dc, hr )
  24. {
  25. Print( "onComplete " + hr );
  26. Print( "Change = " + dc.Status );
  27. for(var e = new Enumerator( dc.Reports ); !e.atEnd(); e.moveNext())
  28. {
  29. var rep = e.item();
  30. if(rep.ErrorCode != 0)
  31. {
  32. alert( "Error: " + rep.ErrorCode + " on " + rep.WQL );
  33. }
  34. }
  35. if(hr == 0)
  36. {
  37. stream = dc.MachineData_GetStream();
  38. if(stream != null)
  39. {
  40. pchealth.CopyStreamToFile( "C:\\MachineData.xml", stream );
  41. }
  42. stream = dc.History_GetStream();
  43. if(stream != null)
  44. {
  45. pchealth.CopyStreamToFile( "C:\\History.xml", stream );
  46. }
  47. }
  48. g_dc = null;
  49. }
  50. /////////////////////////////////////////////////////////////////////////////
  51. function delta_onComplete( dc, hr )
  52. {
  53. Print( "onComplete " + hr );
  54. Print( "Change = " + dc.Status );
  55. g_dc = null;
  56. }
  57. /////////////////////////////////////////////////////////////////////////////
  58. function Print( line )
  59. {
  60. out.innerHTML = out.innerHTML + line + "<BR>";
  61. }
  62. function button_exec()
  63. {
  64. // debugger;
  65. g_dc = pchealth.CreateObject_DataCollection();
  66. g_dc.MachineData_DataSpec = "s:\\slm_pchealth\\src\\HelpCtr\\ScriptLib\\UnitTest\\sup1_DataSpec.xml"
  67. g_dc.History_DataSpec = "s:\\slm_pchealth\\src\\HelpCtr\\ScriptLib\\UnitTest\\sup1_History.xml"
  68. g_dc.History_MaxDeltas = 2;
  69. g_dc.onStatusChange = dc_onStatusChange;
  70. g_dc.onProgress = dc_onProgress;
  71. g_dc.onComplete = dc_onComplete;
  72. g_dc.ExecuteAsync();
  73. }
  74. function button_delta()
  75. {
  76. // debugger;
  77. g_dc = pchealth.CreateObject_DataCollection();
  78. g_dc.onComplete = delta_onComplete;
  79. g_dc.CompareSnapshots( "c:\\MachineData.xml", "c:\\MachineData2.xml", "c:\\Delta.xml" );
  80. }
  81. function button_abort()
  82. {
  83. if(g_dc != null)
  84. {
  85. g_dc.Abort();
  86. }
  87. }
  88. //-->
  89. </SCRIPT>
  90. <INPUT type="button" value="Start Collection" onClick="button_exec();">&nbsp;
  91. <INPUT type="button" value="Start Delta" onClick="button_delta();">&nbsp;
  92. <INPUT type="button" value="Abort" onClick="button_abort();"><P>
  93. <DIV ID=out></DIV>
  94. </BODY>
  95. </HTML>