📄 scriptserver.cpp
字号:
/* * ScriptServer.cpp - part of jEditLauncher package * Copyright (C) 2001 John Gellene * jgellene@nyc.rr.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any later version. * * Notwithstanding the terms of the General Public License, the author grants * permission to compile and link object code generated by the compilation of * this program with object code and libraries that are not subject to the * GNU General Public License, provided that the executable output of such * compilation shall be distributed with source code on substantially the * same basis as the jEditLauncher package of which this program is a part. * By way of example, a distribution would satisfy this condition if it * included a working makefile for any freely available make utility that * runs on the Windows family of operating systems. This condition does not * require a licensee of this software to distribute any proprietary software * (including header files and libraries) that is licensed under terms * prohibiting redistribution to third parties. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id: ScriptServer.cpp,v 1.2 2001/09/05 11:24:52 jgellene Exp $ */#include "stdafx.h"#include "RegistryParser.h"#include "ScriptServer.h"/////////////////////////////////////////////////////////////////////////////// CScriptServerSTDMETHODIMP CScriptServer::ProcessScript(unsigned char* szScript){ DWORD dwResult = WaitForSingleObject(m_hMutex, 30000); if(dwResult == WAIT_TIMEOUT) return E_FAIL; pushScript(szScript); HRESULT hr = SendScript(); ReleaseMutex(m_hMutex); return hr;}STDMETHODIMP CScriptServer::FindServer(VARIANT_BOOL* pVFound){ HRESULT hr = m_pConn->FindServer(); *pVFound = (hr == S_OK) ? VARIANT_TRUE : VARIANT_FALSE; return hr;}STDMETHODIMP CScriptServer::GetServerPort(ULONG* pPort){ if(SUCCEEDED(m_pConn->FindServer())) *pPort = (ULONG)m_pConn->GetPort(); else *pPort = 0; return S_OK;}STDMETHODIMP CScriptServer::GetServerKey(ULONG* pKey){ if(SUCCEEDED(m_pConn->FindServer())) *pKey = (ULONG)m_pConn->GetKey(); else *pKey = 0; return S_OK;}STDMETHODIMP CScriptServer::SendScript(){ HRESULT hr = m_pConn->Connect(); if(SUCCEEDED(hr)) { Script_ *pScr = popScript(); if(pScr != 0) { char* pStr = (char*)pScr->szScript; m_pConn->SendData(pStr, strlen(pStr)); delete pScr; } } m_pConn->Disconnect(); return hr;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -