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.

270 lines
12 KiB

  1. <HTML>
  2. <HEAD>
  3. <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
  4. <TITLE></TITLE>
  5. </HEAD>
  6. <BODY topMargin=0>
  7. <TABLE>
  8. <TR>
  9. <TD><BUTTON id=connectButton name=connectButton onclick=ConnectButtonHandler()>Connect</BUTTON></TD>
  10. <TD><INPUT id=parmsInput name=parmsInput
  11. style="WIDTH: 400px" width="400"></INPUT></TD>
  12. <TD><BUTTON id=disconnectButton name=disconnectButton onclick=DisconnectButtonHandler()>Disconnect</BUTTON></TD></TR>
  13. </TABLE>
  14. <TABLE border=0 cellPadding=0 cellSpacing=0>
  15. <TBODY>
  16. <TR>
  17. <TD>
  18. <P>
  19. <OBJECT classid=clsid:299BE050-E83E-4DB7-A7DA-D86FDEBFE6D0
  20. data=data:application/x-oleobject;base64,UOCbKT7ot02n2thv3r/m0AADAAAlQgAAnDEAAA==
  21. height=480 id=ClientHost name=ClientHost
  22. style="BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; HEIGHT: 480px; WIDTH: 640px"
  23. width=640></OBJECT>
  24. </P>
  25. </TD>
  26. </TR>
  27. </TBODY>
  28. </TABLE>
  29. <P></P>
  30. <BUTTON id=remoteControlButton name=RemoteControlButton onclick=RemoteControlButtonHandler()>Remote Control</BUTTON>
  31. <BUTTON id=stopRemoteControlButton name=stopRemoteControlButton onclick=RemoteControlEndButtonHandler()>Stop Remote Control</BUTTON>
  32. <TABLE>
  33. <TR>
  34. <TD>
  35. <TABLE>
  36. <TR>
  37. <TD><INPUT id=incomingChatText name=incomingChatText height="150" style="HEIGHT: 150px; WIDTH: 275px" width="275"
  38. ></INPUT></TD>
  39. </TR>
  40. <TR>
  41. <TD><INPUT id=chatText name=chatText style="WIDTH: 275px" width="275" ></INPUT></TD>
  42. <TD><BUTTON id=sendChatButton name=sendChatButton onclick=SendChatButtonHandler()>Send</BUTTON></TD>
  43. </TR>
  44. </TABLE>
  45. </TD>
  46. </TR>
  47. </TABLE>
  48. <SCRIPT Language="JScript">
  49. var RemoteDesktopClientObj = null;
  50. var QryMgr = null;
  51. var FolderNodeId = 0;
  52. var RootDataCol = null;
  53. var ChannelManager = null;
  54. var ChatChannel = null;
  55. var Server = null;
  56. var Port = null;
  57. function ConnectedHandler() {
  58. Server = RemoteDesktopClientObj.ConnectedServer;
  59. Port = RemoteDesktopClientObj.ConnectedPort;
  60. alert("ClientHost_Connected " + Server + " " + Port);
  61. }
  62. function SendChatButtonHandler() {
  63. if (ChatChannel != null) {
  64. ChatChannel.SendChannelData(chatText.value);
  65. }
  66. }
  67. function DisconnectButtonHandler() {
  68. if (RemoteDesktopClientObj != null) {
  69. RemoteDesktopClientObj.DisconnectFromServer();
  70. }
  71. }
  72. function RemoteControlButtonHandler() {
  73. if (RemoteDesktopClientObj != null) {
  74. RemoteDesktopClientObj.ConnectRemoteDesktop();
  75. }
  76. }
  77. function RemoteControlEndButtonHandler() {
  78. if (RemoteDesktopClientObj != null) {
  79. RemoteDesktopClientObj.DisconnectRemoteDesktop();
  80. }
  81. }
  82. function DisconnectedHandler(reason) {
  83. var str = "Unknown Error!!!!";
  84. switch(reason) {
  85. case 0 : str = "SAFERROR_NOERROR";
  86. break;
  87. case 1 : str = "SAFERROR_NOINFO";
  88. break;
  89. case 3 : str = "SAFERROR_LOCALNOTERROR";
  90. break;
  91. case 4 : str = "SAFERROR_REMOTEBYUSER";
  92. break;
  93. case 5 : str = "SAFERROR_BYSERVER";
  94. break;
  95. case 6 : str = "SAFERROR_DNSLOOKUPFAILED";
  96. break;
  97. case 7 : str = "SAFERROR_OUTOFMEMORY";
  98. break;
  99. case 8 : str = "SAFERROR_CONNECTIONTIMEDOUT";
  100. break;
  101. case 9 : str = "SAFERROR_SOCKETCONNECTFAILED";
  102. break;
  103. case 11 : str = "SAFERROR_HOSTNOTFOUND";
  104. break;
  105. case 12 : str = "SAFERROR_WINSOCKSENDFAILED";
  106. break;
  107. case 14 : str = "SAFERROR_INVALIDIPADDR";
  108. break;
  109. case 15 : str = "SAFERROR_SOCKETRECVFAILED";
  110. break;
  111. case 18 : str = "SAFERROR_INVALIDENCRYPTION";
  112. break;
  113. case 20 : str = "SAFERROR_GETHOSTBYNAMEFAILED";
  114. break;
  115. case 21 : str = "SAFERROR_LICENSINGFAILED";
  116. break;
  117. case 22 : str = "SAFERROR_ENCRYPTIONERROR";
  118. break;
  119. case 23 : str = "SAFERROR_DECRYPTIONERROR";
  120. break;
  121. case 24 : str = "SAFERROR_INVALIDPARAMETERSTRING";
  122. break;
  123. case 25 : str = "SAFERROR_HELPSESSIONNOTFOUND";
  124. break;
  125. case 26 : str = "SAFERROR_INVALIDPASSWORD";
  126. break;
  127. case 27 : str = "SAFERROR_HELPSESSIONEXPIRED";
  128. break;
  129. case 28 : str = "SAFERROR_CANTOPENRESOLVER";
  130. break;
  131. case 29 : str = "SAFERROR_UNKNOWNSESSMGRERROR";
  132. break;
  133. case 30 : str = "SAFERROR_CANTFORMLINKTOUSERSESSION";
  134. break;
  135. case 31 : str = "SAFERROR_SHADOWFAILED";
  136. break;
  137. case 32 : str = "SAFERROR_RCPROTOCOLERROR";
  138. break;
  139. case 33 : str = "SAFERROR_RCUNKNOWNERROR";
  140. break;
  141. case 34 : str = "SAFERROR_INTERNALERROR";
  142. break;
  143. }
  144. var msg = "ClientHost_Disconnected: " + str;
  145. alert(msg);
  146. }
  147. function RemoteControlRequestCompleteHandler(status) {
  148. var str = "Unknown Error!!!!";
  149. if (status != 0) {
  150. switch(status) {
  151. case 0 : str = "SAFERROR_NOERROR";
  152. break;
  153. case 1 : str = "SAFERROR_NOINFO";
  154. break;
  155. case 3 : str = "SAFERROR_LOCALNOTERROR";
  156. break;
  157. case 4 : str = "SAFERROR_REMOTEBYUSER";
  158. break;
  159. case 5 : str = "SAFERROR_BYSERVER";
  160. break;
  161. case 6 : str = "SAFERROR_DNSLOOKUPFAILED";
  162. break;
  163. case 7 : str = "SAFERROR_OUTOFMEMORY";
  164. break;
  165. case 8 : str = "SAFERROR_CONNECTIONTIMEDOUT";
  166. break;
  167. case 9 : str = "SAFERROR_SOCKETCONNECTFAILED";
  168. break;
  169. case 11 : str = "SAFERROR_HOSTNOTFOUND";
  170. break;
  171. case 12 : str = "SAFERROR_WINSOCKSENDFAILED";
  172. break;
  173. case 14 : str = "SAFERROR_INVALIDIPADDR";
  174. break;
  175. case 15 : str = "SAFERROR_SOCKETRECVFAILED";
  176. break;
  177. case 18 : str = "SAFERROR_INVALIDENCRYPTION";
  178. break;
  179. case 20 : str = "SAFERROR_GETHOSTBYNAMEFAILED";
  180. break;
  181. case 21 : str = "SAFERROR_LICENSINGFAILED";
  182. break;
  183. case 22 : str = "SAFERROR_ENCRYPTIONERROR";
  184. break;
  185. case 23 : str = "SAFERROR_DECRYPTIONERROR";
  186. break;
  187. case 24 : str = "SAFERROR_INVALIDPARAMETERSTRING";
  188. break;
  189. case 25 : str = "SAFERROR_HELPSESSIONNOTFOUND";
  190. break;
  191. case 26 : str = "SAFERROR_INVALIDPASSWORD";
  192. break;
  193. case 27 : str = "SAFERROR_HELPSESSIONEXPIRED";
  194. break;
  195. case 28 : str = "SAFERROR_CANTOPENRESOLVER";
  196. break;
  197. case 29 : str = "SAFERROR_UNKNOWNSESSMGRERROR";
  198. break;
  199. case 30 : str = "SAFERROR_CANTFORMLINKTOUSERSESSION";
  200. break;
  201. case 31 : str = "SAFERROR_SHADOWFAILED";
  202. break;
  203. case 32 : str = "SAFERROR_RCPROTOCOLERROR";
  204. break;
  205. case 33 : str = "SAFERROR_RCUNKNOWNERROR";
  206. break;
  207. case 34 : str = "SAFERROR_INTERNALERROR";
  208. break;
  209. }
  210. var msg = "RemoteControlRequestCompleteHandler: " + str;
  211. alert(msg);
  212. }
  213. }
  214. function ChannelDataReadyHandler(channelID) {
  215. var str;
  216. str = ChatChannel.ReceiveChannelData();
  217. incomingChatText.value = incomingChatText.value + "\n" + str;
  218. }
  219. function ConnectButtonHandler() {
  220. RemoteDesktopClientObj = ClientHost.GetRemoteDesktopClient();
  221. // RemoteDesktopClientObj.EnableSmartSizing = true;
  222. // Bind the event handlers for this object.
  223. RemoteDesktopClientObj.OnConnected = function()
  224. { ConnectedHandler(); }
  225. RemoteDesktopClientObj.OnDisconnected = function(reason)
  226. { DisconnectedHandler(reason); }
  227. RemoteDesktopClientObj.OnConnectRemoteDesktopComplete = function(status)
  228. { RemoteControlRequestCompleteHandler(status); }
  229. // Add the 'chat' channel.
  230. ChannelManager = RemoteDesktopClientObj.ChannelManager;
  231. if (ChatChannel == null) {
  232. ChatChannel = ChannelManager.OpenDataChannel("70");
  233. ChatChannel.OnChannelDataReady = function()
  234. { ChannelDataReadyHandler(); }
  235. }
  236. RemoteDesktopClientObj.ConnectParms = parmsInput.value;
  237. RemoteDesktopClientObj.ConnectToServer("12345");
  238. }
  239. </SCRIPT>
  240. </BODY>
  241. </HTML>