远程桌面优化
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -66,3 +66,4 @@ server/2015Remote/2015Remote.aps
|
||||
*.aps
|
||||
*.suo
|
||||
server/2015Remote.VC.db
|
||||
server/2015Remote.opensdf
|
||||
|
||||
22
ReadMe.txt
22
ReadMe.txt
@@ -30,3 +30,25 @@
|
||||
1、ghost单台电脑只允许启动唯一的实例。
|
||||
|
||||
2、远程桌面反应迟钝,改用每秒传送8帧屏幕,后续有待优化。
|
||||
|
||||
2019.1.8
|
||||
|
||||
1、发现传屏的瓶颈在zlib压缩数据,更新zlib到版本V1.2.11,提高传送屏幕速度到每秒10帧。
|
||||
|
||||
2、ghost的类CBuffer不需要临界区。
|
||||
|
||||
2019.1.9
|
||||
|
||||
1、服务端IOCPServer类的工作线程改为计算机核心个数的2倍。
|
||||
|
||||
2、解决服务端主动退出的内存泄漏问题,泄漏源在OVERLAPPEDPLUS。
|
||||
|
||||
2019.1.10
|
||||
|
||||
1、服务端远程控制增加全屏(系统右键菜单)、退出全屏(F11)的功能。
|
||||
|
||||
2、修复客户端机器屏幕缩放时远程桌面鼠标光标位置不准确的问题。(跟踪光标受影响)
|
||||
|
||||
3、发现服务端需要采用默认英文输入法,才能在远程桌面输入中文(怀疑本地输入法截获消息)。
|
||||
|
||||
4、添加崩溃时写dump文件的代码。
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
#include "StdAfx.h"
|
||||
#include "Buffer.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
||||
#define U_PAGE_ALIGNMENT 3
|
||||
#define F_PAGE_ALIGNMENT 3.0
|
||||
CBuffer::CBuffer(void)
|
||||
|
||||
CBuffer::CBuffer()
|
||||
{
|
||||
m_ulMaxLength = 0;
|
||||
|
||||
m_Ptr = m_Base = NULL;
|
||||
|
||||
InitializeCriticalSection(&m_cs);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +22,6 @@ CBuffer::~CBuffer(void)
|
||||
m_Base = NULL;
|
||||
}
|
||||
|
||||
DeleteCriticalSection(&m_cs);
|
||||
|
||||
m_Base = m_Ptr = NULL;
|
||||
m_ulMaxLength = 0;
|
||||
}
|
||||
@@ -34,11 +30,8 @@ CBuffer::~CBuffer(void)
|
||||
|
||||
ULONG CBuffer::ReadBuffer(PBYTE Buffer, ULONG ulLength)
|
||||
{
|
||||
EnterCriticalSection(&m_cs);
|
||||
|
||||
if (ulLength > GetBufferMaxLength())
|
||||
{
|
||||
LeaveCriticalSection(&m_cs);
|
||||
return 0;
|
||||
}
|
||||
if (ulLength > GetBufferLength())
|
||||
@@ -56,7 +49,6 @@ ULONG CBuffer::ReadBuffer(PBYTE Buffer, ULONG ulLength)
|
||||
|
||||
DeAllocateBuffer(GetBufferLength());
|
||||
|
||||
LeaveCriticalSection(&m_cs);
|
||||
return ulLength;
|
||||
}
|
||||
|
||||
@@ -92,18 +84,14 @@ ULONG CBuffer::DeAllocateBuffer(ULONG ulLength)
|
||||
|
||||
BOOL CBuffer::WriteBuffer(PBYTE Buffer, ULONG ulLength)
|
||||
{
|
||||
EnterCriticalSection(&m_cs);
|
||||
|
||||
if (ReAllocateBuffer(ulLength + GetBufferLength()) == -1)//10 +1 1024
|
||||
{
|
||||
LeaveCriticalSection(&m_cs);
|
||||
return false;
|
||||
}
|
||||
|
||||
CopyMemory(m_Ptr,Buffer,ulLength);//Hello 5
|
||||
|
||||
m_Ptr+=ulLength;
|
||||
LeaveCriticalSection(&m_cs);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -140,11 +128,9 @@ ULONG CBuffer::ReAllocateBuffer(ULONG ulLength)
|
||||
|
||||
VOID CBuffer::ClearBuffer()
|
||||
{
|
||||
EnterCriticalSection(&m_cs);
|
||||
m_Ptr = m_Base;
|
||||
|
||||
DeAllocateBuffer(1024);
|
||||
LeaveCriticalSection(&m_cs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,5 +21,4 @@ protected:
|
||||
PBYTE m_Base;
|
||||
PBYTE m_Ptr;
|
||||
ULONG m_ulMaxLength;
|
||||
CRITICAL_SECTION m_cs;
|
||||
};
|
||||
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
return (BYTE*)m_BitmapData_Full;
|
||||
}
|
||||
|
||||
STDMETHODIMP SampleCB( double dbSampleTime, IMediaSample * Sample)
|
||||
STDMETHODIMP SampleCB(double dbSampleTime, IMediaSample * Sample)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>./;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
@@ -62,6 +63,7 @@
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<AdditionalIncludeDirectories>./;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
||||
@@ -96,7 +96,7 @@ ULONG CFileManager::SendDiskDriverList() //
|
||||
|
||||
CFileManager::~CFileManager()
|
||||
{
|
||||
cout<<"Զ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"<<endl;
|
||||
cout<<"Զ<EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n";
|
||||
}
|
||||
|
||||
VOID CFileManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
|
||||
@@ -153,7 +153,7 @@ DWORD WINAPI IOCPClient::WorkThreadProc(LPVOID lParam)
|
||||
break;
|
||||
}else{
|
||||
//<2F><>ȷ<EFBFBD><C8B7><EFBFBD>վ͵<D5BE><CDB5><EFBFBD>OnRead<61><64><EFBFBD><EFBFBD>,ת<><D7AA>OnRead
|
||||
This->OnServerReceiving((char*)szBuffer, iReceivedLength);
|
||||
This->OnServerReceiving(szBuffer, iReceivedLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,6 +170,7 @@ VOID IOCPClient::OnServerReceiving(char* szBuffer, ULONG ulLength)
|
||||
{
|
||||
assert (ulLength > 0);
|
||||
//<2F><><EFBFBD>½ӵ<C2BD><D3B5><EFBFBD><EFBFBD>ݽ<EFBFBD><DDBD>н<EFBFBD>ѹ<EFBFBD><D1B9>
|
||||
CBuffer m_CompressedBuffer;
|
||||
m_CompressedBuffer.WriteBuffer((LPBYTE)szBuffer, ulLength);
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7>С <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǾͲ<C7BE><CDB2><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@ -210,7 +211,7 @@ VOID IOCPClient::OnServerReceiving(char* szBuffer, ULONG ulLength)
|
||||
|
||||
if (iRet == Z_OK)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD>ɹ<EFBFBD>
|
||||
{
|
||||
m_DeCompressedBuffer.ClearBuffer();
|
||||
CBuffer m_DeCompressedBuffer;
|
||||
m_DeCompressedBuffer.WriteBuffer(DeCompressedBuffer,
|
||||
ulOriginalLength);
|
||||
|
||||
@@ -228,18 +229,13 @@ VOID IOCPClient::OnServerReceiving(char* szBuffer, ULONG ulLength)
|
||||
else
|
||||
break;
|
||||
}
|
||||
}catch(...)
|
||||
{
|
||||
m_CompressedBuffer.ClearBuffer();
|
||||
}
|
||||
}catch(...) { }
|
||||
}
|
||||
|
||||
|
||||
int IOCPClient::OnServerSending(const char* szBuffer, ULONG ulOriginalLength) //Hello
|
||||
{
|
||||
m_WriteBuffer.ClearBuffer();
|
||||
|
||||
if (ulOriginalLength > 0)
|
||||
assert (ulOriginalLength > 0);
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD>1.001<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD>õ<EFBFBD><EFBFBD>ڴ<EFBFBD><EFBFBD>ռ<EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> +12
|
||||
//<2F><>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>// HelloWorld 10 22
|
||||
@@ -250,7 +246,6 @@ int IOCPClient::OnServerSending(const char* szBuffer, ULONG ulOriginalLength) /
|
||||
LPBYTE CompressedBuffer = new BYTE[ulCompressedLength];
|
||||
|
||||
int iRet = compress(CompressedBuffer, &ulCompressedLength, (PBYTE)szBuffer, ulOriginalLength);
|
||||
|
||||
if (iRet != Z_OK)
|
||||
{
|
||||
delete [] CompressedBuffer;
|
||||
@@ -258,45 +253,42 @@ int IOCPClient::OnServerSending(const char* szBuffer, ULONG ulOriginalLength) /
|
||||
}
|
||||
|
||||
ULONG ulPackTotalLength = ulCompressedLength + HDR_LENGTH;
|
||||
CBuffer m_WriteBuffer;
|
||||
|
||||
m_WriteBuffer.WriteBuffer((PBYTE)m_szPacketFlag, sizeof(m_szPacketFlag));
|
||||
|
||||
m_WriteBuffer.WriteBuffer((PBYTE) &ulPackTotalLength,sizeof(ULONG));
|
||||
// 5 4
|
||||
//[Shine][ 30 ]
|
||||
|
||||
m_WriteBuffer.WriteBuffer((PBYTE)&ulOriginalLength, sizeof(ULONG));
|
||||
// 5 4 4
|
||||
//[Shine][ 30 ][5]
|
||||
|
||||
m_WriteBuffer.WriteBuffer(CompressedBuffer,ulCompressedLength);
|
||||
|
||||
delete [] CompressedBuffer;
|
||||
CompressedBuffer = NULL;
|
||||
}
|
||||
// <20>ֿ鷢<D6BF><E9B7A2>
|
||||
//shine[0035][0010][HelloWorld+12]
|
||||
return SendWithSplit((char*)m_WriteBuffer.GetBuffer(), m_WriteBuffer.GetBufferLength(),
|
||||
MAX_SEND_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
// 5 2 // 2 2 1
|
||||
BOOL IOCPClient::SendWithSplit(char* szBuffer, ULONG ulLength, ULONG ulSplitLength)
|
||||
BOOL IOCPClient::SendWithSplit(const char* szBuffer, ULONG ulLength, ULONG ulSplitLength)
|
||||
{
|
||||
//1025
|
||||
int iReturn = 0; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˶<EFBFBD><CBB6><EFBFBD>
|
||||
const char* Travel = (char *)szBuffer;
|
||||
const char* Travel = szBuffer;
|
||||
int i = 0;
|
||||
ULONG ulSended = 0;
|
||||
ULONG ulSendRetry = 15;
|
||||
int ulSended = 0;
|
||||
const int ulSendRetry = 15;
|
||||
// <20><><EFBFBD>η<EFBFBD><CEB7><EFBFBD>
|
||||
|
||||
for (i = ulLength; i >= ulSplitLength; i -= ulSplitLength)
|
||||
{
|
||||
int j = 0;
|
||||
for (; j < ulSendRetry; j++)
|
||||
for (; j < ulSendRetry; ++j)
|
||||
{
|
||||
iReturn = send(m_sClientSocket, Travel, ulSplitLength,0);
|
||||
iReturn = send(m_sClientSocket, Travel, ulSplitLength, 0);
|
||||
if (iReturn > 0)
|
||||
{
|
||||
break;
|
||||
@@ -309,17 +301,15 @@ BOOL IOCPClient::SendWithSplit(char* szBuffer, ULONG ulLength, ULONG ulSplitLeng
|
||||
|
||||
ulSended += iReturn;
|
||||
Travel += ulSplitLength;
|
||||
Sleep(15); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD>ݻ<EFBFBD><DDBB><EFBFBD>
|
||||
}
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IJ<EFBFBD><C4B2><EFBFBD>
|
||||
if (i>0) //1024
|
||||
{
|
||||
int j = 0;
|
||||
for (; j < ulSendRetry; j++) //nSendRetry = 15
|
||||
for (; j < ulSendRetry; j++)
|
||||
{
|
||||
iReturn = send(m_sClientSocket, (char*)Travel,i,0);
|
||||
|
||||
Sleep(15);
|
||||
if (iReturn > 0)
|
||||
{
|
||||
break;
|
||||
@@ -329,16 +319,10 @@ BOOL IOCPClient::SendWithSplit(char* szBuffer, ULONG ulLength, ULONG ulSplitLeng
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
ulSended += iReturn; //0+=1000
|
||||
}
|
||||
if (ulSended == ulLength)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
ulSended += iReturn;
|
||||
}
|
||||
|
||||
return (ulSended == ulLength) ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
|
||||
VOID OnServerReceiving(char* szBuffer, ULONG ulReceivedLength);
|
||||
int OnServerSending(const char* szBuffer, ULONG ulOriginalLength);
|
||||
BOOL SendWithSplit(char* szBuffer, ULONG ulLength, ULONG ulSplitLength);
|
||||
BOOL SendWithSplit(const char* szBuffer, ULONG ulLength, ULONG ulSplitLength);
|
||||
|
||||
BOOL IsRunning() const
|
||||
{
|
||||
@@ -48,9 +48,6 @@ public:
|
||||
|
||||
BOOL m_bIsRunning;
|
||||
BOOL m_bConnected;
|
||||
CBuffer m_WriteBuffer;
|
||||
CBuffer m_CompressedBuffer;
|
||||
CBuffer m_DeCompressedBuffer;
|
||||
|
||||
char m_szPacketFlag[FLAG_LENGTH];
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ CRegisterManager::CRegisterManager(IOCPClient* ClientObject, int n):CManager(Cli
|
||||
|
||||
CRegisterManager::~CRegisterManager()
|
||||
{
|
||||
cout<<"CRegisterManager <20><><EFBFBD><EFBFBD>"<<endl;
|
||||
cout<<"CRegisterManager <20><><EFBFBD><EFBFBD>\n";
|
||||
}
|
||||
|
||||
VOID CRegisterManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
|
||||
@@ -28,10 +28,6 @@ CScreenManager::CScreenManager(IOCPClient* ClientObject, int n):CManager(ClientO
|
||||
|
||||
m_ScreenSpyObject = new CScreenSpy(16);
|
||||
|
||||
if (m_ScreenSpyObject==NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_hWorkThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)WorkThreadProc,this,0,NULL);
|
||||
}
|
||||
|
||||
@@ -41,13 +37,13 @@ DWORD WINAPI CScreenManager::WorkThreadProc(LPVOID lParam)
|
||||
CScreenManager *This = (CScreenManager *)lParam;
|
||||
|
||||
This->SendBitMapInfor(); //<2F><><EFBFBD><EFBFBD>bmpλͼ<CEBB>ṹ
|
||||
// <20>ȿ<EFBFBD><C8BF>ƶ˶Ի<CBB6><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
// <20>ȿ<EFBFBD><C8BF>ƶ˶Ի<CBB6><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
This->WaitForDialogOpen();
|
||||
|
||||
clock_t last = clock();
|
||||
This->SendFirstScreen();
|
||||
const int fps = 8;// ֡<><D6A1>
|
||||
const int fps = 10;// ֡<><D6A1>
|
||||
const int sleep = 1000 / fps;// <20><><EFBFBD><EFBFBD>ʱ<EFBFBD>䣨ms<6D><73>
|
||||
while (This->m_bIsWorking)
|
||||
{
|
||||
@@ -66,7 +62,7 @@ DWORD WINAPI CScreenManager::WorkThreadProc(LPVOID lParam)
|
||||
}
|
||||
}
|
||||
|
||||
cout<<"ScreenWorkThread Exit"<<endl;
|
||||
cout<<"ScreenWorkThread Exit\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -74,8 +70,7 @@ DWORD WINAPI CScreenManager::WorkThreadProc(LPVOID lParam)
|
||||
VOID CScreenManager::SendBitMapInfor()
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>bmp<6D>ṹ<EFBFBD>Ĵ<EFBFBD>С
|
||||
|
||||
ULONG ulLength = 1 + m_ScreenSpyObject->GetBISize(); //<2F><>С
|
||||
ULONG ulLength = 1 + m_ScreenSpyObject->GetBISize();
|
||||
LPBYTE szBuffer = (LPBYTE)VirtualAlloc(NULL,
|
||||
ulLength, MEM_COMMIT, PAGE_READWRITE);
|
||||
|
||||
@@ -88,7 +83,7 @@ VOID CScreenManager::SendBitMapInfor()
|
||||
|
||||
CScreenManager::~CScreenManager()
|
||||
{
|
||||
cout<<"ScreenManager <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"<<endl;
|
||||
cout<<"ScreenManager <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n";
|
||||
|
||||
m_bIsWorking = FALSE;
|
||||
|
||||
@@ -115,7 +110,7 @@ VOID CScreenManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
{
|
||||
BlockInput(false);
|
||||
ProcessCommand(szBuffer + 1, ulLength - 1);
|
||||
BlockInput(m_bIsBlockInput); //<2F>ٻظ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
BlockInput(m_bIsBlockInput); //<2F>ٻָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -127,7 +122,7 @@ VOID CScreenManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
|
||||
break;
|
||||
}
|
||||
case COMMAND_SCREEN_GET_CLIPBOARD: //<2F><><EFBFBD><EFBFBD>
|
||||
case COMMAND_SCREEN_GET_CLIPBOARD:
|
||||
{
|
||||
SendClientClipboard();
|
||||
break;
|
||||
@@ -186,10 +181,7 @@ VOID CScreenManager::SendFirstScreen()
|
||||
{
|
||||
//<2F><>CScreenSpy<70><79>getFirstScreen<65><6E><EFBFBD><EFBFBD><EFBFBD>еõ<D0B5>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//Ȼ<><C8BB><EFBFBD><EFBFBD>getFirstImageSize<7A>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ݵĴ<DDB5>СȻ<D0A1><C8BB><EFBFBD><EFBFBD><EFBFBD>ͳ<EFBFBD>ȥ
|
||||
BOOL bRet = FALSE;
|
||||
LPVOID FirstScreenData = NULL;
|
||||
|
||||
FirstScreenData = m_ScreenSpyObject->GetFirstScreenData();
|
||||
LPVOID FirstScreenData = m_ScreenSpyObject->GetFirstScreenData();
|
||||
if (FirstScreenData == NULL)
|
||||
{
|
||||
return;
|
||||
@@ -197,10 +189,6 @@ VOID CScreenManager::SendFirstScreen()
|
||||
|
||||
ULONG ulFirstSendLength = 1 + m_ScreenSpyObject->GetFirstScreenLength();
|
||||
LPBYTE szBuffer = new BYTE[ulFirstSendLength];
|
||||
if (szBuffer == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
szBuffer[0] = TOKEN_FIRSTSCREEN;
|
||||
memcpy(szBuffer + 1, FirstScreenData, ulFirstSendLength - 1);
|
||||
@@ -214,8 +202,7 @@ VOID CScreenManager::SendFirstScreen()
|
||||
|
||||
const char* CScreenManager::GetNextScreen(ULONG &ulNextSendLength)
|
||||
{
|
||||
//<2F>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ݣ<EFBFBD><DDA3>õ<EFBFBD><C3B5><EFBFBD><EFBFBD>ݴ<EFBFBD>С<EFBFBD><D0A1>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//<2F><><EFBFBD>ǵ<EFBFBD>getNextScreen<65><6E><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>
|
||||
AUTO_TICK(5);
|
||||
LPVOID NextScreenData = m_ScreenSpyObject->GetNextScreenData(&ulNextSendLength);
|
||||
|
||||
if (ulNextSendLength == 0 || NextScreenData == NULL)
|
||||
@@ -248,9 +235,7 @@ VOID CScreenManager::ProcessCommand(LPBYTE szBuffer, ULONG ulLength)
|
||||
ULONG ulMsgCount = ulLength / sizeof(MSG);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
//1ruan kdjfkdf gan
|
||||
for (int i = 0; i < ulMsgCount; i++) //1
|
||||
for (int i = 0; i < ulMsgCount; ++i)
|
||||
{
|
||||
MSG *Msg = (MSG *)(szBuffer + i * sizeof(MSG));
|
||||
switch (Msg->message)
|
||||
@@ -268,8 +253,13 @@ VOID CScreenManager::ProcessCommand(LPBYTE szBuffer, ULONG ulLength)
|
||||
POINT Point;
|
||||
Point.x = LOWORD(Msg->lParam);
|
||||
Point.y = HIWORD(Msg->lParam);
|
||||
if(m_ScreenSpyObject->m_bZoomed)
|
||||
{
|
||||
Point.x *= m_ScreenSpyObject->m_wZoom;
|
||||
Point.y *= m_ScreenSpyObject->m_hZoom;
|
||||
}
|
||||
SetCursorPos(Point.x, Point.y);
|
||||
SetCapture(WindowFromPoint(Point)); //???
|
||||
SetCapture(WindowFromPoint(Point));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -39,7 +39,11 @@ CScreenSpy::CScreenSpy(ULONG ulbiBitCount)
|
||||
BOOL Isgetdisplay = EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devmode);
|
||||
m_ulFullWidth = devmode.dmPelsWidth;
|
||||
m_ulFullHeight = devmode.dmPelsHeight;
|
||||
printf("===> <20><><EFBFBD><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1>ʴ<EFBFBD>СΪ<D0A1><CEAA>%d x %d\n", m_ulFullWidth, m_ulFullHeight);
|
||||
int w = ::GetSystemMetrics(SM_CXSCREEN), h = ::GetSystemMetrics(SM_CYSCREEN);
|
||||
m_bZoomed = (w != m_ulFullWidth) || (h != m_ulFullHeight);
|
||||
m_wZoom = double(m_ulFullWidth) / w, m_hZoom = double(m_ulFullHeight) / h;
|
||||
printf("=> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ű<EFBFBD><C5B1><EFBFBD>: %.2f, %.2f\t<EFBFBD>ֱ<EFBFBD><EFBFBD>ʣ<EFBFBD>%d x %d\n", m_wZoom, m_hZoom, m_ulFullWidth, m_ulFullHeight);
|
||||
m_wZoom = 1.0/m_wZoom, m_hZoom = 1.0/m_hZoom;
|
||||
m_BitmapInfor_Full = ConstructBI(m_ulbiBitCount,m_ulFullWidth, m_ulFullHeight);
|
||||
m_BitmapData_Full = NULL;
|
||||
m_BitmapHandle = ::CreateDIBSection(m_hFullDC, m_BitmapInfor_Full,
|
||||
@@ -156,7 +160,7 @@ ULONG CScreenSpy::GetFirstScreenLength()
|
||||
|
||||
LPVOID CScreenSpy::GetNextScreenData(ULONG* ulNextSendLength)
|
||||
{
|
||||
if (ulNextSendLength == NULL || m_RectBuffer == NULL)
|
||||
if (m_RectBuffer == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -187,6 +191,7 @@ LPVOID CScreenSpy::GetNextScreenData(ULONG* ulNextSendLength)
|
||||
*ulNextSendLength = m_RectBufferOffset +
|
||||
CompareBitmap((LPBYTE)m_DiffBitmapData_Full, (LPBYTE)m_BitmapData_Full,
|
||||
m_RectBuffer + m_RectBufferOffset, m_BitmapInfor_Full->bmiHeader.biSizeImage);
|
||||
|
||||
return m_RectBuffer;
|
||||
}
|
||||
|
||||
@@ -203,6 +208,7 @@ VOID CScreenSpy::WriteRectBuffer(LPBYTE szBuffer,ULONG ulLength)
|
||||
|
||||
VOID CScreenSpy::ScanScreen(HDC hdcDest, HDC hdcSour, ULONG ulWidth, ULONG ulHeight)
|
||||
{
|
||||
AUTO_TICK(1);
|
||||
#ifdef COPY_ALL
|
||||
BitBlt(hdcDest, 0, 0, ulWidth, ulHeight, hdcSour, 0, 0, m_dwBitBltRop);
|
||||
#else
|
||||
@@ -223,48 +229,36 @@ VOID CScreenSpy::ScanScreen(HDC hdcDest, HDC hdcSour, ULONG ulWidth, ULONG ulHei
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
ULONG CScreenSpy::CompareBitmap(LPBYTE CompareSourData, LPBYTE CompareDestData,
|
||||
LPBYTE szBuffer, DWORD ulCompareLength)
|
||||
{
|
||||
AUTO_TICK(1);
|
||||
// Windows<77>涨һ<E6B6A8><D2BB>ɨ<EFBFBD><C9A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD><D5BC><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>4<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>DWORD<52>Ƚ<EFBFBD>
|
||||
LPDWORD p1, p2;
|
||||
p1 = (LPDWORD)CompareDestData;
|
||||
p2 = (LPDWORD)CompareSourData;
|
||||
|
||||
LPDWORD p1 = (LPDWORD)CompareDestData, p2 = (LPDWORD)CompareSourData;
|
||||
// ƫ<>Ƶ<EFBFBD>ƫ<EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD>ȵ<EFBFBD>ƫ<EFBFBD><C6AB>
|
||||
ULONG ulszBufferOffset = 0, ulv1 = 0, ulv2 = 0;
|
||||
ULONG ulCount = 0; // <20><><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD>
|
||||
// p1++ʵ<><CAB5><EFBFBD><EFBFBD><EFBFBD>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>DWORD
|
||||
for (int i = 0; i < ulCompareLength; i += 4, p1++, p2++)
|
||||
ULONG ulszBufferOffset = 0, ulv1 = 0, ulv2 = 0, ulCount = 0;
|
||||
for (int i = 0; i < ulCompareLength; i += 4, ++p1, ++p2)
|
||||
{
|
||||
if (*p1 == *p2)
|
||||
continue;
|
||||
// һ<><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ鿪ʼ
|
||||
// д<><D0B4>ƫ<EFBFBD>Ƶ<EFBFBD>ַ
|
||||
|
||||
*(LPDWORD)(szBuffer + ulszBufferOffset) = i;
|
||||
// <20><>¼<EFBFBD><C2BC><EFBFBD>ݴ<EFBFBD>С<EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD>λ<EFBFBD><CEBB>
|
||||
ulv1 = ulszBufferOffset + sizeof(int); //4
|
||||
ulv2 = ulv1 + sizeof(int); //8
|
||||
ulv1 = ulszBufferOffset + sizeof(int);
|
||||
ulv2 = ulv1 + sizeof(int);
|
||||
ulCount = 0; // <20><><EFBFBD>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>Dest<73>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
*p1 = *p2;
|
||||
*(LPDWORD)(szBuffer + ulv2 + ulCount) = *p2;
|
||||
|
||||
/*
|
||||
[1][2][3][3]
|
||||
[1][3][2][1]
|
||||
|
||||
[0000][ ][1321]
|
||||
*/
|
||||
ulCount += 4;
|
||||
i += 4, p1++, p2++;
|
||||
for (int j = i; j < ulCompareLength; j += 4, i += 4, p1++, p2++)
|
||||
for (int j = i; j < ulCompareLength; j += 4, i += 4, ++p1, ++p2)
|
||||
{
|
||||
if (*p1 == *p2)
|
||||
break;
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>Dest<73>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
*p1 = *p2;
|
||||
*(LPDWORD)(szBuffer + ulv2 + ulCount) = *p2;
|
||||
@@ -275,6 +269,5 @@ ULONG CScreenSpy::CompareBitmap(LPBYTE CompareSourData, LPBYTE CompareDestData,
|
||||
ulszBufferOffset = ulv2 + ulCount;
|
||||
}
|
||||
|
||||
// nOffsetOffset <20><><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD><EFBFBD><EFBFBD>ܴ<EFBFBD>С
|
||||
return ulszBufferOffset;
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ public:
|
||||
ULONG CompareBitmap(LPBYTE CompareSourData, LPBYTE CompareDestData,
|
||||
LPBYTE szBuffer, DWORD ulCompareLength);
|
||||
VOID ScanScreen(HDC hdcDest, HDC hdcSour, ULONG ulWidth, ULONG ulHeight);
|
||||
bool m_bZoomed; // <20><>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
double m_wZoom, m_hZoom; // <20><>Ļ<EFBFBD><C4BB><EFBFBD>ű<EFBFBD><C5B1><EFBFBD>
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_SCREENSPY_H__5F74528D_9ABD_404E_84D2_06C96A0615F4__INCLUDED_)
|
||||
|
||||
@@ -130,7 +130,7 @@ DWORD WINAPI CShellManager::ReadPipeThread(LPVOID lParam)
|
||||
LocalFree(szTotalBuffer);
|
||||
}
|
||||
}
|
||||
cout<<"ReadPipe<EFBFBD>߳<EFBFBD><EFBFBD>˳<EFBFBD>"<<endl;
|
||||
cout<<"ReadPipe<EFBFBD>߳<EFBFBD><EFBFBD>˳<EFBFBD>\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,3 +40,28 @@
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>C<EFBFBD><43><EFBFBD><EFBFBD>ʱ<EFBFBD>ȴ<EFBFBD>T<EFBFBD><54>(<28><><EFBFBD><EFBFBD>1ms)
|
||||
#define WAIT_1(C, T) { timeBeginPeriod(1); WAIT_n(C, T, 1); timeEndPeriod(1); }
|
||||
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// <20><><EFBFBD>ܼ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㺯<EFBFBD><E3BAAF><EFBFBD>ĺ<EFBFBD>ʱ
|
||||
class auto_tick
|
||||
{
|
||||
private:
|
||||
const char *func;
|
||||
int threshold;
|
||||
clock_t tick;
|
||||
__inline clock_t now() const { return clock(); }
|
||||
|
||||
public:
|
||||
auto_tick(const char *func_name, int th=5) : func(func_name), threshold(th), tick(now()) { }
|
||||
~auto_tick() {int s(this->time());if(s>threshold)printf("[%s]ִ<><D6B4>ʱ<EFBFBD><CAB1>: [%d]ms.\n", func, s);}
|
||||
__inline int time() const { return now() - tick; }
|
||||
};
|
||||
|
||||
#ifdef _DEBUG
|
||||
// <20><><EFBFBD>ܼ<EFBFBD><DCBC>㵱ǰ<E3B5B1><C7B0><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ӡ
|
||||
#define AUTO_TICK(thresh) auto_tick(__FUNCTION__, thresh)
|
||||
#else
|
||||
#define AUTO_TICK(thresh)
|
||||
#endif
|
||||
|
||||
@@ -132,7 +132,7 @@ LPBYTE CSystemManager::GetProcessList()
|
||||
|
||||
CSystemManager::~CSystemManager()
|
||||
{
|
||||
cout<<"ϵͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"<<endl;
|
||||
cout<<"ϵͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n";
|
||||
}
|
||||
|
||||
BOOL CSystemManager::DebugPrivilege(const char *szName, BOOL bEnable)
|
||||
|
||||
@@ -37,7 +37,7 @@ CTalkManager::CTalkManager(IOCPClient* ClientObject, int n):CManager(ClientObjec
|
||||
|
||||
CTalkManager::~CTalkManager()
|
||||
{
|
||||
cout<<"Talk <20><><EFBFBD><EFBFBD>"<<endl;
|
||||
cout<<"Talk <20><><EFBFBD><EFBFBD>\n";
|
||||
}
|
||||
|
||||
VOID CTalkManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>./;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_CONSOLE;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
@@ -68,7 +68,7 @@
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<AdditionalIncludeDirectories>./;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_CONSOLE;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerCommandArguments>192.168.43.165 2356</LocalDebuggerCommandArguments>
|
||||
<LocalDebuggerCommandArguments>192.168.104.248 2356</LocalDebuggerCommandArguments>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
<LocalDebuggerCommandArguments>192.168.43.165 2356</LocalDebuggerCommandArguments>
|
||||
<LocalDebuggerCommandArguments>192.168.104.248 2356</LocalDebuggerCommandArguments>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
473
client/zconf.h
473
client/zconf.h
@@ -1,102 +1,257 @@
|
||||
/* zconf.h -- configuration of the zlib compression library
|
||||
* Copyright (C) 1995-2002 Jean-loup Gailly.
|
||||
* Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* @(#) $Id$ */
|
||||
|
||||
#ifndef _ZCONF_H
|
||||
#define _ZCONF_H
|
||||
#ifndef ZCONF_H
|
||||
#define ZCONF_H
|
||||
|
||||
/*
|
||||
* If you *really* need a unique prefix for all types and library functions,
|
||||
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
|
||||
* Even better than compiling with -DZ_PREFIX would be to use configure to set
|
||||
* this permanently in zconf.h using "./configure --zprefix".
|
||||
*/
|
||||
#ifdef Z_PREFIX
|
||||
# define deflateInit_ z_deflateInit_
|
||||
#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
|
||||
# define Z_PREFIX_SET
|
||||
|
||||
/* all linked symbols and init macros */
|
||||
# define _dist_code z__dist_code
|
||||
# define _length_code z__length_code
|
||||
# define _tr_align z__tr_align
|
||||
# define _tr_flush_bits z__tr_flush_bits
|
||||
# define _tr_flush_block z__tr_flush_block
|
||||
# define _tr_init z__tr_init
|
||||
# define _tr_stored_block z__tr_stored_block
|
||||
# define _tr_tally z__tr_tally
|
||||
# define adler32 z_adler32
|
||||
# define adler32_combine z_adler32_combine
|
||||
# define adler32_combine64 z_adler32_combine64
|
||||
# define adler32_z z_adler32_z
|
||||
# ifndef Z_SOLO
|
||||
# define compress z_compress
|
||||
# define compress2 z_compress2
|
||||
# define compressBound z_compressBound
|
||||
# endif
|
||||
# define crc32 z_crc32
|
||||
# define crc32_combine z_crc32_combine
|
||||
# define crc32_combine64 z_crc32_combine64
|
||||
# define crc32_z z_crc32_z
|
||||
# define deflate z_deflate
|
||||
# define deflateEnd z_deflateEnd
|
||||
# define inflateInit_ z_inflateInit_
|
||||
# define inflate z_inflate
|
||||
# define inflateEnd z_inflateEnd
|
||||
# define deflateInit2_ z_deflateInit2_
|
||||
# define deflateSetDictionary z_deflateSetDictionary
|
||||
# define deflateBound z_deflateBound
|
||||
# define deflateCopy z_deflateCopy
|
||||
# define deflateReset z_deflateReset
|
||||
# define deflateEnd z_deflateEnd
|
||||
# define deflateGetDictionary z_deflateGetDictionary
|
||||
# define deflateInit z_deflateInit
|
||||
# define deflateInit2 z_deflateInit2
|
||||
# define deflateInit2_ z_deflateInit2_
|
||||
# define deflateInit_ z_deflateInit_
|
||||
# define deflateParams z_deflateParams
|
||||
# define deflatePending z_deflatePending
|
||||
# define deflatePrime z_deflatePrime
|
||||
# define deflateReset z_deflateReset
|
||||
# define deflateResetKeep z_deflateResetKeep
|
||||
# define deflateSetDictionary z_deflateSetDictionary
|
||||
# define deflateSetHeader z_deflateSetHeader
|
||||
# define deflateTune z_deflateTune
|
||||
# define deflate_copyright z_deflate_copyright
|
||||
# define get_crc_table z_get_crc_table
|
||||
# ifndef Z_SOLO
|
||||
# define gz_error z_gz_error
|
||||
# define gz_intmax z_gz_intmax
|
||||
# define gz_strwinerror z_gz_strwinerror
|
||||
# define gzbuffer z_gzbuffer
|
||||
# define gzclearerr z_gzclearerr
|
||||
# define gzclose z_gzclose
|
||||
# define gzclose_r z_gzclose_r
|
||||
# define gzclose_w z_gzclose_w
|
||||
# define gzdirect z_gzdirect
|
||||
# define gzdopen z_gzdopen
|
||||
# define gzeof z_gzeof
|
||||
# define gzerror z_gzerror
|
||||
# define gzflush z_gzflush
|
||||
# define gzfread z_gzfread
|
||||
# define gzfwrite z_gzfwrite
|
||||
# define gzgetc z_gzgetc
|
||||
# define gzgetc_ z_gzgetc_
|
||||
# define gzgets z_gzgets
|
||||
# define gzoffset z_gzoffset
|
||||
# define gzoffset64 z_gzoffset64
|
||||
# define gzopen z_gzopen
|
||||
# define gzopen64 z_gzopen64
|
||||
# ifdef _WIN32
|
||||
# define gzopen_w z_gzopen_w
|
||||
# endif
|
||||
# define gzprintf z_gzprintf
|
||||
# define gzputc z_gzputc
|
||||
# define gzputs z_gzputs
|
||||
# define gzread z_gzread
|
||||
# define gzrewind z_gzrewind
|
||||
# define gzseek z_gzseek
|
||||
# define gzseek64 z_gzseek64
|
||||
# define gzsetparams z_gzsetparams
|
||||
# define gztell z_gztell
|
||||
# define gztell64 z_gztell64
|
||||
# define gzungetc z_gzungetc
|
||||
# define gzvprintf z_gzvprintf
|
||||
# define gzwrite z_gzwrite
|
||||
# endif
|
||||
# define inflate z_inflate
|
||||
# define inflateBack z_inflateBack
|
||||
# define inflateBackEnd z_inflateBackEnd
|
||||
# define inflateBackInit z_inflateBackInit
|
||||
# define inflateBackInit_ z_inflateBackInit_
|
||||
# define inflateCodesUsed z_inflateCodesUsed
|
||||
# define inflateCopy z_inflateCopy
|
||||
# define inflateEnd z_inflateEnd
|
||||
# define inflateGetDictionary z_inflateGetDictionary
|
||||
# define inflateGetHeader z_inflateGetHeader
|
||||
# define inflateInit z_inflateInit
|
||||
# define inflateInit2 z_inflateInit2
|
||||
# define inflateInit2_ z_inflateInit2_
|
||||
# define inflateInit_ z_inflateInit_
|
||||
# define inflateMark z_inflateMark
|
||||
# define inflatePrime z_inflatePrime
|
||||
# define inflateReset z_inflateReset
|
||||
# define inflateReset2 z_inflateReset2
|
||||
# define inflateResetKeep z_inflateResetKeep
|
||||
# define inflateSetDictionary z_inflateSetDictionary
|
||||
# define inflateSync z_inflateSync
|
||||
# define inflateSyncPoint z_inflateSyncPoint
|
||||
# define inflateReset z_inflateReset
|
||||
# define compress z_compress
|
||||
# define compress2 z_compress2
|
||||
# define inflateUndermine z_inflateUndermine
|
||||
# define inflateValidate z_inflateValidate
|
||||
# define inflate_copyright z_inflate_copyright
|
||||
# define inflate_fast z_inflate_fast
|
||||
# define inflate_table z_inflate_table
|
||||
# ifndef Z_SOLO
|
||||
# define uncompress z_uncompress
|
||||
# define adler32 z_adler32
|
||||
# define crc32 z_crc32
|
||||
# define get_crc_table z_get_crc_table
|
||||
|
||||
# define Byte z_Byte
|
||||
# define uInt z_uInt
|
||||
# define uLong z_uLong
|
||||
# define Bytef z_Bytef
|
||||
# define charf z_charf
|
||||
# define intf z_intf
|
||||
# define uIntf z_uIntf
|
||||
# define uLongf z_uLongf
|
||||
# define voidpf z_voidpf
|
||||
# define voidp z_voidp
|
||||
#endif
|
||||
|
||||
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
|
||||
# define WIN32
|
||||
#endif
|
||||
#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
|
||||
# ifndef __32BIT__
|
||||
# define __32BIT__
|
||||
# define uncompress2 z_uncompress2
|
||||
# endif
|
||||
# define zError z_zError
|
||||
# ifndef Z_SOLO
|
||||
# define zcalloc z_zcalloc
|
||||
# define zcfree z_zcfree
|
||||
# endif
|
||||
# define zlibCompileFlags z_zlibCompileFlags
|
||||
# define zlibVersion z_zlibVersion
|
||||
|
||||
/* all zlib typedefs in zlib.h and zconf.h */
|
||||
# define Byte z_Byte
|
||||
# define Bytef z_Bytef
|
||||
# define alloc_func z_alloc_func
|
||||
# define charf z_charf
|
||||
# define free_func z_free_func
|
||||
# ifndef Z_SOLO
|
||||
# define gzFile z_gzFile
|
||||
# endif
|
||||
# define gz_header z_gz_header
|
||||
# define gz_headerp z_gz_headerp
|
||||
# define in_func z_in_func
|
||||
# define intf z_intf
|
||||
# define out_func z_out_func
|
||||
# define uInt z_uInt
|
||||
# define uIntf z_uIntf
|
||||
# define uLong z_uLong
|
||||
# define uLongf z_uLongf
|
||||
# define voidp z_voidp
|
||||
# define voidpc z_voidpc
|
||||
# define voidpf z_voidpf
|
||||
|
||||
/* all zlib structs in zlib.h and zconf.h */
|
||||
# define gz_header_s z_gz_header_s
|
||||
# define internal_state z_internal_state
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__MSDOS__) && !defined(MSDOS)
|
||||
# define MSDOS
|
||||
#endif
|
||||
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
|
||||
# define OS2
|
||||
#endif
|
||||
#if defined(_WINDOWS) && !defined(WINDOWS)
|
||||
# define WINDOWS
|
||||
#endif
|
||||
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
|
||||
# ifndef WIN32
|
||||
# define WIN32
|
||||
# endif
|
||||
#endif
|
||||
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
|
||||
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
|
||||
# ifndef SYS16BIT
|
||||
# define SYS16BIT
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
|
||||
* than 64k bytes at a time (needed on systems with 16-bit int).
|
||||
*/
|
||||
#if defined(MSDOS) && !defined(__32BIT__)
|
||||
#ifdef SYS16BIT
|
||||
# define MAXSEG_64K
|
||||
#endif
|
||||
#ifdef MSDOS
|
||||
# define UNALIGNED_OK
|
||||
#endif
|
||||
|
||||
#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
|
||||
# define STDC
|
||||
#endif
|
||||
#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
|
||||
#ifdef __STDC_VERSION__
|
||||
# ifndef STDC
|
||||
# define STDC
|
||||
# endif
|
||||
# if __STDC_VERSION__ >= 199901L
|
||||
# ifndef STDC99
|
||||
# define STDC99
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
|
||||
# define STDC
|
||||
#endif
|
||||
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
|
||||
# define STDC
|
||||
#endif
|
||||
|
||||
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
|
||||
# define STDC
|
||||
#endif
|
||||
|
||||
#ifndef STDC
|
||||
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
|
||||
# define const
|
||||
# define const /* note: need a more gentle solution here */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Some Mac compilers merge all .h files incorrectly: */
|
||||
#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
|
||||
# define NO_DUMMY_DECL
|
||||
#if defined(ZLIB_CONST) && !defined(z_const)
|
||||
# define z_const const
|
||||
#else
|
||||
# define z_const
|
||||
#endif
|
||||
|
||||
/* Old Borland C incorrectly complains about missing returns: */
|
||||
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
|
||||
# define NEED_DUMMY_RETURN
|
||||
#ifdef Z_SOLO
|
||||
typedef unsigned long z_size_t;
|
||||
#else
|
||||
# define z_longlong long long
|
||||
# if defined(NO_SIZE_T)
|
||||
typedef unsigned NO_SIZE_T z_size_t;
|
||||
# elif defined(STDC)
|
||||
# include <stddef.h>
|
||||
typedef size_t z_size_t;
|
||||
# else
|
||||
typedef unsigned long z_size_t;
|
||||
# endif
|
||||
# undef z_longlong
|
||||
#endif
|
||||
|
||||
|
||||
/* Maximum value for memLevel in deflateInit2 */
|
||||
#ifndef MAX_MEM_LEVEL
|
||||
# ifdef MAXSEG_64K
|
||||
@@ -124,7 +279,7 @@
|
||||
Of course this will generally degrade compression (there's no free lunch).
|
||||
|
||||
The memory requirements for inflate are (in bytes) 1 << windowBits
|
||||
that is, 32K for windowBits=15 (default value) plus a few kilobytes
|
||||
that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
|
||||
for small objects.
|
||||
*/
|
||||
|
||||
@@ -138,13 +293,22 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef Z_ARG /* function prototypes for stdarg */
|
||||
# if defined(STDC) || defined(Z_HAVE_STDARG_H)
|
||||
# define Z_ARG(args) args
|
||||
# else
|
||||
# define Z_ARG(args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The following definitions for FAR are needed only for MSDOS mixed
|
||||
* model programming (small or medium model with some far allocations).
|
||||
* This was tested only with MSC; for other MSDOS compilers you may have
|
||||
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
|
||||
* just define FAR to be empty.
|
||||
*/
|
||||
#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
|
||||
#ifdef SYS16BIT
|
||||
# if defined(M_I86SM) || defined(M_I86MM)
|
||||
/* MSC small or medium model */
|
||||
# define SMALL_MEDIUM
|
||||
# ifdef _MSC_VER
|
||||
@@ -152,65 +316,78 @@
|
||||
# else
|
||||
# define FAR far
|
||||
# endif
|
||||
#endif
|
||||
#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
|
||||
# ifndef __32BIT__
|
||||
# endif
|
||||
# if (defined(__SMALL__) || defined(__MEDIUM__))
|
||||
/* Turbo C small or medium model */
|
||||
# define SMALL_MEDIUM
|
||||
# ifdef __BORLANDC__
|
||||
# define FAR _far
|
||||
# else
|
||||
# define FAR far
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Compile with -DZLIB_DLL for Windows DLL support */
|
||||
#if defined(ZLIB_DLL)
|
||||
# if defined(_WINDOWS) || defined(WINDOWS)
|
||||
#if defined(WINDOWS) || defined(WIN32)
|
||||
/* If building or using zlib as a DLL, define ZLIB_DLL.
|
||||
* This is not mandatory, but it offers a little performance increase.
|
||||
*/
|
||||
# ifdef ZLIB_DLL
|
||||
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
|
||||
# ifdef ZLIB_INTERNAL
|
||||
# define ZEXTERN extern __declspec(dllexport)
|
||||
# else
|
||||
# define ZEXTERN extern __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
# endif /* ZLIB_DLL */
|
||||
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
|
||||
* define ZLIB_WINAPI.
|
||||
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
|
||||
*/
|
||||
# ifdef ZLIB_WINAPI
|
||||
# ifdef FAR
|
||||
# undef FAR
|
||||
# endif
|
||||
# include <windows.h>
|
||||
/* No need for _export, use ZLIB.DEF instead. */
|
||||
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
||||
# define ZEXPORT WINAPI
|
||||
# ifdef WIN32
|
||||
# define ZEXPORTVA WINAPIV
|
||||
# else
|
||||
# define ZEXPORTVA FAR _cdecl _export
|
||||
# endif
|
||||
# endif
|
||||
# if defined (__BORLANDC__)
|
||||
# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
|
||||
# include <windows.h>
|
||||
# define ZEXPORT __declspec(dllexport) WINAPI
|
||||
# define ZEXPORTRVA __declspec(dllexport) WINAPIV
|
||||
# else
|
||||
# if defined (_Windows) && defined (__DLL__)
|
||||
# define ZEXPORT _export
|
||||
# define ZEXPORTVA _export
|
||||
# endif
|
||||
# define ZEXPORTVA FAR CDECL
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined (__BEOS__)
|
||||
# if defined (ZLIB_DLL)
|
||||
# define ZEXTERN extern __declspec(dllexport)
|
||||
# ifdef ZLIB_DLL
|
||||
# ifdef ZLIB_INTERNAL
|
||||
# define ZEXPORT __declspec(dllexport)
|
||||
# define ZEXPORTVA __declspec(dllexport)
|
||||
# else
|
||||
# define ZEXTERN extern __declspec(dllimport)
|
||||
# define ZEXPORT __declspec(dllimport)
|
||||
# define ZEXPORTVA __declspec(dllimport)
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef ZEXTERN
|
||||
# define ZEXTERN extern
|
||||
#endif
|
||||
#ifndef ZEXPORT
|
||||
# define ZEXPORT
|
||||
#endif
|
||||
#ifndef ZEXPORTVA
|
||||
# define ZEXPORTVA
|
||||
#endif
|
||||
#ifndef ZEXTERN
|
||||
# define ZEXTERN extern
|
||||
#endif
|
||||
|
||||
#ifndef FAR
|
||||
# define FAR
|
||||
#endif
|
||||
|
||||
#if !defined(MACOS) && !defined(TARGET_OS_MAC)
|
||||
#if !defined(__MACTYPES__)
|
||||
typedef unsigned char Byte; /* 8 bits */
|
||||
#endif
|
||||
typedef unsigned int uInt; /* 16 bits or more */
|
||||
@@ -228,52 +405,130 @@ typedef uInt FAR uIntf;
|
||||
typedef uLong FAR uLongf;
|
||||
|
||||
#ifdef STDC
|
||||
typedef void const *voidpc;
|
||||
typedef void FAR *voidpf;
|
||||
typedef void *voidp;
|
||||
#else
|
||||
typedef Byte const *voidpc;
|
||||
typedef Byte FAR *voidpf;
|
||||
typedef Byte *voidp;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <sys/types.h> /* for off_t */
|
||||
# include <unistd.h> /* for SEEK_* and off_t */
|
||||
# define z_off_t off_t
|
||||
#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
|
||||
# include <limits.h>
|
||||
# if (UINT_MAX == 0xffffffffUL)
|
||||
# define Z_U4 unsigned
|
||||
# elif (ULONG_MAX == 0xffffffffUL)
|
||||
# define Z_U4 unsigned long
|
||||
# elif (USHRT_MAX == 0xffffffffUL)
|
||||
# define Z_U4 unsigned short
|
||||
# endif
|
||||
#endif
|
||||
#ifndef SEEK_SET
|
||||
|
||||
#ifdef Z_U4
|
||||
typedef Z_U4 z_crc_t;
|
||||
#else
|
||||
typedef unsigned long z_crc_t;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
|
||||
# define Z_HAVE_UNISTD_H
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
|
||||
# define Z_HAVE_STDARG_H
|
||||
#endif
|
||||
|
||||
#ifdef STDC
|
||||
# ifndef Z_SOLO
|
||||
# include <sys/types.h> /* for off_t */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(STDC) || defined(Z_HAVE_STDARG_H)
|
||||
# ifndef Z_SOLO
|
||||
# include <stdarg.h> /* for va_list */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifndef Z_SOLO
|
||||
# include <stddef.h> /* for wchar_t */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
|
||||
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
|
||||
* though the former does not conform to the LFS document), but considering
|
||||
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
|
||||
* equivalently requesting no 64-bit operations
|
||||
*/
|
||||
#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
|
||||
# undef _LARGEFILE64_SOURCE
|
||||
#endif
|
||||
|
||||
#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
|
||||
# define Z_HAVE_UNISTD_H
|
||||
#endif
|
||||
#ifndef Z_SOLO
|
||||
# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
|
||||
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
|
||||
# ifdef VMS
|
||||
# include <unixio.h> /* for off_t */
|
||||
# endif
|
||||
# ifndef z_off_t
|
||||
# define z_off_t off_t
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
|
||||
# define Z_LFS64
|
||||
#endif
|
||||
|
||||
#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
|
||||
# define Z_LARGE64
|
||||
#endif
|
||||
|
||||
#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
|
||||
# define Z_WANT64
|
||||
#endif
|
||||
|
||||
#if !defined(SEEK_SET) && !defined(Z_SOLO)
|
||||
# define SEEK_SET 0 /* Seek from beginning of file. */
|
||||
# define SEEK_CUR 1 /* Seek from current position. */
|
||||
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
|
||||
#endif
|
||||
|
||||
#ifndef z_off_t
|
||||
# define z_off_t long
|
||||
#endif
|
||||
|
||||
/* MVS linker does not support external names larger than 8 bytes */
|
||||
#if defined(__MVS__)
|
||||
# pragma map(deflateInit_,"DEIN")
|
||||
# pragma map(deflateInit2_,"DEIN2")
|
||||
# pragma map(deflateEnd,"DEEND")
|
||||
# pragma map(inflateInit_,"ININ")
|
||||
# pragma map(inflateInit2_,"ININ2")
|
||||
# pragma map(inflateEnd,"INEND")
|
||||
# pragma map(inflateSync,"INSY")
|
||||
# pragma map(inflateSetDictionary,"INSEDI")
|
||||
# pragma map(inflate_blocks,"INBL")
|
||||
# pragma map(inflate_blocks_new,"INBLNE")
|
||||
# pragma map(inflate_blocks_free,"INBLFR")
|
||||
# pragma map(inflate_blocks_reset,"INBLRE")
|
||||
# pragma map(inflate_codes_free,"INCOFR")
|
||||
# pragma map(inflate_codes,"INCO")
|
||||
# pragma map(inflate_fast,"INFA")
|
||||
# pragma map(inflate_flush,"INFLU")
|
||||
# pragma map(inflate_mask,"INMA")
|
||||
# pragma map(inflate_set_dictionary,"INSEDI2")
|
||||
# pragma map(inflate_copyright,"INCOPY")
|
||||
# pragma map(inflate_trees_bits,"INTRBI")
|
||||
# pragma map(inflate_trees_dynamic,"INTRDY")
|
||||
# pragma map(inflate_trees_fixed,"INTRFI")
|
||||
# pragma map(inflate_trees_free,"INTRFR")
|
||||
#if !defined(_WIN32) && defined(Z_LARGE64)
|
||||
# define z_off64_t off64_t
|
||||
#else
|
||||
# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
|
||||
# define z_off64_t __int64
|
||||
# else
|
||||
# define z_off64_t z_off_t
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* _ZCONF_H */
|
||||
/* MVS linker does not support external names larger than 8 bytes */
|
||||
#if defined(__MVS__)
|
||||
#pragma map(deflateInit_,"DEIN")
|
||||
#pragma map(deflateInit2_,"DEIN2")
|
||||
#pragma map(deflateEnd,"DEEND")
|
||||
#pragma map(deflateBound,"DEBND")
|
||||
#pragma map(inflateInit_,"ININ")
|
||||
#pragma map(inflateInit2_,"ININ2")
|
||||
#pragma map(inflateEnd,"INEND")
|
||||
#pragma map(inflateSync,"INSY")
|
||||
#pragma map(inflateSetDictionary,"INSEDI")
|
||||
#pragma map(compressBound,"CMBND")
|
||||
#pragma map(inflate_table,"INTABL")
|
||||
#pragma map(inflate_fast,"INFA")
|
||||
#pragma map(inflate_copyright,"INCOPY")
|
||||
#endif
|
||||
|
||||
#endif /* ZCONF_H */
|
||||
|
||||
1741
client/zlib.h
1741
client/zlib.h
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,42 @@
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
// dump<6D><70><EFBFBD><EFBFBD>
|
||||
#include <io.h>
|
||||
#include <direct.h>
|
||||
#include <DbgHelp.h>
|
||||
#pragma comment(lib, "Dbghelp.lib")
|
||||
|
||||
/**
|
||||
* @brief <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>δ֪BUG<55><47><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֹʱ<D6B9><CAB1><EFBFBD>ô˺<C3B4><CBBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* <20><><EFBFBD><EFBFBD>ת<EFBFBD><D7AA>dump<6D>ļ<EFBFBD><C4BC><EFBFBD>dumpĿ¼.
|
||||
*/
|
||||
long WINAPI whenbuged(_EXCEPTION_POINTERS *excp)
|
||||
{
|
||||
// <20><>ȡdump<6D>ļ<EFBFBD><C4BC>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><DAA3><EFBFBD>֮
|
||||
char dump[_MAX_PATH], *p = dump;
|
||||
GetModuleFileNameA(NULL, dump, _MAX_PATH);
|
||||
while (*p) ++p;
|
||||
while ('\\' != *p) --p;
|
||||
strcpy(p + 1, "dump");
|
||||
if (_access(dump, 0) == -1)
|
||||
_mkdir(dump);
|
||||
char curTime[64];// <20><>ǰdump<6D>ļ<EFBFBD>
|
||||
time_t TIME(time(0));
|
||||
strftime(curTime, 64, "\\remote_%Y-%m-%d %H%M%S.dmp", localtime(&TIME));
|
||||
strcat(dump, curTime);
|
||||
HANDLE hFile = ::CreateFileA(dump, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
|
||||
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if(INVALID_HANDLE_VALUE != hFile)
|
||||
{
|
||||
MINIDUMP_EXCEPTION_INFORMATION einfo = {::GetCurrentThreadId(), excp, FALSE};
|
||||
::MiniDumpWriteDump(::GetCurrentProcess(), ::GetCurrentProcessId(),
|
||||
hFile, MiniDumpWithFullMemory, &einfo, NULL, NULL);
|
||||
::CloseHandle(hFile);
|
||||
}
|
||||
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
}
|
||||
|
||||
// CMy2015RemoteApp
|
||||
|
||||
@@ -39,6 +75,8 @@ CMy2015RemoteApp theApp;
|
||||
|
||||
BOOL CMy2015RemoteApp::InitInstance()
|
||||
{
|
||||
SetUnhandledExceptionFilter(&whenbuged);
|
||||
|
||||
// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Windows XP <20>ϵ<EFBFBD>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><EFBFBD>嵥ָ<E5B5A5><D6B8>Ҫ
|
||||
// ʹ<><CAB9> ComCtl32.dll <20>汾 6 <20><><EFBFBD><EFBFBD><EFBFBD>߰汾<DFB0><E6B1BE><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF>ӻ<EFBFBD><D3BB><EFBFBD>ʽ<EFBFBD><CABD>
|
||||
//<2F><><EFBFBD><EFBFBD>Ҫ InitCommonControlsEx()<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F2A3ACBD><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڡ<EFBFBD>
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -78,7 +78,7 @@
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -100,7 +100,6 @@
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ReadMe.txt" />
|
||||
<None Include="res\2015Remote.ico" />
|
||||
<None Include="res\audio.ico" />
|
||||
<None Include="res\bitmap\bmp00001.bmp" />
|
||||
@@ -178,6 +177,9 @@
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="2015Remote.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="..\..\ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
||||
@@ -63,7 +63,6 @@
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ReadMe.txt" />
|
||||
<None Include="res\My2015Remote.rc2">
|
||||
<Filter>资源文件</Filter>
|
||||
</None>
|
||||
@@ -272,4 +271,7 @@
|
||||
<Filter>资源文件</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="..\..\ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -774,6 +774,7 @@ VOID CMy2015RemoteDlg::Activate(int nPort,int nMaxConnection)
|
||||
|
||||
VOID CALLBACK CMy2015RemoteDlg::NotifyProc(CONTEXT_OBJECT* ContextObject)
|
||||
{
|
||||
AUTO_TICK(5);
|
||||
MessageHandle(ContextObject);
|
||||
}
|
||||
|
||||
@@ -799,11 +800,6 @@ VOID CALLBACK CMy2015RemoteDlg::OfflineProc(CONTEXT_OBJECT* ContextObject)
|
||||
|
||||
VOID CMy2015RemoteDlg::MessageHandle(CONTEXT_OBJECT* ContextObject)
|
||||
{
|
||||
if (ContextObject == NULL)
|
||||
{
|
||||
return; //int <20><> intDlgHwnd
|
||||
}
|
||||
|
||||
if (ContextObject->v1 > 0)
|
||||
{
|
||||
switch(ContextObject->v1)
|
||||
@@ -867,16 +863,13 @@ VOID CMy2015RemoteDlg::MessageHandle(CONTEXT_OBJECT* ContextObject)
|
||||
CancelIo((HANDLE)ContextObject->sClientSocket);
|
||||
closesocket(ContextObject->sClientSocket);
|
||||
Sleep(10);
|
||||
|
||||
break;
|
||||
}
|
||||
case TOKEN_LOGIN: // <20><><EFBFBD>߰<EFBFBD> shine
|
||||
{
|
||||
g_2015RemoteDlg->PostMessage(WM_USERTOONLINELIST, 0, (LPARAM)ContextObject); //<2F><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD>Ϣ
|
||||
|
||||
g_2015RemoteDlg->PostMessage(WM_USERTOONLINELIST, 0, (LPARAM)ContextObject);
|
||||
break;
|
||||
}
|
||||
|
||||
case TOKEN_BITMAPINFO:
|
||||
{
|
||||
g_2015RemoteDlg->PostMessage(WM_OPENSCREENSPYDIALOG, 0, (LPARAM)ContextObject);
|
||||
@@ -887,13 +880,11 @@ VOID CMy2015RemoteDlg::MessageHandle(CONTEXT_OBJECT* ContextObject)
|
||||
g_2015RemoteDlg->PostMessage(WM_OPENFILEMANAGERDIALOG, 0, (LPARAM)ContextObject);
|
||||
break;
|
||||
}
|
||||
|
||||
case TOKEN_TALK_START:
|
||||
{
|
||||
g_2015RemoteDlg->PostMessage(WM_OPENTALKDIALOG, 0, (LPARAM)ContextObject);
|
||||
break;
|
||||
}
|
||||
|
||||
case TOKEN_SHELL_START:
|
||||
{
|
||||
g_2015RemoteDlg->PostMessage(WM_OPENSHELLDIALOG, 0, (LPARAM)ContextObject);
|
||||
@@ -902,30 +893,25 @@ VOID CMy2015RemoteDlg::MessageHandle(CONTEXT_OBJECT* ContextObject)
|
||||
case TOKEN_WSLIST: //wndlist
|
||||
case TOKEN_PSLIST: //processlist
|
||||
{
|
||||
g_2015RemoteDlg->PostMessage(WM_OPENSYSTEMDIALOG, 0, (LPARAM)ContextObject); //<2F><EFBFBD><F2BFAABD><EFBFBD>ö<EFBFBD>ٵĶԻ<C4B6><D4BB><EFBFBD>
|
||||
|
||||
g_2015RemoteDlg->PostMessage(WM_OPENSYSTEMDIALOG, 0, (LPARAM)ContextObject);
|
||||
break;
|
||||
}
|
||||
|
||||
case TOKEN_AUDIO_START:
|
||||
{
|
||||
g_2015RemoteDlg->PostMessage(WM_OPENAUDIODIALOG, 0, (LPARAM)ContextObject);
|
||||
break;
|
||||
}
|
||||
|
||||
case TOKEN_REGEDIT:
|
||||
{
|
||||
g_2015RemoteDlg->PostMessage(WM_OPENREGISTERDIALOG, 0, (LPARAM)ContextObject);
|
||||
break;
|
||||
}
|
||||
|
||||
case TOKEN_SERVERLIST:
|
||||
{
|
||||
g_2015RemoteDlg->PostMessage(WM_OPENSERVICESDIALOG, 0, (LPARAM)ContextObject);
|
||||
break;
|
||||
}
|
||||
|
||||
case TOKEN_WEBCAM_BITMAPINFO: // <20><><EFBFBD><EFBFBD>ͷ
|
||||
case TOKEN_WEBCAM_BITMAPINFO:
|
||||
{
|
||||
g_2015RemoteDlg->PostMessage(WM_OPENWEBCAMDIALOG, 0, (LPARAM)ContextObject);
|
||||
break;
|
||||
|
||||
@@ -173,7 +173,6 @@ DWORD WINAPI CAudio::waveInCallBack(LPVOID lParam)
|
||||
Sleep(1);
|
||||
This->m_nWaveInIndex = 1 - This->m_nWaveInIndex;
|
||||
|
||||
|
||||
//<2F><><EFBFBD>»<EFBFBD><C2BB><EFBFBD>
|
||||
MMRESULT mmResult = waveInAddBuffer(This->m_hWaveIn,
|
||||
This->m_InAudioHeader[This->m_nWaveInIndex], sizeof(WAVEHDR));
|
||||
|
||||
@@ -7,17 +7,17 @@ public:
|
||||
CBuffer(void);
|
||||
~CBuffer(void);
|
||||
|
||||
ULONG CBuffer::GetBufferMaxLength();
|
||||
ULONG CBuffer::ReadBuffer(PBYTE Buffer, ULONG ulLength);
|
||||
ULONG CBuffer::GetBufferLength(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>;
|
||||
ULONG CBuffer::DeAllocateBuffer(ULONG ulLength);
|
||||
VOID CBuffer::ClearBuffer();
|
||||
ULONG CBuffer::ReAllocateBuffer(ULONG ulLength);
|
||||
BOOL CBuffer::WriteBuffer(PBYTE Buffer, ULONG ulLength);
|
||||
PBYTE CBuffer::GetBuffer(ULONG ulPos=0);
|
||||
ULONG CBuffer::RemoveComletedBuffer(ULONG ulLength);
|
||||
VOID CBuffer::ReleaseMember();
|
||||
VOID CBuffer::InitMember();
|
||||
ULONG GetBufferMaxLength();
|
||||
ULONG ReadBuffer(PBYTE Buffer, ULONG ulLength);
|
||||
ULONG GetBufferLength(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>;
|
||||
ULONG DeAllocateBuffer(ULONG ulLength);
|
||||
VOID ClearBuffer();
|
||||
ULONG ReAllocateBuffer(ULONG ulLength);
|
||||
BOOL WriteBuffer(PBYTE Buffer, ULONG ulLength);
|
||||
PBYTE GetBuffer(ULONG ulPos=0);
|
||||
ULONG RemoveComletedBuffer(ULONG ulLength);
|
||||
VOID ReleaseMember();
|
||||
VOID InitMember();
|
||||
|
||||
protected:
|
||||
PBYTE m_Base;
|
||||
|
||||
@@ -91,16 +91,20 @@ IOCPServer::~IOCPServer(void)
|
||||
|
||||
while (!m_ContextConnectionList.IsEmpty())
|
||||
{
|
||||
CONTEXT_OBJECT *ContextObject = m_ContextConnectionList.RemoveHead();
|
||||
delete ContextObject;
|
||||
CONTEXT_OBJECT *ContextObject = m_ContextConnectionList.GetHead();
|
||||
RemoveStaleContext(ContextObject);
|
||||
}
|
||||
|
||||
while (!m_ContextFreePoolList.IsEmpty())
|
||||
{
|
||||
CONTEXT_OBJECT *ContextObject = m_ContextFreePoolList.RemoveHead();
|
||||
SAFE_DELETE(ContextObject->olps);
|
||||
delete ContextObject;
|
||||
}
|
||||
|
||||
while (m_ulWorkThreadCount)
|
||||
Sleep(10);
|
||||
|
||||
DeleteCriticalSection(&m_cs);
|
||||
m_ulWorkThreadCount = 0;
|
||||
|
||||
@@ -239,7 +243,7 @@ BOOL IOCPServer::InitializeIOCP(VOID)
|
||||
GetSystemInfo(&SystemInfo); //<2F><><EFBFBD><EFBFBD>PC<50><43><EFBFBD>м<EFBFBD><D0BC><EFBFBD>
|
||||
|
||||
m_ulThreadPoolMin = 1;
|
||||
m_ulThreadPoolMax = 16;
|
||||
m_ulThreadPoolMax = SystemInfo.dwNumberOfProcessors * 2;
|
||||
m_ulCPULowThreadsHold = 10;
|
||||
m_ulCPUHighThreadsHold = 75;
|
||||
m_cpu.Init();
|
||||
@@ -247,7 +251,7 @@ BOOL IOCPServer::InitializeIOCP(VOID)
|
||||
ULONG ulWorkThreadCount = m_ulThreadPoolMax;
|
||||
|
||||
HANDLE hWorkThread = NULL;
|
||||
for (int i=0; i<ulWorkThreadCount; i++ )
|
||||
for (int i=0; i<ulWorkThreadCount; i++)
|
||||
{
|
||||
hWorkThread = (HANDLE)CreateThread(NULL, //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>Ǵ<EFBFBD><C7B4><EFBFBD>Ͷ<EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD>ɶ˿<C9B6><CBBF>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
0,
|
||||
@@ -272,6 +276,8 @@ BOOL IOCPServer::InitializeIOCP(VOID)
|
||||
|
||||
DWORD IOCPServer::WorkThreadProc(LPVOID lParam)
|
||||
{
|
||||
OutputDebugStringA("======> IOCPServer WorkThreadProc begin \n");
|
||||
|
||||
IOCPServer* This = (IOCPServer*)(lParam);
|
||||
|
||||
HANDLE hCompletionPort = This->m_hCompletionPort;
|
||||
@@ -304,6 +310,7 @@ DWORD IOCPServer::WorkThreadProc(LPVOID lParam)
|
||||
{
|
||||
if (ContextObject && This->m_bTimeToKill == FALSE &&dwTrans==0)
|
||||
{
|
||||
ContextObject->olps = NULL;
|
||||
This->RemoveStaleContext(ContextObject);
|
||||
}
|
||||
SAFE_DELETE(OverlappedPlus);
|
||||
@@ -314,7 +321,6 @@ DWORD IOCPServer::WorkThreadProc(LPVOID lParam)
|
||||
//<2F><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>µ<EFBFBD><C2B5>̵߳<DFB3><CCB5>̵߳<DFB3><CCB5>̳߳<DFB3>
|
||||
if (ulBusyThread == This->m_ulCurrentThread)
|
||||
{
|
||||
|
||||
if (ulBusyThread < This->m_ulThreadPoolMax)
|
||||
{
|
||||
if (ContextObject != NULL)
|
||||
@@ -369,27 +375,36 @@ DWORD IOCPServer::WorkThreadProc(LPVOID lParam)
|
||||
InterlockedDecrement(&This->m_ulCurrentThread);
|
||||
InterlockedDecrement(&This->m_ulBusyThread);
|
||||
|
||||
OutputDebugStringA("======> IOCPServer WorkThreadProc end \n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
BOOL IOCPServer::HandleIO(IOType PacketFlags,PCONTEXT_OBJECT ContextObject, DWORD dwTrans) //<2F>ڹ<EFBFBD><DAB9><EFBFBD><EFBFBD>߳<EFBFBD><DFB3>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>
|
||||
//<2F>ڹ<EFBFBD><DAB9><EFBFBD><EFBFBD>߳<EFBFBD><DFB3>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>
|
||||
BOOL IOCPServer::HandleIO(IOType PacketFlags,PCONTEXT_OBJECT ContextObject, DWORD dwTrans)
|
||||
{
|
||||
AUTO_TICK(5);
|
||||
|
||||
BOOL bRet = FALSE;
|
||||
|
||||
if (IOInitialize == PacketFlags)
|
||||
switch (PacketFlags)
|
||||
{
|
||||
case IOInitialize:
|
||||
bRet = OnClientInitializing(ContextObject, dwTrans);
|
||||
}
|
||||
|
||||
if (IORead==PacketFlags) //WsaResv
|
||||
{
|
||||
break;
|
||||
case IORead:
|
||||
bRet = OnClientReceiving(ContextObject,dwTrans);
|
||||
break;
|
||||
case IOWrite:
|
||||
bRet = OnClientPostSending(ContextObject,dwTrans);
|
||||
break;
|
||||
case IOIdle:
|
||||
OutputDebugStringA("=> HandleIO PacketFlags= IOIdle\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (IOWrite==PacketFlags) //WsaSend
|
||||
{
|
||||
bRet = OnClientPostSending(ContextObject,dwTrans);
|
||||
}
|
||||
return bRet;
|
||||
}
|
||||
|
||||
@@ -409,66 +424,45 @@ BOOL IOCPServer::OnClientReceiving(PCONTEXT_OBJECT ContextObject, DWORD dwTrans
|
||||
RemoveStaleContext(ContextObject);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ContextObject->InCompressedBuffer.WriteBuffer((PBYTE)ContextObject->szBuffer,dwTrans); //<2F><><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>wsabuff 8192
|
||||
|
||||
while (ContextObject->InCompressedBuffer.GetBufferLength() > HDR_LENGTH) //<2F>鿴<EFBFBD><E9BFB4><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>wsabuff 8192
|
||||
ContextObject->InCompressedBuffer.WriteBuffer((PBYTE)ContextObject->szBuffer,dwTrans);
|
||||
//<2F>鿴<EFBFBD><E9BFB4><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
while (ContextObject->InCompressedBuffer.GetBufferLength() > HDR_LENGTH)
|
||||
{
|
||||
char szPacketFlag[FLAG_LENGTH]= {0};
|
||||
|
||||
char szPacketFlag[FLAG_LENGTH + 3]= {0}; // 8<>ֽڶ<D6BD><DAB6><EFBFBD>
|
||||
CopyMemory(szPacketFlag, ContextObject->InCompressedBuffer.GetBuffer(),FLAG_LENGTH);
|
||||
|
||||
if (memcmp(m_szPacketFlag, szPacketFlag, FLAG_LENGTH) != 0)
|
||||
{
|
||||
throw "bad Buffer";
|
||||
}
|
||||
throw "Bad Buffer";
|
||||
|
||||
//Shine[50][kdjfkdjfkj]
|
||||
ULONG ulPackTotalLength = 0;
|
||||
CopyMemory(&ulPackTotalLength, ContextObject->InCompressedBuffer.GetBuffer(FLAG_LENGTH), sizeof(ULONG));//Shine[50][kdjfkdjfkj]
|
||||
|
||||
CopyMemory(&ulPackTotalLength, ContextObject->InCompressedBuffer.GetBuffer(FLAG_LENGTH), sizeof(ULONG));
|
||||
//ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD><EFBFBD>ܳ<EFBFBD>
|
||||
|
||||
//50
|
||||
if (ulPackTotalLength && (ContextObject->InCompressedBuffer.GetBufferLength()) >= ulPackTotalLength)
|
||||
{
|
||||
ULONG ulOriginalLength = 0;
|
||||
ContextObject->InCompressedBuffer.ReadBuffer((PBYTE)szPacketFlag, FLAG_LENGTH);
|
||||
|
||||
ContextObject->InCompressedBuffer.ReadBuffer((PBYTE) &ulPackTotalLength, sizeof(ULONG));
|
||||
|
||||
ContextObject->InCompressedBuffer.ReadBuffer((PBYTE) &ulOriginalLength, sizeof(ULONG));
|
||||
|
||||
ULONG ulCompressedLength = ulPackTotalLength - HDR_LENGTH; //461 - 13 448
|
||||
PBYTE CompressedBuffer = new BYTE[ulCompressedLength]; //û<>н<EFBFBD>ѹ
|
||||
|
||||
PBYTE DeCompressedBuffer = new BYTE[ulOriginalLength]; //<2F><>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD> 436
|
||||
|
||||
if (CompressedBuffer == NULL || DeCompressedBuffer == NULL)
|
||||
{
|
||||
throw "Bad Allocate";
|
||||
}
|
||||
ContextObject->InCompressedBuffer.ReadBuffer(CompressedBuffer, ulCompressedLength); //<2F><><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD>ǰ<EFBFBD><C7B0>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>û<EFBFBD>н<EFBFBD>ѹ<EFBFBD><D1B9>ȡ<EFBFBD><C8A1>pData 448
|
||||
|
||||
int iRet = uncompress(DeCompressedBuffer, &ulOriginalLength, CompressedBuffer, ulCompressedLength); //<2F><>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD>ǰ<EFBFBD><C7B0>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>û<EFBFBD>н<EFBFBD>ѹ<EFBFBD><D1B9>ȡ<EFBFBD><C8A1>pData 448
|
||||
ContextObject->InCompressedBuffer.ReadBuffer(CompressedBuffer, ulCompressedLength);
|
||||
int iRet = uncompress(DeCompressedBuffer, &ulOriginalLength, CompressedBuffer, ulCompressedLength);
|
||||
if (iRet == Z_OK)
|
||||
{
|
||||
ContextObject->InDeCompressedBuffer.ClearBuffer();
|
||||
ContextObject->InCompressedBuffer.ClearBuffer();
|
||||
ContextObject->InDeCompressedBuffer.WriteBuffer(DeCompressedBuffer, ulOriginalLength);
|
||||
|
||||
m_NotifyProc(ContextObject); //֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>
|
||||
}
|
||||
else
|
||||
{
|
||||
}else{
|
||||
throw "Bad Buffer";
|
||||
}
|
||||
|
||||
delete [] CompressedBuffer;
|
||||
delete [] DeCompressedBuffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -485,10 +479,7 @@ BOOL IOCPServer::OnClientReceiving(PCONTEXT_OBJECT ContextObject, DWORD dwTrans
|
||||
|
||||
VOID IOCPServer::OnClientPreSending(CONTEXT_OBJECT* ContextObject, PBYTE szBuffer, ULONG ulOriginalLength)
|
||||
{
|
||||
if (ContextObject == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
assert (ContextObject);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -503,28 +494,20 @@ VOID IOCPServer::OnClientPreSending(CONTEXT_OBJECT* ContextObject, PBYTE szBuffe
|
||||
delete [] CompressedBuffer;
|
||||
return;
|
||||
}
|
||||
|
||||
ULONG ulPackTotalLength = ulCompressedLength + HDR_LENGTH;
|
||||
|
||||
ContextObject->OutCompressedBuffer.WriteBuffer((LPBYTE)m_szPacketFlag,FLAG_LENGTH);
|
||||
|
||||
ContextObject->OutCompressedBuffer.WriteBuffer((PBYTE)&ulPackTotalLength, sizeof(ULONG));
|
||||
|
||||
ContextObject->OutCompressedBuffer.WriteBuffer((PBYTE) &ulOriginalLength, sizeof(ULONG));
|
||||
|
||||
ContextObject->OutCompressedBuffer.WriteBuffer(CompressedBuffer, ulCompressedLength);
|
||||
|
||||
delete [] CompressedBuffer;
|
||||
}
|
||||
|
||||
OVERLAPPEDPLUS* OverlappedPlus = new OVERLAPPEDPLUS(IOWrite);
|
||||
|
||||
BOOL bOk = PostQueuedCompletionStatus(m_hCompletionPort, 0, (DWORD)ContextObject, &OverlappedPlus->m_ol);
|
||||
if ( (!bOk && GetLastError() != ERROR_IO_PENDING)) //<2F><><EFBFBD><EFBFBD>Ͷ<EFBFBD><CDB6>ʧ<EFBFBD><CAA7>
|
||||
if ( (!bOk && GetLastError() != ERROR_IO_PENDING) ) //<2F><><EFBFBD><EFBFBD>Ͷ<EFBFBD><CDB6>ʧ<EFBFBD><CAA7>
|
||||
{
|
||||
RemoveStaleContext(ContextObject);
|
||||
SAFE_DELETE(OverlappedPlus);
|
||||
return;
|
||||
}
|
||||
}catch(...){}
|
||||
}
|
||||
@@ -546,11 +529,10 @@ BOOL IOCPServer::OnClientPostSending(CONTEXT_OBJECT* ContextObject,ULONG ulCompl
|
||||
OVERLAPPEDPLUS * OverlappedPlus = new OVERLAPPEDPLUS(IOWrite); //<2F><><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ǽ<EFBFBD><C7BC><EFBFBD>Ͷ<EFBFBD><CDB6> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
ContextObject->wsaOutBuffer.buf = (char*)ContextObject->OutCompressedBuffer.GetBuffer();
|
||||
ContextObject->wsaOutBuffer.len = ContextObject->OutCompressedBuffer.GetBufferLength(); //<2F><><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݺͳ<DDBA><CDB3><EFBFBD>
|
||||
|
||||
ContextObject->wsaOutBuffer.len = ContextObject->OutCompressedBuffer.GetBufferLength();
|
||||
int iOk = WSASend(ContextObject->sClientSocket, &ContextObject->wsaOutBuffer,1,
|
||||
&ContextObject->wsaOutBuffer.len, ulFlags,&OverlappedPlus->m_ol, NULL);
|
||||
if (iOk == SOCKET_ERROR && WSAGetLastError() != WSA_IO_PENDING )
|
||||
if ( iOk == SOCKET_ERROR && WSAGetLastError() != WSA_IO_PENDING )
|
||||
{
|
||||
int a = GetLastError();
|
||||
RemoveStaleContext(ContextObject);
|
||||
@@ -570,21 +552,12 @@ DWORD IOCPServer::ListenThreadProc(LPVOID lParam) //
|
||||
while(1)
|
||||
{
|
||||
if (WaitForSingleObject(This->m_hKillEvent, 100) == WAIT_OBJECT_0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
DWORD dwRet;
|
||||
dwRet = WSAWaitForMultipleEvents(1,
|
||||
&This->m_hListenEvent,
|
||||
FALSE,
|
||||
100,
|
||||
FALSE);
|
||||
|
||||
dwRet = WSAWaitForMultipleEvents(1,&This->m_hListenEvent,FALSE,100,FALSE);
|
||||
if (dwRet == WSA_WAIT_TIMEOUT)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int iRet = WSAEnumNetworkEvents(This->m_sListenSocket,
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ǿͽ<C7BE><CDBD><EFBFBD><EFBFBD>¼<EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD> <20><><EFBFBD><EFBFBD> <20>ж<EFBFBD>
|
||||
@@ -592,19 +565,14 @@ DWORD IOCPServer::ListenThreadProc(LPVOID lParam) //
|
||||
&NetWorkEvents);
|
||||
|
||||
if (iRet == SOCKET_ERROR)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (NetWorkEvents.lNetworkEvents & FD_ACCEPT)
|
||||
{
|
||||
if (NetWorkEvents.iErrorCode[FD_ACCEPT_BIT] == 0)
|
||||
{
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǿͽ<C7BE><CDBD><EFBFBD>OnAccept()<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><D0B4><EFBFBD>
|
||||
This->OnAccept();
|
||||
}
|
||||
else
|
||||
{
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -618,10 +586,7 @@ void IOCPServer::OnAccept()
|
||||
SOCKADDR_IN ClientAddr = {0};
|
||||
SOCKET sClientSocket = INVALID_SOCKET;
|
||||
|
||||
int iRet = 0;
|
||||
int iLen = 0;;
|
||||
|
||||
iLen = sizeof(SOCKADDR_IN);
|
||||
int iLen = sizeof(SOCKADDR_IN);
|
||||
sClientSocket = accept(m_sListenSocket,
|
||||
(sockaddr*)&ClientAddr,
|
||||
&iLen); //ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD>ǵļ<C7B5><C4BC><EFBFBD><EFBFBD><EFBFBD><D7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>֮<EFBFBD>ź<EFBFBD>ͨ<EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><D7BD><EFBFBD>
|
||||
@@ -678,7 +643,6 @@ void IOCPServer::OnAccept()
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DFBB>ϵ<EFBFBD><CFB5>ȷ<EFBFBD><C8B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>SO_KEEPALIVEѡ<45>
|
||||
//<2F><><EFBFBD><EFBFBD>һֱ<D2BB><D6B1><EFBFBD>ر<EFBFBD>SOCKET<45><54><EFBFBD><EFBFBD>Ϊ<EFBFBD>ϵĵ<CFB5><C4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Сʱʱ<CAB1><CAB1>̫<EFBFBD><CCAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD><C7BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
||||
|
||||
CLock cs(m_cs);
|
||||
m_ContextConnectionList.AddTail(ContextObject); //<2F><><EFBFBD>뵽<EFBFBD><EBB5BD><EFBFBD>ǵ<EFBFBD><C7B5>ڴ<EFBFBD><DAB4>б<EFBFBD><D0B1><EFBFBD>
|
||||
|
||||
@@ -702,13 +666,14 @@ VOID IOCPServer::PostRecv(CONTEXT_OBJECT* ContextObject)
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB>ĵ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD>;<EFBFBD><CDBE>DZ<EFBFBD><C7B1>ض˵ĵ<CBB5>½<EFBFBD><C2BD><EFBFBD><EFBFBD><F3B5BDB4><EFBFBD><EFBFBD>ǵĹ<C7B5><C4B9><EFBFBD><EFBFBD>߳̾<DFB3>
|
||||
// <20><><EFBFBD><EFBFBD>Ӧ,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ProcessIOMessage<67><65><EFBFBD><EFBFBD>
|
||||
OVERLAPPEDPLUS * OverlappedPlus = new OVERLAPPEDPLUS(IORead);
|
||||
ContextObject->olps = OverlappedPlus;
|
||||
|
||||
DWORD dwReturn;
|
||||
ULONG ulFlags = MSG_PARTIAL;
|
||||
int iOk = WSARecv(ContextObject->sClientSocket, &ContextObject->wsaInBuf,
|
||||
1,&dwReturn, &ulFlags,&OverlappedPlus->m_ol, NULL);
|
||||
|
||||
if ( iOk == SOCKET_ERROR && WSAGetLastError() != WSA_IO_PENDING)
|
||||
if (iOk == SOCKET_ERROR && WSAGetLastError() != WSA_IO_PENDING)
|
||||
{
|
||||
int a = GetLastError();
|
||||
RemoveStaleContext(ContextObject);
|
||||
@@ -722,19 +687,13 @@ PCONTEXT_OBJECT IOCPServer::AllocateContext()
|
||||
|
||||
CLock cs(m_cs);
|
||||
|
||||
if (m_ContextFreePoolList.IsEmpty()==FALSE)
|
||||
{
|
||||
ContextObject = m_ContextFreePoolList.RemoveHead();
|
||||
}
|
||||
else
|
||||
{
|
||||
ContextObject = new CONTEXT_OBJECT;
|
||||
}
|
||||
ContextObject = !m_ContextFreePoolList.IsEmpty() ? m_ContextFreePoolList.RemoveHead() : new CONTEXT_OBJECT;
|
||||
|
||||
if (ContextObject != NULL)
|
||||
{
|
||||
ContextObject->InitMember();
|
||||
}
|
||||
|
||||
return ContextObject;
|
||||
}
|
||||
|
||||
@@ -749,7 +708,7 @@ VOID IOCPServer::RemoveStaleContext(CONTEXT_OBJECT* ContextObject)
|
||||
closesocket(ContextObject->sClientSocket); //<2F>ر<EFBFBD><D8B1><EFBFBD><D7BD><EFBFBD>
|
||||
ContextObject->sClientSocket = INVALID_SOCKET;
|
||||
|
||||
while (!HasOverlappedIoCompleted((LPOVERLAPPED)ContextObject)) //<2F>жϻ<D0B6><CFBB><EFBFBD>û<EFBFBD><C3BB><EFBFBD>첽IO<49><4F><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>ǰ<EFBFBD><EFBFBD><D7BD><EFBFBD><EFBFBD><EFBFBD>
|
||||
while (!HasOverlappedIoCompleted((LPOVERLAPPED)ContextObject))//<2F>жϻ<D0B6><CFBB><EFBFBD>û<EFBFBD><C3BB><EFBFBD>첽IO<49><4F><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>ǰ<EFBFBD><EFBFBD><D7BD><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
Sleep(0);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ typedef struct _CONTEXT_OBJECT
|
||||
CBuffer OutCompressedBuffer;
|
||||
int v1;
|
||||
HANDLE hDlg;
|
||||
void *olps; // OVERLAPPEDPLUS
|
||||
|
||||
VOID InitMember()
|
||||
{
|
||||
@@ -43,6 +44,7 @@ typedef struct _CONTEXT_OBJECT
|
||||
sClientSocket = INVALID_SOCKET;
|
||||
memset(&wsaInBuf,0,sizeof(WSABUF));
|
||||
memset(&wsaOutBuffer,0,sizeof(WSABUF));
|
||||
olps = NULL;
|
||||
}
|
||||
}CONTEXT_OBJECT,*PCONTEXT_OBJECT;
|
||||
|
||||
@@ -93,6 +95,8 @@ public:
|
||||
|
||||
VOID PostRecv(CONTEXT_OBJECT* ContextObject);
|
||||
|
||||
VOID ExitWorkThread() { EnterCriticalSection(&m_cs); --m_ulWorkThreadCount; LeaveCriticalSection(&m_cs); }
|
||||
|
||||
/************************************************************************/
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
BOOL HandleIO(IOType PacketFlags,PCONTEXT_OBJECT ContextObject, DWORD dwTrans);
|
||||
@@ -118,7 +122,6 @@ public:
|
||||
~CLock()
|
||||
{
|
||||
Unlock();
|
||||
|
||||
}
|
||||
|
||||
void Unlock()
|
||||
@@ -145,7 +148,21 @@ public:
|
||||
|
||||
OVERLAPPEDPLUS(IOType ioType)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
char szLog[100];
|
||||
sprintf_s(szLog, "=> [new] OVERLAPPEDPLUS %x by thread [%d].\n", this, GetCurrentThreadId());
|
||||
OutputDebugStringA(szLog);
|
||||
#endif
|
||||
ZeroMemory(this, sizeof(OVERLAPPEDPLUS));
|
||||
m_ioType = ioType;
|
||||
}
|
||||
|
||||
~OVERLAPPEDPLUS()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
char szLog[100];
|
||||
sprintf_s(szLog, "=> [delete] OVERLAPPEDPLUS %x by thread [%d].\n", this, GetCurrentThreadId());
|
||||
OutputDebugStringA(szLog);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
enum
|
||||
{
|
||||
IDM_CONTROL = 0x1010,
|
||||
IDM_FULLSCREEN,
|
||||
IDM_SEND_CTRL_ALT_DEL,
|
||||
IDM_TRACE_CURSOR, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾԶ<CABE><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
IDM_BLOCK_INPUT, // <20><><EFBFBD><EFBFBD>Զ<EFBFBD>̼<EFBFBD><CCBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@ -24,9 +25,11 @@ IMPLEMENT_DYNAMIC(CScreenSpyDlg, CDialog)
|
||||
|
||||
#define ALGORITHM_DIFF 1
|
||||
|
||||
CScreenSpyDlg::CScreenSpyDlg(CWnd* Parent, IOCPServer* IOCPServer, CONTEXT_OBJECT* ContextObject)
|
||||
CScreenSpyDlg::CScreenSpyDlg(CWnd* Parent, IOCPServer* IOCPServer, CONTEXT_OBJECT* ContextObject)
|
||||
: CDialog(CScreenSpyDlg::IDD, Parent)
|
||||
{
|
||||
m_bFullScreen = FALSE;
|
||||
|
||||
m_iocpServer = IOCPServer;
|
||||
m_ContextObject = ContextObject;
|
||||
|
||||
@@ -47,18 +50,9 @@ IMPLEMENT_DYNAMIC(CScreenSpyDlg, CDialog)
|
||||
m_ulHScrollPos = 0;
|
||||
m_ulVScrollPos = 0;
|
||||
|
||||
if (m_ContextObject==NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
ULONG ulBitmapInforLength = m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1;
|
||||
m_BitmapInfor_Full = (BITMAPINFO *) new BYTE[ulBitmapInforLength];
|
||||
|
||||
if (m_BitmapInfor_Full==NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(m_BitmapInfor_Full, m_ContextObject->InDeCompressedBuffer.GetBuffer(1), ulBitmapInforLength);
|
||||
|
||||
m_bIsCtrl = FALSE;
|
||||
@@ -101,6 +95,14 @@ BEGIN_MESSAGE_MAP(CScreenSpyDlg, CDialog)
|
||||
ON_WM_CLOSE()
|
||||
ON_WM_PAINT()
|
||||
ON_WM_SYSCOMMAND()
|
||||
ON_WM_HSCROLL()
|
||||
ON_WM_VSCROLL()
|
||||
ON_WM_LBUTTONDOWN()
|
||||
ON_WM_LBUTTONUP()
|
||||
ON_WM_MOUSEWHEEL()
|
||||
ON_WM_MOUSEMOVE()
|
||||
ON_WM_KILLFOCUS()
|
||||
ON_WM_SIZE()
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
@@ -132,6 +134,7 @@ BOOL CScreenSpyDlg::OnInitDialog()
|
||||
{
|
||||
SysMenu->AppendMenu(MF_SEPARATOR);
|
||||
SysMenu->AppendMenu(MF_STRING, IDM_CONTROL, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ(&Y)");
|
||||
SysMenu->AppendMenu(MF_STRING, IDM_FULLSCREEN, "ȫ<EFBFBD><EFBFBD>(&F)");
|
||||
SysMenu->AppendMenu(MF_STRING, IDM_TRACE_CURSOR, "<EFBFBD><EFBFBD><EFBFBD>ٱ<EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&T)");
|
||||
SysMenu->AppendMenu(MF_STRING, IDM_BLOCK_INPUT, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD>(&L)");
|
||||
SysMenu->AppendMenu(MF_STRING, IDM_SAVEDIB, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&S)");
|
||||
@@ -148,8 +151,7 @@ BOOL CScreenSpyDlg::OnInitDialog()
|
||||
|
||||
SendNext();
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// <20>쳣: OCX <20><><EFBFBD><EFBFBD>ҳӦ<D2B3><D3A6><EFBFBD><EFBFBD> FALSE
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -166,19 +168,15 @@ VOID CScreenSpyDlg::OnClose()
|
||||
|
||||
VOID CScreenSpyDlg::OnReceiveComplete()
|
||||
{
|
||||
if (m_ContextObject==NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
assert (m_ContextObject);
|
||||
|
||||
switch(m_ContextObject->InDeCompressedBuffer.GetBuffer()[0])
|
||||
{
|
||||
case TOKEN_FIRSTSCREEN:
|
||||
{
|
||||
DrawFirstScreen(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>һ֡ͼ<D6A1><CDBC> һ<><D2BB>ת<EFBFBD><D7AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
DrawFirstScreen();
|
||||
break;
|
||||
}
|
||||
|
||||
case TOKEN_NEXTSCREEN:
|
||||
{
|
||||
if (m_ContextObject->InDeCompressedBuffer.GetBuffer(0)[1]==ALGORITHM_DIFF)
|
||||
@@ -187,10 +185,10 @@ VOID CScreenSpyDlg::OnReceiveComplete()
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case TOKEN_CLIPBOARD_TEXT: //<2F><><EFBFBD><EFBFBD>
|
||||
case TOKEN_CLIPBOARD_TEXT:
|
||||
{
|
||||
UpdateServerClipboard((char*)m_ContextObject->InDeCompressedBuffer.GetBuffer(1), m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1);
|
||||
UpdateServerClipboard((char*)m_ContextObject->InDeCompressedBuffer.GetBuffer(1),
|
||||
m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -237,7 +235,6 @@ VOID CScreenSpyDlg::DrawNextScreenDiff(void)
|
||||
|
||||
//lodsdָ<64><D6B8><EFBFBD><EFBFBD>ESIָ<49><D6B8><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>λ<EFBFBD><CEBB>4<EFBFBD><34><EFBFBD>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD>EAX<41>в<EFBFBD><D0B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>4
|
||||
//movsbָ<62><D6B8><EFBFBD>ֽڴ<D6BD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>ͨ<EFBFBD><CDA8>SI<53><49>DI<44><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4>ַ<EFBFBD><D6B7>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD>ַ
|
||||
|
||||
//m_rectBuffer [0002 esi0002 esi000A 000C] [][]edi[][][][][][][][][][][][][][][][][]
|
||||
__asm
|
||||
{
|
||||
@@ -268,8 +265,6 @@ CopyEnd:
|
||||
void CScreenSpyDlg::OnPaint()
|
||||
{
|
||||
CPaintDC dc(this); // device context for painting
|
||||
// TODO: <20>ڴ˴<DAB4><CBB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
// <20><>Ϊ<EFBFBD><CEAA>ͼ<EFBFBD><CDBC>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD> CDialog::OnPaint()
|
||||
|
||||
if (m_bIsFirst)
|
||||
{
|
||||
@@ -310,8 +305,7 @@ VOID CScreenSpyDlg::DrawTipString(CString strString)
|
||||
//ExtTextOut<75><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ṩһ<E1B9A9><D2BB><EFBFBD>ɹ<EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>ľ<EFBFBD><C4BE>Σ<EFBFBD><CEA3>õ<EFBFBD>ǰѡ<C7B0><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塢<EFBFBD><E5A1A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD>
|
||||
ExtTextOut(m_hFullDC, 0, 0, ETO_OPAQUE, &Rect, NULL, 0, NULL);
|
||||
|
||||
DrawText (m_hFullDC, strString, -1, &Rect,
|
||||
DT_SINGLELINE | DT_CENTER | DT_VCENTER);
|
||||
DrawText (m_hFullDC, strString, -1, &Rect,DT_SINGLELINE | DT_CENTER | DT_VCENTER);
|
||||
|
||||
SetBkColor(m_hFullDC, BackgroundColor);
|
||||
SetTextColor(m_hFullDC, OldBackgroundColor);
|
||||
@@ -321,7 +315,6 @@ VOID CScreenSpyDlg::DrawTipString(CString strString)
|
||||
void CScreenSpyDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
{
|
||||
// TODO: <20>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC>ֵ
|
||||
|
||||
CMenu* SysMenu = GetSystemMenu(FALSE);
|
||||
|
||||
switch (nID)
|
||||
@@ -329,8 +322,13 @@ void CScreenSpyDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
case IDM_CONTROL:
|
||||
{
|
||||
m_bIsCtrl = !m_bIsCtrl;
|
||||
SysMenu->CheckMenuItem(IDM_CONTROL, m_bIsCtrl ? MF_CHECKED : MF_UNCHECKED); //<2F>˵<EFBFBD><CBB5><EFBFBD>ʽ
|
||||
|
||||
SysMenu->CheckMenuItem(IDM_CONTROL, m_bIsCtrl ? MF_CHECKED : MF_UNCHECKED);
|
||||
break;
|
||||
}
|
||||
case IDM_FULLSCREEN: // ȫ<><C8AB>
|
||||
{
|
||||
EnterFullScreen();
|
||||
SysMenu->CheckMenuItem(IDM_FULLSCREEN, MF_CHECKED); //<2F>˵<EFBFBD><CBB5><EFBFBD>ʽ
|
||||
break;
|
||||
}
|
||||
case IDM_SAVEDIB: // <20><><EFBFBD>ձ<EFBFBD><D5B1><EFBFBD>
|
||||
@@ -338,7 +336,6 @@ void CScreenSpyDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
SaveSnapshot();
|
||||
break;
|
||||
}
|
||||
|
||||
case IDM_TRACE_CURSOR: // <20><><EFBFBD>ٱ<EFBFBD><D9B1>ض<EFBFBD><D8B6><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
m_bIsTraceCursor = !m_bIsTraceCursor; //<2F><><EFBFBD><EFBFBD><EFBFBD>ڸı<DAB8><C4B1><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@ -346,10 +343,8 @@ void CScreenSpyDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
|
||||
// <20>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
||||
OnPaint();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case IDM_BLOCK_INPUT: // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>
|
||||
{
|
||||
BOOL bIsChecked = SysMenu->GetMenuState(IDM_BLOCK_INPUT, MF_BYCOMMAND) & MF_CHECKED;
|
||||
@@ -359,21 +354,17 @@ void CScreenSpyDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
bToken[0] = COMMAND_SCREEN_BLOCK_INPUT;
|
||||
bToken[1] = !bIsChecked;
|
||||
m_iocpServer->OnClientPreSending(m_ContextObject, bToken, sizeof(bToken));
|
||||
|
||||
break;
|
||||
}
|
||||
case IDM_GET_CLIPBOARD: //<2F><>ҪClient<6E>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
{
|
||||
BYTE bToken = COMMAND_SCREEN_GET_CLIPBOARD;
|
||||
m_iocpServer->OnClientPreSending(m_ContextObject, &bToken, sizeof(bToken));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case IDM_SET_CLIPBOARD: //<2F><><EFBFBD><EFBFBD>
|
||||
{
|
||||
SendServerClipboard();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -421,6 +412,8 @@ BOOL CScreenSpyDlg::PreTranslateMessage(MSG* pMsg)
|
||||
}
|
||||
if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE)
|
||||
return true;
|
||||
if (pMsg->wParam == VK_F11) // <20>˳<EFBFBD>ȫ<EFBFBD><C8AB>
|
||||
LeaveFullScreen();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -453,12 +446,11 @@ BOOL CScreenSpyDlg::SaveSnapshot(void)
|
||||
CFile File;
|
||||
if (!File.Open( Dlg.GetPathName(), CFile::modeWrite | CFile::modeCreate))
|
||||
{
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// BITMAPINFO<46><4F>С
|
||||
//+ (BitMapInfor->bmiHeader.biBitCount > 16 ? 1 : (1 << BitMapInfor->bmiHeader.biBitCount)) * sizeof(RGBQUAD);
|
||||
//+ (BitMapInfor->bmiHeader.biBitCount > 16 ? 1 : (1 << BitMapInfor->bmiHeader.biBitCount)) * sizeof(RGBQUAD)
|
||||
//bmp fjkdfj dkfjkdfj [][][][]
|
||||
int nbmiSize = sizeof(BITMAPINFO);
|
||||
|
||||
@@ -518,3 +510,174 @@ VOID CScreenSpyDlg::SendServerClipboard(void)
|
||||
m_iocpServer->OnClientPreSending(m_ContextObject,(PBYTE)szBuffer, iPacketLength);
|
||||
delete[] szBuffer;
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
|
||||
{
|
||||
SCROLLINFO si = {sizeof(si)};
|
||||
si.fMask = SIF_ALL;
|
||||
GetScrollInfo(SB_HORZ, &si);
|
||||
|
||||
int nPrevPos = si.nPos;
|
||||
switch(nSBCode)
|
||||
{
|
||||
case SB_LEFT:
|
||||
si.nPos = si.nMin;
|
||||
break;
|
||||
case SB_RIGHT:
|
||||
si.nPos = si.nMax;
|
||||
break;
|
||||
case SB_LINELEFT:
|
||||
si.nPos -= 8;
|
||||
break;
|
||||
case SB_LINERIGHT:
|
||||
si.nPos += 8;
|
||||
break;
|
||||
case SB_PAGELEFT:
|
||||
si.nPos -= si.nPage;
|
||||
break;
|
||||
case SB_PAGERIGHT:
|
||||
si.nPos += si.nPage;
|
||||
break;
|
||||
case SB_THUMBTRACK:
|
||||
si.nPos = si.nTrackPos;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
si.fMask = SIF_POS;
|
||||
SetScrollInfo(SB_HORZ, &si, TRUE);
|
||||
if (si.nPos != nPrevPos)
|
||||
{
|
||||
m_ulHScrollPos += si.nPos - nPrevPos;
|
||||
ScrollWindow(nPrevPos - si.nPos, 0, NULL, NULL);
|
||||
}
|
||||
|
||||
CDialog::OnHScroll(nSBCode, nPrevPos, pScrollBar);
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
|
||||
{
|
||||
SCROLLINFO si = {sizeof(si)};
|
||||
si.fMask = SIF_ALL;
|
||||
GetScrollInfo(SB_VERT, &si);
|
||||
|
||||
int nPrevPos = si.nPos;
|
||||
switch(nSBCode)
|
||||
{
|
||||
case SB_TOP:
|
||||
si.nPos = si.nMin;
|
||||
break;
|
||||
case SB_BOTTOM:
|
||||
si.nPos = si.nMax;
|
||||
break;
|
||||
case SB_LINEUP:
|
||||
si.nPos -= 8;
|
||||
break;
|
||||
case SB_LINEDOWN:
|
||||
si.nPos += 8;
|
||||
break;
|
||||
case SB_PAGEUP:
|
||||
si.nPos -= si.nPage;
|
||||
break;
|
||||
case SB_PAGEDOWN:
|
||||
si.nPos += si.nPage;
|
||||
break;
|
||||
case SB_THUMBTRACK:
|
||||
si.nPos = si.nTrackPos;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
si.fMask = SIF_POS;
|
||||
SetScrollInfo(SB_VERT, &si, TRUE);
|
||||
if (si.nPos != nPrevPos)
|
||||
{
|
||||
m_ulVScrollPos += si.nPos - nPrevPos;
|
||||
ScrollWindow(0, nPrevPos - si.nPos, NULL, NULL);
|
||||
}
|
||||
|
||||
CDialog::OnVScroll(nSBCode, nPrevPos, pScrollBar);
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::EnterFullScreen()
|
||||
{
|
||||
if (!m_bFullScreen)
|
||||
{
|
||||
//get current system resolution
|
||||
int g_iCurScreenWidth = GetSystemMetrics(SM_CXSCREEN);
|
||||
int g_iCurScreenHeight = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
//for full screen while backplay
|
||||
GetWindowPlacement(&m_struOldWndpl);
|
||||
|
||||
CRect rectWholeDlg;//entire client(including title bar)
|
||||
CRect rectClient;//client area(not including title bar)
|
||||
CRect rectFullScreen;
|
||||
GetWindowRect(&rectWholeDlg);
|
||||
RepositionBars(0, 0xffff, AFX_IDW_PANE_FIRST, reposQuery, &rectClient);
|
||||
ClientToScreen(&rectClient);
|
||||
|
||||
rectFullScreen.left = rectWholeDlg.left-rectClient.left;
|
||||
rectFullScreen.top = rectWholeDlg.top-rectClient.top;
|
||||
rectFullScreen.right = rectWholeDlg.right+g_iCurScreenWidth - rectClient.right;
|
||||
rectFullScreen.bottom = rectWholeDlg.bottom+g_iCurScreenHeight - rectClient.bottom;
|
||||
//enter into full screen;
|
||||
WINDOWPLACEMENT struWndpl;
|
||||
struWndpl.length = sizeof(WINDOWPLACEMENT);
|
||||
struWndpl.flags = 0;
|
||||
struWndpl.showCmd = SW_SHOWNORMAL;
|
||||
struWndpl.rcNormalPosition = rectFullScreen;
|
||||
SetWindowPlacement(&struWndpl);
|
||||
m_bFullScreen = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::LeaveFullScreen()
|
||||
{
|
||||
if (m_bFullScreen)
|
||||
{
|
||||
SetWindowPlacement(&m_struOldWndpl);
|
||||
CMenu *SysMenu = GetSystemMenu(FALSE);
|
||||
SysMenu->CheckMenuItem(IDM_FULLSCREEN, MF_UNCHECKED); //<2F>˵<EFBFBD><CBB5><EFBFBD>ʽ
|
||||
m_bFullScreen = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CScreenSpyDlg::OnLButtonDown(UINT nFlags, CPoint point)
|
||||
{
|
||||
CDialog::OnLButtonDown(nFlags, point);
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::OnLButtonUp(UINT nFlags, CPoint point)
|
||||
{
|
||||
CDialog::OnLButtonUp(nFlags, point);
|
||||
}
|
||||
|
||||
|
||||
BOOL CScreenSpyDlg::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
|
||||
{
|
||||
return CDialog::OnMouseWheel(nFlags, zDelta, pt);
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::OnMouseMove(UINT nFlags, CPoint point)
|
||||
{
|
||||
CDialog::OnMouseMove(nFlags, point);
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::OnKillFocus(CWnd* pNewWnd)
|
||||
{
|
||||
CDialog::OnKillFocus(pNewWnd);
|
||||
}
|
||||
|
||||
|
||||
void CScreenSpyDlg::OnSize(UINT nType, int cx, int cy)
|
||||
{
|
||||
CDialog::OnSize(nType, cx, cy);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ class CScreenSpyDlg : public CDialog
|
||||
DECLARE_DYNAMIC(CScreenSpyDlg)
|
||||
|
||||
public:
|
||||
//CScreenSpyDlg(CWnd* pParent = NULL); // <20><><EFBFBD><D7BC><EFBFBD>캯<EFBFBD><ECBAAF>
|
||||
CScreenSpyDlg::CScreenSpyDlg(CWnd* Parent, IOCPServer* IOCPServer=NULL, CONTEXT_OBJECT *ContextObject=NULL);
|
||||
virtual ~CScreenSpyDlg();
|
||||
|
||||
@@ -48,6 +47,22 @@ public:
|
||||
// <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
enum { IDD = IDD_DIALOG_SCREEN_SPY };
|
||||
|
||||
BOOL m_bFullScreen;
|
||||
|
||||
WINDOWPLACEMENT m_struOldWndpl;
|
||||
|
||||
void EnterFullScreen();
|
||||
void LeaveFullScreen();
|
||||
|
||||
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
||||
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
|
||||
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
|
||||
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
|
||||
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
|
||||
afx_msg void OnKillFocus(CWnd* pNewWnd);
|
||||
afx_msg void OnSize(UINT nType, int cx, int cy);
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧<><D6A7>
|
||||
|
||||
|
||||
@@ -26,11 +26,8 @@
|
||||
#include <afxwin.h> // MFC <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͱ<EFBFBD><EFBFBD><D7BC><EFBFBD><EFBFBD>
|
||||
#include <afxext.h> // MFC <20><>չ
|
||||
|
||||
|
||||
#include <afxdisp.h> // MFC <20>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
|
||||
#ifndef _AFX_NO_OLE_SUPPORT
|
||||
#include <afxdtctl.h> // MFC <20><> Internet Explorer 4 <20><><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD>֧<EFBFBD><D6A7>
|
||||
#endif
|
||||
@@ -40,10 +37,6 @@
|
||||
|
||||
#include <afxcontrolbars.h> // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϳؼ<CDBF><D8BC><EFBFBD><EFBFBD><EFBFBD> MFC ֧<><D6A7>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
// <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>䷽ʽ
|
||||
@@ -220,3 +213,25 @@ enum
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>C<EFBFBD><43><EFBFBD><EFBFBD>ʱ<EFBFBD>ȴ<EFBFBD>T<EFBFBD><54>(<28><><EFBFBD><EFBFBD>1ms)
|
||||
#define WAIT_1(C, T) { timeBeginPeriod(1); WAIT_n(C, T, 1); timeEndPeriod(1); }
|
||||
|
||||
// <20><><EFBFBD>ܼ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㺯<EFBFBD><E3BAAF><EFBFBD>ĺ<EFBFBD>ʱ
|
||||
class auto_tick
|
||||
{
|
||||
private:
|
||||
const char *func;
|
||||
int threshold;
|
||||
clock_t tick;
|
||||
__inline clock_t now() const { return clock(); }
|
||||
|
||||
public:
|
||||
auto_tick(const char *func_name, int th=5) : func(func_name), threshold(th), tick(now()) { }
|
||||
~auto_tick(){int s(this->time());if(s>threshold)TRACE("[%s]ִ<><D6B4>ʱ<EFBFBD><CAB1>: [%d]ms.\n", func, s);}
|
||||
__inline int time() const { return now() - tick; }
|
||||
};
|
||||
|
||||
#ifdef _DEBUG
|
||||
// <20><><EFBFBD>ܼ<EFBFBD><DCBC>㵱ǰ<E3B5B1><C7B0><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ӡ
|
||||
#define AUTO_TICK(thresh) auto_tick(__FUNCTION__, thresh)
|
||||
#else
|
||||
#define AUTO_TICK(thresh)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user