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.

157 lines
4.2 KiB

  1. <HTML>
  2. <HEAD>
  3. <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
  4. <TITLE></TITLE>
  5. </HEAD>
  6. <BODY>
  7. <TABLE>
  8. <TBODY>
  9. <TR>
  10. <TD><BUTTON id=CreateNewSession name=CreateNewSession onclick=CreateNewSession()>Create new RDS Session</BUTTON></TD>
  11. <TD><BUTTON id=CloseSession name=CloseSession onclick=CloseSession()>Close open RDS Session</BUTTON></TD>
  12. </TR>
  13. </TBODY>
  14. </TABLE>
  15. <HR>
  16. <TABLE>
  17. <TBODY>
  18. <TR>
  19. <TD><BUTTON id=OpenExistingSession name=OpenExistingSession onclick=OpenExistingSession()>Open Existing RDS Session</BUTTON></TD>
  20. <TD><INPUT id=existingParms name=existingParms style="HEIGHT: 22px; WIDTH: 521px"></INPUT></TD>
  21. </TR>
  22. </TBODY>
  23. </TABLE>
  24. <HR>
  25. <TABLE>
  26. <TBODY>
  27. <TR>
  28. <TD><BUTTON id=updateConnectParms name=updateConnectParms onclick=UpdateConnectParms()>Update Connect Parms</BUTTON></TD>
  29. <TD><INPUT id=connectParms name=connectParms style="HEIGHT: 22px; WIDTH: 521px"></INPUT></TD>
  30. </TR>
  31. </TBODY>
  32. </TABLE>
  33. <HR>
  34. <TABLE>
  35. <TR>
  36. <TD><INPUT id=incomingChatText name=incomingChatText height="150" style="HEIGHT: 150px; WIDTH: 275px" width="275"
  37. ></INPUT></TD>
  38. </TR>
  39. <TR>
  40. <TD><INPUT id=chatText name=chatText style="WIDTH: 275px" width="275" ></INPUT></TD>
  41. <TD><BUTTON id=sendChatButton name=sendChatButton onclick=SendChatButtonHandler()>Send</BUTTON></TD>
  42. </TR>
  43. </TABLE>
  44. <OBJECT ID="pchealth" classid="CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7"></OBJECT>
  45. <SCRIPT Language="JScript">
  46. var RDSHost = null;
  47. var RemoteDesktopSession = null;
  48. var ChannelManager = null;
  49. var ChatChannel = null;
  50. var sPass = "";
  51. var iDuration = 36000;
  52. var DESKTOPSHARING_DEFAULT = 0x0000;
  53. var NO_DESKTOP_SHARING = 0x0001;
  54. var VIEWDESKTOP_PERMISSION_REQUIRE = 0x0002;
  55. var VIEWDESKTOP_PERMISSION_NOT_REQUIRE = 0x0004;
  56. var CONTROLDESKTOP_PERMISSION_REQUIRE = 0x0008;
  57. var CONTROLDESKTOP_PERMISSION_NOT_REQUIRE = 0x00010;
  58. function UpdateConnectParms() {
  59. if (RemoteDesktopSession != null) {
  60. var str;
  61. str = RemoteDesktopSession.ConnectParms;
  62. connectParms.value = str;
  63. }
  64. }
  65. function CreateNewSession() {
  66. if (RemoteDesktopSession != null)
  67. {
  68. alert("Must close existing session first.");
  69. return;
  70. }
  71. //RDSHost = new ActiveXObject("RDSHost.SAFRemoteDesktopServerHost.1");
  72. RemoteDesktopSession = pchealth.CreateObject_RemoteDesktopSession(
  73. CONTROLDESKTOP_PERMISSION_NOT_REQUIRE, iDuration,
  74. "", sPass);
  75. var x;
  76. ChannelManager = RemoteDesktopSession.ChannelManager;
  77. ChatChannel = ChannelManager.OpenDataChannel("70");
  78. ChatChannel.OnChannelDataReady = function()
  79. { OnChannelDataReadyEvent(); }
  80. // Bind events.
  81. RemoteDesktopSession.OnConnected = function()
  82. { OnClientConnected(); }
  83. RemoteDesktopSession.OnDisconnected = function()
  84. { OnClientDisconnected(); }
  85. }
  86. function OpenExistingSession() {
  87. if (RemoteDesktopSession != null)
  88. {
  89. alert("Must close existing session first.");
  90. return;
  91. }
  92. RemoteDesktopSession = pchealth.CreateObject_RemoteDesktopSession(
  93. VIEWDESKTOP_PERMISSION_NOT_REQUIRE, iDuration,
  94. existingParms.value, sPass);
  95. var x;
  96. ChannelManager = RemoteDesktopSession.ChannelManager;
  97. ChatChannel = ChannelManager.OpenDataChannel("70");
  98. ChatChannel.OnChannelDataReady = function()
  99. { OnChannelDataReadyEvent(); }
  100. // Bind events.
  101. RemoteDesktopSession.OnConnected = function()
  102. { OnClientConnected(); }
  103. RemoteDesktopSession.OnDisconnected = function()
  104. { OnClientDisconnected(); }
  105. }
  106. function CloseSession() {
  107. if (RemoteDesktopSession != null) {
  108. RemoteDesktopSession.CloseRemoteDesktopSession();
  109. RemoteDesktopSession = null;
  110. }
  111. }
  112. function SendChatButtonHandler() {
  113. if (ChatChannel != null) {
  114. ChatChannel.SendChannelData(chatText.value);
  115. }
  116. }
  117. function OnChannelDataReadyEvent(channelName) {
  118. var str;
  119. str = ChatChannel.ReceiveChannelData()
  120. incomingChatText.value = incomingChatText.value + "\n" + str;
  121. }
  122. function OnClientConnected() {
  123. alert("Client connected.");
  124. }
  125. function OnClientDisconnected() {
  126. alert("Client disconnected.");
  127. }
  128. </SCRIPT>
  129. </BODY>
  130. </HTML>