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.
 
 
 
 
 
 

307 lines
7.2 KiB

<HTML>
<HEAD>
#include "header.inc"
#include "constants.inc"
#include "debug_js.inc"
#include "constants.inc"
<TITLE>REMOTE_ASSISTANCE</TITLE>
<BGSOUND id="idbgsound" SRC="ding.wav">
<meta http-equiv="MSThemeCompatible" content="Yes">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<OBJECT ID="pchealth" classid="CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7"></OBJECT>
<script id="Script1" name="Script1" LANGUAGE="Javascript" SRC="Common/Common.js"> </script>
<script id="Script2" name="Script2" Language="JavaScript">
var oRCSession = null;
var sSalemID = "";
var oDeskMgr = null;
var gHelper = null;
var gHelperName = null;
var gHelperIP = null;
var gFrom = null;
var gIsIM = false;
var gIsFile = false;
var gIsURA = false;
var gBVT = false;
var gIsPerf = false;
var gConnectTimer = null;
var gDisconnected = false;
var L_RCCTL_Text = "Remote Assistance failed. Please try again. ";
var L_EXPIREDBEFORESTARTED_Text = "The Remote Assistance invitation you sent was accepted but has since expired. Please resend the invitation to your assistant.";
var L_DEFAULTUSER_Text = "Expert ";
/*
Function :OnLoad1()
Description :
*/
function OnLoad1()
{
var obj = null;
var expertHelpBlob = null;
try
{
InitTrace();
TraceFunctEnter("OnLoad1");
obj = new ActiveXObject( szProgIDSetting );
}
catch (error)
{
FatalError(L_RCCTL_Text, error);
return;
}
try
{
oDeskMgr = pchealth.CreateObject_RemoteDesktopManager();
sSalemID = oDeskMgr.RCTicket;
expertHelpBlob = oDeskMgr.expertHelpBlob;
userHelpBlob = oDeskMgr.userHelpBlob;
var sIsIM = obj.GetPropertyInBlob(userHelpBlob, "IM");
if(sIsIM == "1")
{
gIsIM = true;
}
if (expertHelpBlob != null && (gHelperName == null || gHelperName == ""))
{
gHelperName = EscapedName( obj.GetPropertyInBlob(expertHelpBlob, "NAME") );
}
else
{
gHelperName = L_DEFAULTUSER_Text;
}
//alert("gHelperName: " + gHelperName);
gHelper = gHelperName; // it was point to BUDDY, change it to use NAME as gHelperName
//alert("gIsIM: " + gIsIM + " sIsIM: " + sIsIM.length);
if (userHelpBlob != null && (gFrom == null || gFrom == ""))
{
var szTmp = EscapedName( obj.GetPropertyInBlob(userHelpBlob, "FROM") );
if( szTmp.length < 20 )
{
gFrom = szTmp;
}
else
{
gFrom = szTmp.slice(0, 20) + "...";
}
}
else
{
gFrom = L_DEFAULTUSER_Text;
}
//alert("gFrom: " + gFrom);
#if 0
var sIsFile = obj.GetPropertyInBlob(expertHelpBlob, "FILE");
try
{
if( (null == sIsFile) || ( "0" == sIsFile ) || ( 0 == sIsFile.length))
{
gIsFile = false;
}
else
{
gIsFile = true;
}
}
catch(error)
{
gIsFile = false;
}
//alert("gIsFile: " + gIsFile);
#endif
var sIsURA = obj.GetPropertyInBlob(userHelpBlob, "UNSOLICITED");
try
{
if( ( "0" == sIsURA ) || (null == sIsURA) || ( 0 == sIsURA.length ))
{
gIsURA = false;
}
else
{
gIsURA = true;
gHelperName = EscapedName( obj.GetPropertyInBlob(userHelpBlob, "ID") );
gHelper = gHelperName;
#ifdef _BVT
if ( gHelperName == c_szBVTTESTER )
{
gHelperName = c_szBVTUSER;
gHelper = gHelperName;
gBVT = true;
frames.idSrc.LoadVariables();
// No need to ask.
Accepted();
}
#endif
}
}
catch(error)
{
gIsURA = false;
}
//alert("gIsURA: " + gIsURA);
}
catch (error)
{
FatalError(L_RCCTL_Text ,error);
return;
}
#if 0
if (true == gIsIM)
{
frames.idSrc.LoadVariables();
// No need to ask.
Accepted();
}
#endif
try
{
frames.idSrc.LoadVariables();
#if 0
var g_oShell = new ActiveXObject("WScript.Shell");
g_oShell.SendKeys("%c");
#endif
}
catch(error)
{
FatalError(L_RCCTL_Text,error);
}
TraceFunctLeave();
return;
}
function ConnectTimeout()
{
TraceFunctEnter("ConnectTimeout");
try
{
frames.idUI.DisplayDisconnectStatus();
}
catch(error)
{
FatalError(L_RCCTL_Text,error);
}
TraceFunctLeave();
return;
}
/*
Function : Accepted()
Description:
*/
function Accepted()
{
TraceFunctEnter("Accepted");
//
// Try to take the AcceptLock
//
try
{
oDeskMgr.ReserveAcceptedLock();
}
catch(error)
{
FatalError(error.description,error);
pchealth.Close();
return;
}
try
{
if (oRCSession == null)
{
oRCSession = pchealth.CreateObject_RemoteDesktopSession(
0,
sSalemID,
"");
}
frameset0.rows="0%,*";
frames.idUI.ResizeUI();
//frames.idUI.frames.idFrameTools.btnAbortConnection.disabled = false;
oRCSession.onConnected = function( salemID, userSID, sessionID)
{
clearTimeout( gConnectTimer );
if( false == gDisconnected )
{
frames.idUI.InitiateRCSession();
frames.idUI.frames.idFrameChatTop.InitChatServer();
}
else
{
frames.idUI.Helpee_OnClientDisconnectedEventHandler();
}
}
gConnectTimer = setTimeout("ConnectTimeout()", c_iCONNECTION_TIMEOUT);
oDeskMgr.Accepted();
}
catch (error)
{
if (error.number == -2147024894)
{
FatalError(L_EXPIREDBEFORESTARTED_Text, error);
}
else
FatalError(L_RCCTL_Text,error);
pchealth.Close();
}
TraceFunctLeave();
}
/*
Function : Rejected()
Description:
*/
function Rejected()
{
TraceFunctEnter("Rejected");
try
{
oDeskMgr.Rejected();
}
catch (error)
{
FatalError(L_RCCTL_Text,error);
pchealth.Close();
}
TraceFunctLeave();
}
</script>
</HEAD>
<frameset framespacing=0 frameborder=0 id="frameset0" rows="*,0%" onload="OnLoad1()">
<frame id="idSrc" name="idSrc" src="HelpeeAccept.htm">
<frame id="idUI" name="idUI" src="Interaction/Server/RAServer.htm">
</frameset>
</HTML>