7 Commits

Author SHA1 Message Date
yuanyuanxiang
b573baed0b 发布V1.0.0.2 2019-01-18 17:37:15 +08:00
yuanyuanxiang
38c0c1ccdb 修复语音监听模块的问题 2019-01-17 21:14:02 +08:00
yuanyuanxiang
78623390b2 修复远程桌面跟踪鼠标不准的问题
添加比zstd更快的压缩库lz4。
2019-01-17 20:41:51 +08:00
yuanyuanxiang
16741545a9 采用比zlib更快的压缩库zstd
远程桌面帧率提高到12;补充上传zlib.lib。
2019-01-17 11:58:26 +08:00
yuanyuanxiang
c54d75505e 主控端退出时被控端也退出
1、修复主控端CTalkDlg的内存泄漏问题,被控端即时消息对话框置于顶层。

2、SAFE_DELETE(ContextObject->olps)有崩溃概率。改为主控端退出时先令被控端退出,就没有内存泄漏。

3、开关音频时偶有内存泄漏,waveInCallBack线程不能正常退出。
2019-01-15 21:48:37 +08:00
yuanyuanxiang
c6e9a06a1a 根据代码分析进行少量修改 2019-01-13 13:36:00 +08:00
yuanyuanxiang
79903cbdff 彻底修复多次打开文件管理窗口崩溃的缺陷
1、在主对话框清理子窗口的资源(原先在各自的OnClose函数),通过CLOSE_DELETE_DLG控制。

2、修正CFileManagerDlg的构造函数调用SHGetFileInfo和FromHandle方法,解决多次打开崩溃。

3、更新服务端zlib版本为V1.2.11。(与客户端不同,因inflate_fast 崩溃,没有采用汇编)
2019-01-13 13:13:59 +08:00
87 changed files with 7167 additions and 843 deletions

2
.gitignore vendored
View File

@@ -27,7 +27,6 @@ Release
*.lai *.lai
*.la *.la
*.a *.a
*.lib
# Executables # Executables
*.exe *.exe
@@ -67,3 +66,4 @@ server/2015Remote/2015Remote.aps
*.suo *.suo
server/2015Remote.VC.db server/2015Remote.VC.db
server/2015Remote.opensdf server/2015Remote.opensdf
*.7z

View File

@@ -71,3 +71,41 @@
4、退出时睡眠一会等待服务端清理发现这样可以避免退出时崩溃的概率。 4、退出时睡眠一会等待服务端清理发现这样可以避免退出时崩溃的概率。
5、发布稍微稳定的版本V1.0.0.1。 5、发布稍微稳定的版本V1.0.0.1。
2019.1.13
1、在主对话框清理子窗口的资源原先在各自的OnClose函数通过CLOSE_DELETE_DLG控制。
2、修正CFileManagerDlg的构造函数调用SHGetFileInfo和FromHandle方法解决多次打开崩溃。
3、更新服务端zlib版本为V1.2.11。与客户端不同因inflate_fast 崩溃,没有采用汇编)
2019.1.15
1、修复主控端CTalkDlg的内存泄漏问题被控端即时消息对话框置于顶层。
2、SAFE_DELETE(ContextObject->olps)有崩溃概率。改为主控端退出时先令被控端退出,就没有内存泄漏。
3、开关音频时偶有内存泄漏waveInCallBack线程不能正常退出。
2019.1.16
1、智能计时宏AUTO_TICK有问题不应该用无名的局部变量auto_tick。
2、采用由Facebook所开发的速度更快的压缩库zstd提高程序运行效率。
参看https://github.com/facebook/zstd
2019.1.17
1、添加比zstd更快的压缩库压缩率不如zstd和zliblz4 1.8.3,参看
https://github.com/lz4/lz4
2、修复被控端屏幕被缩放显示时远程桌面跟踪鼠标的位置不准的问题。
3、修复语音监听的问题2个事件CAudio修改为非"Manual Reset"。
2019.1.18
1、整理部分垃圾代码。
2、发布V1.0.0.2。

View File

@@ -14,12 +14,13 @@ CAudio::CAudio()
{ {
m_bExit = FALSE; m_bExit = FALSE;
m_hThreadCallBack = false; m_hThreadCallBack = false;
m_Thread = NULL;
m_bIsWaveInUsed = FALSE; m_bIsWaveInUsed = FALSE;
m_bIsWaveOutUsed = FALSE; m_bIsWaveOutUsed = FALSE;
m_nWaveInIndex = 0; m_nWaveInIndex = 0;
m_nWaveOutIndex = 0; m_nWaveOutIndex = 0;
m_hEventWaveIn = CreateEvent(NULL, TRUE, FALSE, NULL); m_hEventWaveIn = CreateEvent(NULL, FALSE, FALSE, NULL);
m_hStartRecord = CreateEvent(NULL, TRUE, FALSE, NULL); m_hStartRecord = CreateEvent(NULL, FALSE, FALSE, NULL);
memset(&m_GSMWavefmt, 0, sizeof(GSM610WAVEFORMAT)); memset(&m_GSMWavefmt, 0, sizeof(GSM610WAVEFORMAT));
m_GSMWavefmt.wfx.wFormatTag = WAVE_FORMAT_GSM610; m_GSMWavefmt.wfx.wFormatTag = WAVE_FORMAT_GSM610;
@@ -33,8 +34,7 @@ CAudio::CAudio()
m_ulBufferLength = 1000; m_ulBufferLength = 1000;
int i = 0; for (int i = 0; i < 2; ++i)
for (i = 0; i < 2; i++)
{ {
m_InAudioData[i] = new BYTE[m_ulBufferLength]; m_InAudioData[i] = new BYTE[m_ulBufferLength];
m_InAudioHeader[i] = new WAVEHDR; m_InAudioHeader[i] = new WAVEHDR;
@@ -47,26 +47,7 @@ CAudio::CAudio()
CAudio::~CAudio() CAudio::~CAudio()
{ {
m_bExit = TRUE; m_bExit = TRUE;
if (m_bIsWaveInUsed)
{
waveInStop(m_hWaveIn);
waveInReset(m_hWaveIn);
for (int i = 0; i < 2; i++)
waveInUnprepareHeader(m_hWaveIn, m_InAudioHeader[i], sizeof(WAVEHDR));
waveInClose(m_hWaveIn);
WAIT (m_hThreadCallBack, 30);
if (m_hThreadCallBack)
printf("û<EFBFBD>гɹ<EFBFBD><EFBFBD>ر<EFBFBD>waveInCallBack.\n");
}
for (int i = 0; i < 2; i++)
{
delete [] m_InAudioData[i];
m_InAudioData[i] = NULL;
delete [] m_InAudioHeader[i];
m_InAudioHeader[i] = NULL;
}
if (m_hEventWaveIn) if (m_hEventWaveIn)
{ {
SetEvent(m_hEventWaveIn); SetEvent(m_hEventWaveIn);
@@ -80,15 +61,38 @@ CAudio::~CAudio()
m_hStartRecord = NULL; m_hStartRecord = NULL;
} }
if (m_bIsWaveInUsed)
{
waveInStop(m_hWaveIn);
waveInReset(m_hWaveIn);
for (int i = 0; i < 2; ++i)
waveInUnprepareHeader(m_hWaveIn, m_InAudioHeader[i], sizeof(WAVEHDR));
waveInClose(m_hWaveIn);
WAIT (m_hThreadCallBack, 30);
if (m_hThreadCallBack)
printf("û<EFBFBD>гɹ<EFBFBD><EFBFBD>ر<EFBFBD>waveInCallBack.\n");
TerminateThread(m_Thread, -999);
m_Thread = NULL;
}
for (int i = 0; i < 2; ++i)
{
delete [] m_InAudioData[i];
m_InAudioData[i] = NULL;
delete [] m_InAudioHeader[i];
m_InAudioHeader[i] = NULL;
}
if (m_bIsWaveOutUsed) if (m_bIsWaveOutUsed)
{ {
waveOutReset(m_hWaveOut); waveOutReset(m_hWaveOut);
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; ++i)
waveOutUnprepareHeader(m_hWaveOut, m_InAudioHeader[i], sizeof(WAVEHDR)); waveOutUnprepareHeader(m_hWaveOut, m_InAudioHeader[i], sizeof(WAVEHDR));
waveOutClose(m_hWaveOut); waveOutClose(m_hWaveOut);
} }
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; ++i)
{ {
delete [] m_OutAudioData[i]; delete [] m_OutAudioData[i];
m_OutAudioData[i] = NULL; m_OutAudioData[i] = NULL;
@@ -102,8 +106,7 @@ BOOL CAudio::InitializeWaveIn()
MMRESULT mmResult; MMRESULT mmResult;
DWORD dwThreadID = 0; DWORD dwThreadID = 0;
HANDLE h = NULL; m_hThreadCallBack = m_Thread = CreateThread(NULL, 0,
m_hThreadCallBack = h = CreateThread(NULL, 0,
(LPTHREAD_START_ROUTINE)waveInCallBack, (LPVOID)this, (LPTHREAD_START_ROUTINE)waveInCallBack, (LPVOID)this,
CREATE_SUSPENDED, &dwThreadID); CREATE_SUSPENDED, &dwThreadID);
@@ -114,12 +117,11 @@ BOOL CAudio::InitializeWaveIn()
//m_hWaveIn ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //m_hWaveIn ¼<><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (mmResult != MMSYSERR_NOERROR) if (mmResult != MMSYSERR_NOERROR)
{ {
CloseHandle(h);
return FALSE; return FALSE;
} }
//¼<><C2BC><EFBFBD><20><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //¼<><C2BC><EFBFBD><20><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
for (int i=0; i<2; i++) for (int i=0; i<2; ++i)
{ {
m_InAudioHeader[i]->lpData = (LPSTR)m_InAudioData[i]; //m_lpInAudioData ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> m_InAudioHeader[i]->lpData = (LPSTR)m_InAudioData[i]; //m_lpInAudioData ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_InAudioHeader[i]->dwBufferLength = m_ulBufferLength; m_InAudioHeader[i]->dwBufferLength = m_ulBufferLength;
@@ -130,8 +132,7 @@ BOOL CAudio::InitializeWaveIn()
waveInAddBuffer(m_hWaveIn, m_InAudioHeader[m_nWaveInIndex], sizeof(WAVEHDR)); waveInAddBuffer(m_hWaveIn, m_InAudioHeader[m_nWaveInIndex], sizeof(WAVEHDR));
ResumeThread(h); ResumeThread(m_Thread);
CloseHandle(h);
waveInStart(m_hWaveIn); //¼<><C2BC> waveInStart(m_hWaveIn); //¼<><C2BC>
m_bIsWaveInUsed = TRUE; m_bIsWaveInUsed = TRUE;
@@ -170,11 +171,12 @@ DWORD WINAPI CAudio::waveInCallBack(LPVOID lParam)
{ {
SetEvent(This->m_hEventWaveIn); SetEvent(This->m_hEventWaveIn);
WaitForSingleObject(This->m_hStartRecord, INFINITE); WaitForSingleObject(This->m_hStartRecord, INFINITE);
if (This->m_bExit)
break;
Sleep(1); Sleep(1);
This->m_nWaveInIndex = 1 - This->m_nWaveInIndex; This->m_nWaveInIndex = 1 - This->m_nWaveInIndex;
//<2F><><EFBFBD>»<EFBFBD><C2BB><EFBFBD> //<2F><><EFBFBD>»<EFBFBD><C2BB><EFBFBD>
MMRESULT mmResult = waveInAddBuffer(This->m_hWaveIn, MMRESULT mmResult = waveInAddBuffer(This->m_hWaveIn,
This->m_InAudioHeader[This->m_nWaveInIndex], sizeof(WAVEHDR)); This->m_InAudioHeader[This->m_nWaveInIndex], sizeof(WAVEHDR));
@@ -194,7 +196,7 @@ DWORD WINAPI CAudio::waveInCallBack(LPVOID lParam)
std::cout<<"waveInCallBack end\n"; std::cout<<"waveInCallBack end\n";
This->m_hThreadCallBack = false; This->m_hThreadCallBack = false;
return 0; return 0XDEADAAAA;
} }
BOOL CAudio::PlayBuffer(LPBYTE szBuffer, DWORD dwBufferSize) BOOL CAudio::PlayBuffer(LPBYTE szBuffer, DWORD dwBufferSize)
@@ -215,8 +217,8 @@ BOOL CAudio::InitializeWaveOut()
{ {
if (!waveOutGetNumDevs()) if (!waveOutGetNumDevs())
return FALSE; return FALSE;
int i;
for (i = 0; i < 2; i++) for (int i = 0; i < 2; ++i)
memset(m_OutAudioData[i], 0, m_ulBufferLength); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> memset(m_OutAudioData[i], 0, m_ulBufferLength); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
MMRESULT mmResult; MMRESULT mmResult;
@@ -224,7 +226,7 @@ BOOL CAudio::InitializeWaveOut()
if (mmResult != MMSYSERR_NOERROR) if (mmResult != MMSYSERR_NOERROR)
return false; return false;
for (i = 0; i < 2; i++) for (int i = 0; i < 2; ++i)
{ {
m_OutAudioHeader[i]->lpData = (LPSTR)m_OutAudioData[i]; m_OutAudioHeader[i]->lpData = (LPSTR)m_OutAudioData[i];
m_OutAudioHeader[i]->dwBufferLength = m_ulBufferLength; m_OutAudioHeader[i]->dwBufferLength = m_ulBufferLength;

View File

@@ -26,9 +26,10 @@ public:
HWAVEIN m_hWaveIn; //<2F><EFBFBD><E8B1B8><EFBFBD><EFBFBD> HWAVEIN m_hWaveIn; //<2F><EFBFBD><E8B1B8><EFBFBD><EFBFBD>
DWORD m_nWaveInIndex; DWORD m_nWaveInIndex;
bool m_hThreadCallBack; bool m_hThreadCallBack;
HANDLE m_Thread;// waveInCallBack<63>߳<EFBFBD>
static DWORD WINAPI waveInCallBack(LPVOID lParam); //<2F><><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD>ض<EFBFBD> static DWORD WINAPI waveInCallBack(LPVOID lParam); //<2F><><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD>ض<EFBFBD>
LPBYTE CAudio::GetRecordBuffer(LPDWORD dwBufferSize); LPBYTE GetRecordBuffer(LPDWORD dwBufferSize);
BOOL CAudio::InitializeWaveIn(); BOOL InitializeWaveIn();
BOOL m_bIsWaveInUsed; BOOL m_bIsWaveInUsed;
HWAVEOUT m_hWaveOut; HWAVEOUT m_hWaveOut;
@@ -37,8 +38,8 @@ public:
DWORD m_nWaveOutIndex; DWORD m_nWaveOutIndex;
LPWAVEHDR m_OutAudioHeader[2]; //<2F><><EFBFBD><EFBFBD>ͷ LPWAVEHDR m_OutAudioHeader[2]; //<2F><><EFBFBD><EFBFBD>ͷ
LPBYTE m_OutAudioData[2]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> LPBYTE m_OutAudioData[2]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BOOL CAudio::PlayBuffer(LPBYTE szBuffer, DWORD dwBufferSize); BOOL PlayBuffer(LPBYTE szBuffer, DWORD dwBufferSize);
BOOL CAudio::InitializeWaveOut(); BOOL InitializeWaveOut();
}; };
#endif // !defined(AFX_AUDIO_H__56854DE7_5FE4_486F_9AFC_CE3726EF7CBC__INCLUDED_) #endif // !defined(AFX_AUDIO_H__56854DE7_5FE4_486F_9AFC_CE3726EF7CBC__INCLUDED_)

View File

@@ -17,6 +17,8 @@ using namespace std;
CAudioManager::CAudioManager(IOCPClient* ClientObject, int n):CManager(ClientObject) CAudioManager::CAudioManager(IOCPClient* ClientObject, int n):CManager(ClientObject)
{ {
printf("new CAudioManager %x\n", this);
m_bIsWorking = FALSE; m_bIsWorking = FALSE;
m_AudioObject = NULL; m_AudioObject = NULL;
@@ -57,7 +59,8 @@ DWORD CAudioManager::WorkThread(LPVOID lParam) //
CAudioManager *This = (CAudioManager *)lParam; CAudioManager *This = (CAudioManager *)lParam;
while (This->m_bIsWorking) while (This->m_bIsWorking)
{ {
This->SendRecordBuffer(); if(!This->SendRecordBuffer())
Sleep(50);
} }
cout<<"CAudioManager WorkThread end\n"; cout<<"CAudioManager WorkThread end\n";
@@ -65,10 +68,10 @@ DWORD CAudioManager::WorkThread(LPVOID lParam) //
return 0; return 0;
} }
int CAudioManager::SendRecordBuffer() BOOL CAudioManager::SendRecordBuffer()
{ {
DWORD dwBufferSize = 0; DWORD dwBufferSize = 0;
DWORD dwReturn = 0; BOOL dwReturn = 0;
//<2F><><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD> <20><>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD> //<2F><><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD> <20><>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD>
LPBYTE szBuffer = m_AudioObject->GetRecordBuffer(&dwBufferSize); LPBYTE szBuffer = m_AudioObject->GetRecordBuffer(&dwBufferSize);
if (szBuffer == NULL) if (szBuffer == NULL)
@@ -100,6 +103,7 @@ CAudioManager::~CAudioManager()
delete m_AudioObject; delete m_AudioObject;
m_AudioObject = NULL; m_AudioObject = NULL;
} }
printf("~CAudioManager %x\n", this);
} }
//USB //USB

View File

@@ -23,7 +23,7 @@ public:
BOOL m_bIsWorking; BOOL m_bIsWorking;
HANDLE m_hWorkThread; HANDLE m_hWorkThread;
static DWORD WorkThread(LPVOID lParam); static DWORD WorkThread(LPVOID lParam);
int CAudioManager::SendRecordBuffer(); BOOL SendRecordBuffer();
CAudio* m_AudioObject; CAudio* m_AudioObject;
}; };

View File

@@ -135,7 +135,7 @@ VOID CBuffer::ClearBuffer()
ULONG CBuffer::GetBufferLength() //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD> ULONG CBuffer::GetBufferLength() const //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
{ {
if (m_Base == NULL) if (m_Base == NULL)
return 0; return 0;
@@ -144,12 +144,12 @@ ULONG CBuffer::GetBufferLength() //
} }
ULONG CBuffer::GetBufferMaxLength() ULONG CBuffer::GetBufferMaxLength() const
{ {
return m_ulMaxLength; return m_ulMaxLength;
} }
PBYTE CBuffer::GetBuffer(ULONG ulPos) PBYTE CBuffer::GetBuffer(ULONG ulPos) const
{ {
if (m_Base==NULL) if (m_Base==NULL)
{ {

View File

@@ -8,14 +8,14 @@ public:
CBuffer(void); CBuffer(void);
~CBuffer(void); ~CBuffer(void);
ULONG GetBufferMaxLength(); ULONG GetBufferMaxLength() const;
ULONG ReadBuffer(PBYTE Buffer, ULONG ulLength); ULONG ReadBuffer(PBYTE Buffer, ULONG ulLength);
ULONG GetBufferLength(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>; ULONG GetBufferLength() const; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
ULONG DeAllocateBuffer(ULONG ulLength); ULONG DeAllocateBuffer(ULONG ulLength);
VOID ClearBuffer(); VOID ClearBuffer();
ULONG ReAllocateBuffer(ULONG ulLength); ULONG ReAllocateBuffer(ULONG ulLength);
BOOL WriteBuffer(PBYTE Buffer, ULONG ulLength); BOOL WriteBuffer(PBYTE Buffer, ULONG ulLength);
PBYTE GetBuffer(ULONG ulPos=0); PBYTE GetBuffer(ULONG ulPos=0) const;
protected: protected:
PBYTE m_Base; PBYTE m_Base;

View File

@@ -158,12 +158,12 @@ class CCaptureVideo
public: public:
CCaptureVideo(); CCaptureVideo();
virtual ~CCaptureVideo(); virtual ~CCaptureVideo();
LPBITMAPINFO CCaptureVideo::GetBmpInfor(); LPBITMAPINFO GetBmpInfor();
HRESULT CCaptureVideo::InitCaptureGraphBuilder(); HRESULT InitCaptureGraphBuilder();
HRESULT CCaptureVideo::Open(int iDeviceID,int iPress); HRESULT Open(int iDeviceID,int iPress);
BOOL CCaptureVideo::BindVideoFilter(int deviceId, IBaseFilter **pFilter); BOOL BindVideoFilter(int deviceId, IBaseFilter **pFilter);
LPBYTE CCaptureVideo::GetDIB(DWORD& dwSize); LPBYTE GetDIB(DWORD& dwSize);
HWND m_hWnd; HWND m_hWnd;
@@ -176,10 +176,10 @@ public:
IBaseFilter* m_pBF; //FDO IBaseFilter* m_pBF; //FDO
ISampleGrabber* m_pGrabber; //<2F><><EFBFBD><EFBFBD> 24Color ISampleGrabber* m_pGrabber; //<2F><><EFBFBD><EFBFBD> 24Color
void CCaptureVideo::FreeMediaType(AM_MEDIA_TYPE& mt); void FreeMediaType(AM_MEDIA_TYPE& mt);
void CCaptureVideo::ResizeVideoWindow(); void ResizeVideoWindow();
HRESULT CCaptureVideo::SetupVideoWindow(); HRESULT SetupVideoWindow();
void CCaptureVideo::SendEnd(); void SendEnd();
}; };
#endif // !defined(AFX_CAPTUREVIDEO_H__0984BB8E_6DCB_4A5C_8E03_1217AE6E409D__INCLUDED_) #endif // !defined(AFX_CAPTUREVIDEO_H__0984BB8E_6DCB_4A5C_8E03_1217AE6E409D__INCLUDED_)

View File

@@ -115,7 +115,7 @@ DWORD WINAPI StartClient(LPVOID lParam)
while (!g_bExit) while (!g_bExit)
{ {
DWORD dwTickCount = GetTickCount(); DWORD dwTickCount = GetTickCount();
if (!ClientObject->ConnectServer(g_szServerIP, g_uPort)) if (!ClientObject->ConnectServer(g_szServerIP, g_uPort))
{ {
for (int k = 500; !g_bExit && --k; Sleep(10)); for (int k = 500; !g_bExit && --k; Sleep(10));

View File

@@ -65,7 +65,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>./;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>./;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile> </ClCompile>
<Link> <Link>
@@ -136,6 +136,9 @@
<ItemGroup> <ItemGroup>
<Media Include="Res\msg.wav" /> <Media Include="Res\msg.wav" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Image Include="Res\ghost.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>

View File

@@ -174,4 +174,9 @@
<Filter>资源文件</Filter> <Filter>资源文件</Filter>
</Media> </Media>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Image Include="Res\ghost.ico">
<Filter>资源文件</Filter>
</Image>
</ItemGroup>
</Project> </Project>

View File

@@ -592,7 +592,7 @@ void CFileManager::CreateLocalRecvFile(LPBYTE lpBuffer)
strcpy(m_strCurrentProcessFileName, (char *)lpBuffer + 8); strcpy(m_strCurrentProcessFileName, (char *)lpBuffer + 8);
// <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> // <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
m_nCurrentProcessFileLength = (pFileSize->dwSizeHigh * (MAXDWORD + 1)) + pFileSize->dwSizeLow; m_nCurrentProcessFileLength = (pFileSize->dwSizeHigh * (MAXDWORD + long long(1))) + pFileSize->dwSizeLow;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼ // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼
MakeSureDirectoryPathExists(m_strCurrentProcessFileName); MakeSureDirectoryPathExists(m_strCurrentProcessFileName);

View File

@@ -5,16 +5,37 @@
#include "stdafx.h" #include "stdafx.h"
#include "IOCPClient.h" #include "IOCPClient.h"
#include <IOSTREAM> #include <IOSTREAM>
#include "zconf.h" #if USING_ZLIB
#include "zlib.h" #include "zlib.h"
#define Z_FAILED(p) (Z_OK != (p))
#define Z_SUCCESS(p) (!Z_FAILED(p))
#else
#if USING_LZ4
#include "lz4/lz4.h"
#pragma comment(lib, "lz4/lz4.lib")
#define Z_FAILED(p) (0 == (p))
#define Z_SUCCESS(p) (!Z_FAILED(p))
#define compress(dest, destLen, source, sourceLen) LZ4_compress_default((const char*)source, (char*)dest, sourceLen, *(destLen))
#define uncompress(dest, destLen, source, sourceLen) LZ4_decompress_safe((const char*)source, (char*)dest, sourceLen, *(destLen))
#else
#include "zstd/zstd.h"
#pragma comment(lib, "zstd/zstd.lib")
#define Z_FAILED(p) ZSTD_isError(p)
#define Z_SUCCESS(p) (!Z_FAILED(p))
#define compress(dest, destLen, source, sourceLen) ZSTD_compress(dest, *(destLen), source, sourceLen, ZSTD_CLEVEL_DEFAULT)
#define uncompress(dest, destLen, source, sourceLen) ZSTD_decompress(dest, *(destLen), source, sourceLen)
#endif
#endif
#include <assert.h> #include <assert.h>
#include "Manager.h"
using namespace std; using namespace std;
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// Construction/Destruction // Construction/Destruction
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
VOID IOCPClient::setManagerCallBack(class CManager* Manager) VOID IOCPClient::setManagerCallBack(CManager* Manager)
{ {
m_Manager = Manager; m_Manager = Manager;
} }
@@ -22,6 +43,7 @@ VOID IOCPClient::setManagerCallBack(class CManager* Manager)
IOCPClient::IOCPClient(bool exit_while_disconnect) IOCPClient::IOCPClient(bool exit_while_disconnect)
{ {
m_Manager = NULL;
WSADATA wsaData; WSADATA wsaData;
WSAStartup(MAKEWORD(2, 2), &wsaData); WSAStartup(MAKEWORD(2, 2), &wsaData);
@@ -29,6 +51,7 @@ IOCPClient::IOCPClient(bool exit_while_disconnect)
m_hWorkThread = NULL; m_hWorkThread = NULL;
m_bWorkThread = S_STOP; m_bWorkThread = S_STOP;
memset(m_szPacketFlag, 0, sizeof(m_szPacketFlag));
memcpy(m_szPacketFlag,"Shine",FLAG_LENGTH); memcpy(m_szPacketFlag,"Shine",FLAG_LENGTH);
m_bIsRunning = TRUE; m_bIsRunning = TRUE;
@@ -154,6 +177,14 @@ DWORD WINAPI IOCPClient::WorkThreadProc(LPVOID lParam)
}else{ }else{
//<2F><>ȷ<EFBFBD><C8B7><EFBFBD>վ͵<D5BE><CDB5><EFBFBD>OnRead<61><64><EFBFBD><EFBFBD><><D7AA>OnRead //<2F><>ȷ<EFBFBD><C8B7><EFBFBD>վ͵<D5BE><CDB5><EFBFBD>OnRead<61><64><EFBFBD><EFBFBD><><D7AA>OnRead
This->OnServerReceiving(szBuffer, iReceivedLength); This->OnServerReceiving(szBuffer, iReceivedLength);
if (This->m_Manager->m_bIsDead)
{
printf("****** Recv bye bye ******\n");
// <20>˳<EFBFBD><CBB3>ͻ<EFBFBD><CDBB><EFBFBD>
extern bool g_bExit;
g_bExit = true;
break;
}
} }
} }
} }
@@ -176,7 +207,7 @@ VOID IOCPClient::OnServerReceiving(char* szBuffer, ULONG 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> //<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>
while (m_CompressedBuffer.GetBufferLength() > HDR_LENGTH) while (m_CompressedBuffer.GetBufferLength() > HDR_LENGTH)
{ {
char szPacketFlag[FLAG_LENGTH] = {0}; char szPacketFlag[FLAG_LENGTH + 3] = {0};
CopyMemory(szPacketFlag, m_CompressedBuffer.GetBuffer(),FLAG_LENGTH); CopyMemory(szPacketFlag, m_CompressedBuffer.GetBuffer(),FLAG_LENGTH);
//<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>ͷ //<2F>ж<EFBFBD><D0B6><EFBFBD><EFBFBD><EFBFBD>ͷ
if (memcmp(m_szPacketFlag, szPacketFlag, FLAG_LENGTH) != 0) if (memcmp(m_szPacketFlag, szPacketFlag, FLAG_LENGTH) != 0)
@@ -209,7 +240,7 @@ VOID IOCPClient::OnServerReceiving(char* szBuffer, ULONG ulLength)
int iRet = uncompress(DeCompressedBuffer, int iRet = uncompress(DeCompressedBuffer,
&ulOriginalLength, CompressedBuffer, ulCompressedLength); &ulOriginalLength, CompressedBuffer, ulCompressedLength);
if (iRet == Z_OK)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD>ɹ<EFBFBD> if (Z_SUCCESS(iRet))//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD>ɹ<EFBFBD>
{ {
CBuffer m_DeCompressedBuffer; CBuffer m_DeCompressedBuffer;
m_DeCompressedBuffer.WriteBuffer(DeCompressedBuffer, m_DeCompressedBuffer.WriteBuffer(DeCompressedBuffer,
@@ -220,8 +251,10 @@ VOID IOCPClient::OnServerReceiving(char* szBuffer, ULONG ulLength)
m_Manager->OnReceive((PBYTE)m_DeCompressedBuffer.GetBuffer(0), m_Manager->OnReceive((PBYTE)m_DeCompressedBuffer.GetBuffer(0),
m_DeCompressedBuffer.GetBufferLength()); m_DeCompressedBuffer.GetBufferLength());
} }
else else{
printf("[ERROR] uncompress failed \n");
throw "Bad Buffer"; throw "Bad Buffer";
}
delete [] CompressedBuffer; delete [] CompressedBuffer;
delete [] DeCompressedBuffer; delete [] DeCompressedBuffer;
@@ -233,8 +266,9 @@ VOID IOCPClient::OnServerReceiving(char* szBuffer, ULONG ulLength)
} }
int IOCPClient::OnServerSending(const char* szBuffer, ULONG ulOriginalLength) //Hello BOOL IOCPClient::OnServerSending(const char* szBuffer, ULONG ulOriginalLength) //Hello
{ {
AUTO_TICK(10);
assert (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><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
@@ -242,20 +276,30 @@ int IOCPClient::OnServerSending(const char* szBuffer, ULONG ulOriginalLength) /
//<2F><><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9> ѹ<><D1B9><EFBFBD>㷨 ΢<><CEA2><EFBFBD> //<2F><><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9> ѹ<><D1B9><EFBFBD>㷨 ΢<><CEA2><EFBFBD>
//nSize = 436 //nSize = 436
//destLen = 448 //destLen = 448
#if USING_ZLIB
unsigned long ulCompressedLength = (double)ulOriginalLength * 1.001 + 12; unsigned long ulCompressedLength = (double)ulOriginalLength * 1.001 + 12;
#elif USING_LZ4
unsigned long ulCompressedLength = LZ4_compressBound(ulOriginalLength);
#else
unsigned long ulCompressedLength = ZSTD_compressBound(ulOriginalLength);
#endif
LPBYTE CompressedBuffer = new BYTE[ulCompressedLength]; LPBYTE CompressedBuffer = new BYTE[ulCompressedLength];
int iRet = compress(CompressedBuffer, &ulCompressedLength, (PBYTE)szBuffer, ulOriginalLength); int iRet = compress(CompressedBuffer, &ulCompressedLength, (PBYTE)szBuffer, ulOriginalLength);
if (iRet != Z_OK) if (Z_FAILED(iRet))
{ {
printf("[ERROR] compress failed \n");
delete [] CompressedBuffer; delete [] CompressedBuffer;
return FALSE; return FALSE;
} }
#if !USING_ZLIB
ulCompressedLength = iRet;
#endif
ULONG ulPackTotalLength = ulCompressedLength + HDR_LENGTH; ULONG ulPackTotalLength = ulCompressedLength + HDR_LENGTH;
CBuffer m_WriteBuffer; CBuffer m_WriteBuffer;
m_WriteBuffer.WriteBuffer((PBYTE)m_szPacketFlag, sizeof(m_szPacketFlag)); m_WriteBuffer.WriteBuffer((PBYTE)m_szPacketFlag, FLAG_LENGTH);
m_WriteBuffer.WriteBuffer((PBYTE) &ulPackTotalLength,sizeof(ULONG)); m_WriteBuffer.WriteBuffer((PBYTE) &ulPackTotalLength,sizeof(ULONG));
// 5 4 // 5 4

View File

@@ -38,7 +38,7 @@ public:
static DWORD WINAPI WorkThreadProc(LPVOID lParam); static DWORD WINAPI WorkThreadProc(LPVOID lParam);
VOID OnServerReceiving(char* szBuffer, ULONG ulReceivedLength); VOID OnServerReceiving(char* szBuffer, ULONG ulReceivedLength);
int OnServerSending(const char* szBuffer, ULONG ulOriginalLength); BOOL OnServerSending(const char* szBuffer, ULONG ulOriginalLength);
BOOL SendWithSplit(const char* szBuffer, ULONG ulLength, ULONG ulSplitLength); BOOL SendWithSplit(const char* szBuffer, ULONG ulLength, ULONG ulSplitLength);
BOOL IsRunning() const BOOL IsRunning() const
@@ -49,16 +49,16 @@ public:
BOOL m_bIsRunning; BOOL m_bIsRunning;
BOOL m_bConnected; BOOL m_bConnected;
char m_szPacketFlag[FLAG_LENGTH]; char m_szPacketFlag[FLAG_LENGTH + 3];
VOID setManagerCallBack(class CManager* Manager); VOID setManagerCallBack(CManager* Manager);
VOID Disconnect(); VOID Disconnect();
VOID RunEventLoop(const BOOL &bCondition); VOID RunEventLoop(const BOOL &bCondition);
bool IsConnected() const { return m_bConnected; } bool IsConnected() const { return m_bConnected == TRUE; }
public: public:
class CManager* m_Manager; CManager* m_Manager;
CRITICAL_SECTION m_cs; CRITICAL_SECTION m_cs;
bool m_exit_while_disconnect; bool m_exit_while_disconnect;
}; };

View File

@@ -16,9 +16,9 @@ CKernelManager::CKernelManager(IOCPClient* ClientObject):CManager(ClientObject)
CKernelManager::~CKernelManager() CKernelManager::~CKernelManager()
{ {
printf("~CKernelManager \n"); printf("~CKernelManager begin\n");
int i = 0; int i = 0;
for (i=0;i<0x1000;i++) for (i=0;i<0x1000;++i)
{ {
if (m_hThread->h!=0) if (m_hThread->h!=0)
{ {
@@ -30,6 +30,7 @@ CKernelManager::~CKernelManager()
} }
} }
m_ulThreadCount = 0; m_ulThreadCount = 0;
printf("~CKernelManager end\n");
} }
VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength) VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
@@ -75,6 +76,7 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
{ {
BYTE bToken = COMMAND_BYE; //<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD> Common.h BYTE bToken = COMMAND_BYE; //<2F><><EFBFBD><EFBFBD>ͷ<EFBFBD>ļ<EFBFBD> Common.h
m_ClientObject->OnServerSending((char*)&bToken, 1); m_ClientObject->OnServerSending((char*)&bToken, 1);
m_bIsDead = true; //say goodbye
OutputDebugStringA("======> Bye bye \n"); OutputDebugStringA("======> Bye bye \n");
m_hThread[m_ulThreadCount].p = NULL; m_hThread[m_ulThreadCount].p = NULL;
delete pNew; delete pNew;

View File

@@ -56,7 +56,7 @@ BOOL WebCamIsExist()
BOOL bOk = FALSE; BOOL bOk = FALSE;
char szDeviceName[100], szVer[50]; char szDeviceName[100], szVer[50];
for (int i = 0; i < 10 && !bOk; i++) for (int i = 0; i < 10 && !bOk; ++i)
{ {
bOk = capGetDriverDescription(i, szDeviceName, sizeof(szDeviceName), bOk = capGetDriverDescription(i, szDeviceName, sizeof(szDeviceName),
//ϵͳ<CFB5><CDB3>API<50><49><EFBFBD><EFBFBD> //ϵͳ<CFB5><CDB3>API<50><49><EFBFBD><EFBFBD>

View File

@@ -4,6 +4,7 @@
#include "stdafx.h" #include "stdafx.h"
#include "Manager.h" #include "Manager.h"
#include "IOCPClient.h"
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// Construction/Destruction // Construction/Destruction
@@ -11,8 +12,9 @@
CManager::CManager(IOCPClient* ClientObject) CManager::CManager(IOCPClient* ClientObject)
{ {
m_bIsDead = false;
m_ClientObject = ClientObject; m_ClientObject = ClientObject;
m_ClientObject->setManagerCallBack(this); m_ClientObject->setManagerCallBack(this);
m_hEventDlgOpen = CreateEvent(NULL,TRUE,FALSE,NULL); m_hEventDlgOpen = CreateEvent(NULL,TRUE,FALSE,NULL);
} }

View File

@@ -9,14 +9,12 @@
#pragma once #pragma once
#endif // _MSC_VER > 1000 #endif // _MSC_VER > 1000
#include "IOCPClient.h"
class IOCPClient; class IOCPClient;
class CManager class CManager
{ {
public: public:
bool m_bIsDead; // bye-bye
CManager(IOCPClient* ClientObject); CManager(IOCPClient* ClientObject);
virtual ~CManager(); virtual ~CManager();

View File

@@ -18,7 +18,7 @@ public:
CRegisterManager(IOCPClient* ClientObject, int n); CRegisterManager(IOCPClient* ClientObject, int n);
virtual ~CRegisterManager(); virtual ~CRegisterManager();
VOID OnReceive(PBYTE szBuffer, ULONG ulLength); VOID OnReceive(PBYTE szBuffer, ULONG ulLength);
VOID CRegisterManager::Find(char bToken, char *szPath); VOID Find(char bToken, char *szPath);
}; };
#endif // !defined(AFX_REGISTERMANAGER_H__2EFB2AB3_C6C9_454E_9BC7_AE35362C85FE__INCLUDED_) #endif // !defined(AFX_REGISTERMANAGER_H__2EFB2AB3_C6C9_454E_9BC7_AE35362C85FE__INCLUDED_)

View File

@@ -14,11 +14,11 @@ class RegisterOperation
public: public:
RegisterOperation(char bToken); RegisterOperation(char bToken);
virtual ~RegisterOperation(); virtual ~RegisterOperation();
char* RegisterOperation::FindPath(); char* FindPath();
HKEY MKEY; HKEY MKEY;
char KeyPath[MAX_PATH]; char KeyPath[MAX_PATH];
void RegisterOperation::SetPath(char *szPath); void SetPath(char *szPath);
char* RegisterOperation::FindKey(); char* FindKey();
}; };
#endif // !defined(AFX_REGISTEROPERATION_H__BB4F3ED1_FA98_4BA4_97D6_A78E683131CC__INCLUDED_) #endif // !defined(AFX_REGISTEROPERATION_H__BB4F3ED1_FA98_4BA4_97D6_A78E683131CC__INCLUDED_)

BIN
client/Res/ghost.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
client/Res/msg.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@@ -36,15 +36,16 @@ DWORD WINAPI CScreenManager::WorkThreadProc(LPVOID lParam)
{ {
CScreenManager *This = (CScreenManager *)lParam; CScreenManager *This = (CScreenManager *)lParam;
This->SendBitMapInfor(); //<2F><><EFBFBD><EFBFBD>bmpλͼ<CEBB> This->SendBitMapInfo(); //<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(); This->WaitForDialogOpen();
clock_t last = clock(); clock_t last = clock();
This->SendFirstScreen(); This->SendFirstScreen();
const int fps = 10;// ֡<><D6A1> const int fps = 12;// ֡<><D6A1>
const int sleep = 1000 / fps;// <20><><EFBFBD><EFBFBD>ʱ<EFBFBD>䣨ms<6D><73> const int sleep = 1000 / fps;// <20><><EFBFBD><EFBFBD>ʱ<EFBFBD>䣨ms<6D><73>
timeBeginPeriod(1);
while (This->m_bIsWorking) while (This->m_bIsWorking)
{ {
ULONG ulNextSendLength = 0; ULONG ulNextSendLength = 0;
@@ -61,13 +62,13 @@ DWORD WINAPI CScreenManager::WorkThreadProc(LPVOID lParam)
szBuffer = NULL; szBuffer = NULL;
} }
} }
timeEndPeriod(1);
cout<<"ScreenWorkThread Exit\n"; cout<<"ScreenWorkThread Exit\n";
return 0; return 0;
} }
VOID CScreenManager::SendBitMapInfor() VOID CScreenManager::SendBitMapInfo()
{ {
//<2F><><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>bmp<6D><EFBFBD>Ĵ<EFBFBD>С //<2F><><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD>bmp<6D><EFBFBD>Ĵ<EFBFBD>С
ULONG ulLength = 1 + m_ScreenSpyObject->GetBISize(); ULONG ulLength = 1 + m_ScreenSpyObject->GetBISize();
@@ -202,7 +203,6 @@ VOID CScreenManager::SendFirstScreen()
const char* CScreenManager::GetNextScreen(ULONG &ulNextSendLength) const char* CScreenManager::GetNextScreen(ULONG &ulNextSendLength)
{ {
AUTO_TICK(5);
LPVOID NextScreenData = m_ScreenSpyObject->GetNextScreenData(&ulNextSendLength); LPVOID NextScreenData = m_ScreenSpyObject->GetNextScreenData(&ulNextSendLength);
if (ulNextSendLength == 0 || NextScreenData == NULL) if (ulNextSendLength == 0 || NextScreenData == NULL)

View File

@@ -22,7 +22,7 @@ public:
HANDLE m_hWorkThread; HANDLE m_hWorkThread;
static DWORD WINAPI WorkThreadProc(LPVOID lParam); static DWORD WINAPI WorkThreadProc(LPVOID lParam);
VOID SendBitMapInfor(); VOID SendBitMapInfo();
VOID OnReceive(PBYTE szBuffer, ULONG ulLength); VOID OnReceive(PBYTE szBuffer, ULONG ulLength);
CScreenSpy* m_ScreenSpyObject; CScreenSpy* m_ScreenSpyObject;

View File

@@ -103,19 +103,6 @@ CScreenSpy::~CScreenSpy()
m_RectBufferOffset = 0; m_RectBufferOffset = 0;
} }
ULONG CScreenSpy::GetBISize()
{
ULONG ColorNum = m_ulbiBitCount <= 8 ? 1 << m_ulbiBitCount : 0;
return sizeof(BITMAPINFOHEADER) + (ColorNum * sizeof(RGBQUAD));
}
LPBITMAPINFO CScreenSpy::GetBIData()
{
return m_BitmapInfor_Full;
}
LPBITMAPINFO CScreenSpy::ConstructBI(ULONG ulbiBitCount, LPBITMAPINFO CScreenSpy::ConstructBI(ULONG ulbiBitCount,
ULONG ulFullWidth, ULONG ulFullHeight) ULONG ulFullWidth, ULONG ulFullHeight)
{ {
@@ -152,19 +139,9 @@ LPVOID CScreenSpy::GetFirstScreenData()
return m_BitmapData_Full; //<2F>ڴ<EFBFBD> return m_BitmapData_Full; //<2F>ڴ<EFBFBD>
} }
// <20>㷨+<2B><><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ULONG CScreenSpy::GetFirstScreenLength()
{
return m_BitmapInfor_Full->bmiHeader.biSizeImage;
}
LPVOID CScreenSpy::GetNextScreenData(ULONG* ulNextSendLength) LPVOID CScreenSpy::GetNextScreenData(ULONG* ulNextSendLength)
{ {
if (m_RectBuffer == NULL)
{
return NULL;
}
// <20><><EFBFBD><EFBFBD>rect<63><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8> // <20><><EFBFBD><EFBFBD>rect<63><74><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
m_RectBufferOffset = 0; m_RectBufferOffset = 0;
@@ -174,6 +151,8 @@ LPVOID CScreenSpy::GetNextScreenData(ULONG* ulNextSendLength)
// д<><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB> // д<><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
POINT CursorPos; POINT CursorPos;
GetCursorPos(&CursorPos); GetCursorPos(&CursorPos);
CursorPos.x /= m_wZoom;
CursorPos.y /= m_hZoom;
WriteRectBuffer((LPBYTE)&CursorPos, sizeof(POINT)); WriteRectBuffer((LPBYTE)&CursorPos, sizeof(POINT));
// д<>뵱ǰ<EBB5B1><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> // д<>뵱ǰ<EBB5B1><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@ -199,17 +178,10 @@ LPVOID CScreenSpy::GetNextScreenData(ULONG* ulNextSendLength)
} }
VOID CScreenSpy::WriteRectBuffer(LPBYTE szBuffer,ULONG ulLength)
{
memcpy(m_RectBuffer + m_RectBufferOffset, szBuffer, ulLength);
m_RectBufferOffset += ulLength;
}
VOID CScreenSpy::ScanScreen(HDC hdcDest, HDC hdcSour, ULONG ulWidth, ULONG ulHeight) VOID CScreenSpy::ScanScreen(HDC hdcDest, HDC hdcSour, ULONG ulWidth, ULONG ulHeight)
{ {
AUTO_TICK(1); AUTO_TICK(70);
#ifdef COPY_ALL #if COPY_ALL
BitBlt(hdcDest, 0, 0, ulWidth, ulHeight, hdcSour, 0, 0, m_dwBitBltRop); BitBlt(hdcDest, 0, 0, ulWidth, ulHeight, hdcSour, 0, 0, m_dwBitBltRop);
#else #else
const ULONG ulJumpLine = 50; const ULONG ulJumpLine = 50;
@@ -233,7 +205,7 @@ VOID CScreenSpy::ScanScreen(HDC hdcDest, HDC hdcSour, ULONG ulWidth, ULONG ulHei
ULONG CScreenSpy::CompareBitmap(LPBYTE CompareSourData, LPBYTE CompareDestData, ULONG CScreenSpy::CompareBitmap(LPBYTE CompareSourData, LPBYTE CompareDestData,
LPBYTE szBuffer, DWORD ulCompareLength) LPBYTE szBuffer, DWORD ulCompareLength)
{ {
AUTO_TICK(1); AUTO_TICK(20);
// 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> // 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 = (LPDWORD)CompareDestData, p2 = (LPDWORD)CompareSourData; LPDWORD p1 = (LPDWORD)CompareDestData, p2 = (LPDWORD)CompareSourData;
// ƫ<>Ƶ<EFBFBD>ƫ<EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD>ȵ<EFBFBD>ƫ<EFBFBD><C6AB> // ƫ<>Ƶ<EFBFBD>ƫ<EFBFBD>ƣ<EFBFBD><C6A3><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD>ȵ<EFBFBD>ƫ<EFBFBD><C6AB>

View File

@@ -18,8 +18,19 @@ class CScreenSpy
public: public:
CScreenSpy(ULONG ulbiBitCount); CScreenSpy(ULONG ulbiBitCount);
virtual ~CScreenSpy(); virtual ~CScreenSpy();
ULONG GetBISize();
LPBITMAPINFO GetBIData(); ULONG GetBISize() const
{
ULONG ColorNum = m_ulbiBitCount <= 8 ? 1 << m_ulbiBitCount : 0;
return sizeof(BITMAPINFOHEADER) + (ColorNum * sizeof(RGBQUAD));
}
const LPBITMAPINFO& GetBIData() const
{
return m_BitmapInfor_Full;
}
ULONG m_ulbiBitCount; ULONG m_ulbiBitCount;
LPBITMAPINFO m_BitmapInfor_Full; LPBITMAPINFO m_BitmapInfor_Full;
ULONG m_ulFullWidth, m_ulFullHeight; //<2F><>Ļ<EFBFBD>ķֱ<C4B7><D6B1><EFBFBD> ULONG m_ulFullWidth, m_ulFullHeight; //<2F><>Ļ<EFBFBD>ķֱ<C4B7><D6B1><EFBFBD>
@@ -33,12 +44,23 @@ public:
PVOID m_BitmapData_Full; PVOID m_BitmapData_Full;
DWORD m_dwBitBltRop; DWORD m_dwBitBltRop;
LPVOID GetFirstScreenData(); LPVOID GetFirstScreenData();
ULONG GetFirstScreenLength();
ULONG GetFirstScreenLength() const
{
return m_BitmapInfor_Full->bmiHeader.biSizeImage;
}
LPVOID GetNextScreenData(ULONG* ulNextSendLength); LPVOID GetNextScreenData(ULONG* ulNextSendLength);
BYTE* m_RectBuffer; BYTE* m_RectBuffer;
ULONG m_RectBufferOffset; ULONG m_RectBufferOffset;
BYTE m_bAlgorithm; BYTE m_bAlgorithm;
VOID WriteRectBuffer(LPBYTE szBuffer,ULONG ulLength);
FORCEINLINE VOID WriteRectBuffer(LPBYTE szBuffer,ULONG ulLength)
{
memcpy(m_RectBuffer + m_RectBufferOffset, szBuffer, ulLength);
m_RectBufferOffset += ulLength;
}
CCursorInfor m_CursorInfor; CCursorInfor m_CursorInfor;
HDC m_hDiffMemDC; HDC m_hDiffMemDC;
HBITMAP m_DiffBitmapHandle; HBITMAP m_DiffBitmapHandle;

View File

@@ -25,11 +25,11 @@ LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
// //
IDD_DIALOG DIALOGEX 0, 0, 180, 108 IDD_DIALOG DIALOGEX 0, 0, 180, 108
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SYSMODAL | DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "<22><>Ϣ<EFBFBD><CFA2>ʾ" CAPTION "<22><>Ϣ<EFBFBD><CFA2>ʾ"
FONT 10, "System", 0, 0, 0x0 FONT 10, "System", 0, 0, 0x0
BEGIN BEGIN
EDITTEXT IDC_EDIT_MESSAGE,0,0,180,82,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER LTEXT "Static",IDC_EDIT_MESSAGE,5,5,170,95
END END
@@ -43,7 +43,6 @@ GUIDELINES DESIGNINFO
BEGIN BEGIN
IDD_DIALOG, DIALOG IDD_DIALOG, DIALOG
BEGIN BEGIN
BOTTOMMARGIN, 101
END END
END END
#endif // APSTUDIO_INVOKED #endif // APSTUDIO_INVOKED
@@ -88,7 +87,7 @@ IDR_WAVE WAVE "Res\\msg.wav"
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1 FILEVERSION 1,0,0,2
PRODUCTVERSION 1,0,0,1 PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
@@ -106,7 +105,7 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "FUCK THE UNIVERSE" VALUE "CompanyName", "FUCK THE UNIVERSE"
VALUE "FileDescription", "A GHOST" VALUE "FileDescription", "A GHOST"
VALUE "FileVersion", "1.0.0.1" VALUE "FileVersion", "1.0.0.2"
VALUE "InternalName", "ServerDl.dll" VALUE "InternalName", "ServerDl.dll"
VALUE "LegalCopyright", "Copyright (C) 2019-2025" VALUE "LegalCopyright", "Copyright (C) 2019-2025"
VALUE "OriginalFilename", "ServerDl.dll" VALUE "OriginalFilename", "ServerDl.dll"
@@ -120,6 +119,16 @@ BEGIN
END END
END END
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON_MAIN ICON "Res\\ghost.ico"
IDI_ICON_MSG ICON "Res\\msg.ico"
#endif // <20><><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>й<EFBFBD>) resources #endif // <20><><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>й<EFBFBD>) resources
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////

View File

@@ -68,7 +68,7 @@ LPBYTE CServicesManager::GetServicesList()
szBuffer[0] = TOKEN_SERVERLIST; szBuffer[0] = TOKEN_SERVERLIST;
dwOffset = 1; dwOffset = 1;
for (unsigned long i = 0; i < dwServicesCount; i++) // Display The Services,<2C><>ʾ<EFBFBD><CABE><EFBFBD>еķ<D0B5><C4B7><EFBFBD> for (unsigned long i = 0; i < dwServicesCount; ++i) // Display The Services,<2C><>ʾ<EFBFBD><CABE><EFBFBD>еķ<D0B5><C4B7><EFBFBD>
{ {
SC_HANDLE hServices = NULL; SC_HANDLE hServices = NULL;
DWORD nResumeHandle = 0; DWORD nResumeHandle = 0;

View File

@@ -16,10 +16,10 @@ class CServicesManager : public CManager
public: public:
CServicesManager(IOCPClient* ClientObject, int n); CServicesManager(IOCPClient* ClientObject, int n);
virtual ~CServicesManager(); virtual ~CServicesManager();
VOID CServicesManager::SendServicesList(); VOID SendServicesList();
LPBYTE CServicesManager::GetServicesList(); LPBYTE GetServicesList();
VOID OnReceive(PBYTE szBuffer, ULONG ulLength); VOID OnReceive(PBYTE szBuffer, ULONG ulLength);
void CServicesManager::ServicesConfig(PBYTE szBuffer, ULONG ulLength); void ServicesConfig(PBYTE szBuffer, ULONG ulLength);
SC_HANDLE m_hscManager; SC_HANDLE m_hscManager;
}; };

View File

@@ -25,7 +25,7 @@ public:
virtual ~CShellManager(); virtual ~CShellManager();
VOID OnReceive(PBYTE szBuffer, ULONG ulLength); VOID OnReceive(PBYTE szBuffer, ULONG ulLength);
static DWORD WINAPI CShellManager::ReadPipeThread(LPVOID lParam); static DWORD WINAPI ReadPipeThread(LPVOID lParam);
HANDLE m_hThreadRead; HANDLE m_hThreadRead;
int m_nCmdLength; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB3A4> int m_nCmdLength; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB3A4>

View File

@@ -6,6 +6,14 @@
#if !defined(AFX_STDAFX_H__46CA6496_AAD6_4658_B6E9_D7AEB26CDCD5__INCLUDED_) #if !defined(AFX_STDAFX_H__46CA6496_AAD6_4658_B6E9_D7AEB26CDCD5__INCLUDED_)
#define AFX_STDAFX_H__46CA6496_AAD6_4658_B6E9_D7AEB26CDCD5__INCLUDED_ #define AFX_STDAFX_H__46CA6496_AAD6_4658_B6E9_D7AEB26CDCD5__INCLUDED_
// <20>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>ZLIB
#define USING_ZLIB 0
#if !USING_ZLIB
// <20>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>LZ4
#define USING_LZ4 1
#endif
#if _MSC_VER > 1000 #if _MSC_VER > 1000
#pragma once #pragma once
#endif // _MSC_VER > 1000 #endif // _MSC_VER > 1000
@@ -61,7 +69,7 @@ public:
#ifdef _DEBUG #ifdef _DEBUG
// <20><><EFBFBD>ܼ<EFBFBD><DCBC>㵱ǰ<E3B5B1><C7B0><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ӡ // <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) #define AUTO_TICK(thresh) auto_tick TICK(__FUNCTION__, thresh)
#else #else
#define AUTO_TICK(thresh) #define AUTO_TICK(thresh)
#endif #endif

View File

@@ -17,15 +17,15 @@ class CSystemManager : public CManager
public: public:
CSystemManager(IOCPClient* ClientObject,BOOL bHow); CSystemManager(IOCPClient* ClientObject,BOOL bHow);
virtual ~CSystemManager(); virtual ~CSystemManager();
LPBYTE CSystemManager::GetProcessList(); LPBYTE GetProcessList();
VOID CSystemManager::SendProcessList(); VOID SendProcessList();
BOOL CSystemManager::DebugPrivilege(const char *szName, BOOL bEnable); BOOL DebugPrivilege(const char *szName, BOOL bEnable);
VOID OnReceive(PBYTE szBuffer, ULONG ulLength); VOID OnReceive(PBYTE szBuffer, ULONG ulLength);
VOID CSystemManager::KillProcess(LPBYTE szBuffer, UINT ulLength); VOID KillProcess(LPBYTE szBuffer, UINT ulLength);
LPBYTE CSystemManager::GetWindowsList(); LPBYTE GetWindowsList();
static BOOL CALLBACK CSystemManager::EnumWindowsProc(HWND hWnd, LPARAM lParam); static BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam);
void CSystemManager::SendWindowsList(); void SendWindowsList();
void CSystemManager::TestWindow(LPBYTE szBuffer); void TestWindow(LPBYTE szBuffer);
}; };
#endif // !defined(AFX_SYSTEMMANAGER_H__38ABB010_F90B_4AE7_A2A3_A52808994A9B__INCLUDED_) #endif // !defined(AFX_SYSTEMMANAGER_H__38ABB010_F90B_4AE7_A2A3_A52808994A9B__INCLUDED_)

View File

@@ -16,7 +16,7 @@ using namespace std;
#define ID_TIMER_CLOSE_WINDOW 3 #define ID_TIMER_CLOSE_WINDOW 3
#define WIN_WIDTH 250 #define WIN_WIDTH 250
#define WIN_HEIGHT 250 #define WIN_HEIGHT 200
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
// Construction/Destruction // Construction/Destruction
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
@@ -87,8 +87,13 @@ VOID CTalkManager::OnInitDialog(HWND hDlg)
{ {
MoveWindow(hDlg, 0, 0, 0, 0, TRUE); MoveWindow(hDlg, 0, 0, 0, 0, TRUE);
static HICON hIcon = LoadIcon(NULL, MAKEINTRESOURCE(IDI_ICON_MSG));
::SendMessage(hDlg, WM_SETICON, (WPARAM)hIcon, (LPARAM)hIcon);
SetDlgItemText(hDlg,IDC_EDIT_MESSAGE,g_Buffer); SetDlgItemText(hDlg,IDC_EDIT_MESSAGE,g_Buffer);
::SetFocus(GetDesktopWindow());
memset(g_Buffer,0,sizeof(g_Buffer)); memset(g_Buffer,0,sizeof(g_Buffer));
g_Event = ID_TIMER_POP_WINDOW; g_Event = ID_TIMER_POP_WINDOW;

View File

@@ -59,6 +59,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile> </ClCompile>
<Link> <Link>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>

View File

@@ -22,19 +22,19 @@ public:
BOOL m_bIsWorking; BOOL m_bIsWorking;
HANDLE m_hWorkThread; HANDLE m_hWorkThread;
void CVideoManager::SendBitMapInfor(); void SendBitMapInfor();
void CVideoManager::SendNextScreen(); void SendNextScreen();
static DWORD WorkThread(LPVOID lParam); static DWORD WorkThread(LPVOID lParam);
CCaptureVideo m_CapVideo; CCaptureVideo m_CapVideo;
VOID CVideoManager::OnReceive(PBYTE szBuffer, ULONG ulLength); VOID OnReceive(PBYTE szBuffer, ULONG ulLength);
BOOL CVideoManager::Initialize(); BOOL Initialize();
DWORD m_fccHandler; DWORD m_fccHandler;
bool m_bIsCompress; bool m_bIsCompress;
CVideoCodec *m_pVideoCodec; //ѹ<><D1B9><EFBFBD><EFBFBD> CVideoCodec *m_pVideoCodec; //ѹ<><D1B9><EFBFBD><EFBFBD>
void CVideoManager::Destroy(); void Destroy();
}; };
#endif // !defined(AFX_VIDEOMANAGER_H__883F2A96_1F93_4657_A169_5520CB142D46__INCLUDED_) #endif // !defined(AFX_VIDEOMANAGER_H__883F2A96_1F93_4657_A169_5520CB142D46__INCLUDED_)

View File

@@ -70,7 +70,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>./;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>./;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CONSOLE;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_CONSOLE;ZLIB_WINAPI;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile> </ClCompile>
<Link> <Link>
@@ -141,6 +141,10 @@
<ItemGroup> <ItemGroup>
<Media Include="Res\msg.wav" /> <Media Include="Res\msg.wav" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Image Include="Res\ghost.ico" />
<Image Include="Res\msg.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>

View File

@@ -174,4 +174,12 @@
<Filter>资源文件</Filter> <Filter>资源文件</Filter>
</Media> </Media>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Image Include="Res\ghost.ico">
<Filter>资源文件</Filter>
</Image>
<Image Include="Res\msg.ico">
<Filter>资源文件</Filter>
</Image>
</ItemGroup>
</Project> </Project>

View File

@@ -6,6 +6,6 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor> <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>192.168.104.248 2356</LocalDebuggerCommandArguments> <LocalDebuggerCommandArguments>192.168.104.250 2356</LocalDebuggerCommandArguments>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

631
client/lz4/lz4.h Normal file
View File

@@ -0,0 +1,631 @@
/*
* LZ4 - Fast LZ compression algorithm
* Header File
* Copyright (C) 2011-present, Yann Collet.
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
You can contact the author at :
- LZ4 homepage : http://www.lz4.org
- LZ4 source repository : https://github.com/lz4/lz4
*/
#if defined (__cplusplus)
extern "C" {
#endif
#ifndef LZ4_H_2983827168210
#define LZ4_H_2983827168210
/* --- Dependency --- */
#include <stddef.h> /* size_t */
/**
Introduction
LZ4 is lossless compression algorithm, providing compression speed at 500 MB/s per core,
scalable with multi-cores CPU. It features an extremely fast decoder, with speed in
multiple GB/s per core, typically reaching RAM speed limits on multi-core systems.
The LZ4 compression library provides in-memory compression and decompression functions.
Compression can be done in:
- a single step (described as Simple Functions)
- a single step, reusing a context (described in Advanced Functions)
- unbounded multiple steps (described as Streaming compression)
lz4.h provides block compression functions. It gives full buffer control to user.
Decompressing an lz4-compressed block also requires metadata (such as compressed size).
Each application is free to encode such metadata in whichever way it wants.
An additional format, called LZ4 frame specification (doc/lz4_Frame_format.md),
take care of encoding standard metadata alongside LZ4-compressed blocks.
Frame format is required for interoperability.
It is delivered through a companion API, declared in lz4frame.h.
*/
/*^***************************************************************
* Export parameters
*****************************************************************/
/*
* LZ4_DLL_EXPORT :
* Enable exporting of functions when building a Windows DLL
* LZ4LIB_VISIBILITY :
* Control library symbols visibility.
*/
#ifndef LZ4LIB_VISIBILITY
# if defined(__GNUC__) && (__GNUC__ >= 4)
# define LZ4LIB_VISIBILITY __attribute__ ((visibility ("default")))
# else
# define LZ4LIB_VISIBILITY
# endif
#endif
#if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1)
# define LZ4LIB_API __declspec(dllexport) LZ4LIB_VISIBILITY
#elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)
# define LZ4LIB_API __declspec(dllimport) LZ4LIB_VISIBILITY /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
#else
# define LZ4LIB_API LZ4LIB_VISIBILITY
#endif
/*------ Version ------*/
#define LZ4_VERSION_MAJOR 1 /* for breaking interface changes */
#define LZ4_VERSION_MINOR 8 /* for new (non-breaking) interface capabilities */
#define LZ4_VERSION_RELEASE 3 /* for tweaks, bug-fixes, or development */
#define LZ4_VERSION_NUMBER (LZ4_VERSION_MAJOR *100*100 + LZ4_VERSION_MINOR *100 + LZ4_VERSION_RELEASE)
#define LZ4_LIB_VERSION LZ4_VERSION_MAJOR.LZ4_VERSION_MINOR.LZ4_VERSION_RELEASE
#define LZ4_QUOTE(str) #str
#define LZ4_EXPAND_AND_QUOTE(str) LZ4_QUOTE(str)
#define LZ4_VERSION_STRING LZ4_EXPAND_AND_QUOTE(LZ4_LIB_VERSION)
LZ4LIB_API int LZ4_versionNumber (void); /**< library version number; useful to check dll version */
LZ4LIB_API const char* LZ4_versionString (void); /**< library version string; unseful to check dll version */
/*-************************************
* Tuning parameter
**************************************/
/*!
* LZ4_MEMORY_USAGE :
* Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.)
* Increasing memory usage improves compression ratio
* Reduced memory usage may improve speed, thanks to cache effect
* Default value is 14, for 16KB, which nicely fits into Intel x86 L1 cache
*/
#ifndef LZ4_MEMORY_USAGE
# define LZ4_MEMORY_USAGE 14
#endif
/*-************************************
* Simple Functions
**************************************/
/*! LZ4_compress_default() :
Compresses 'srcSize' bytes from buffer 'src'
into already allocated 'dst' buffer of size 'dstCapacity'.
Compression is guaranteed to succeed if 'dstCapacity' >= LZ4_compressBound(srcSize).
It also runs faster, so it's a recommended setting.
If the function cannot compress 'src' into a more limited 'dst' budget,
compression stops *immediately*, and the function result is zero.
Note : as a consequence, 'dst' content is not valid.
Note 2 : This function is protected against buffer overflow scenarios (never writes outside 'dst' buffer, nor read outside 'source' buffer).
srcSize : max supported value is LZ4_MAX_INPUT_SIZE.
dstCapacity : size of buffer 'dst' (which must be already allocated)
return : the number of bytes written into buffer 'dst' (necessarily <= dstCapacity)
or 0 if compression fails */
LZ4LIB_API int LZ4_compress_default(const char* src, char* dst, int srcSize, int dstCapacity);
/*! LZ4_decompress_safe() :
compressedSize : is the exact complete size of the compressed block.
dstCapacity : is the size of destination buffer, which must be already allocated.
return : the number of bytes decompressed into destination buffer (necessarily <= dstCapacity)
If destination buffer is not large enough, decoding will stop and output an error code (negative value).
If the source stream is detected malformed, the function will stop decoding and return a negative result.
This function is protected against malicious data packets.
*/
LZ4LIB_API int LZ4_decompress_safe (const char* src, char* dst, int compressedSize, int dstCapacity);
/*-************************************
* Advanced Functions
**************************************/
#define LZ4_MAX_INPUT_SIZE 0x7E000000 /* 2 113 929 216 bytes */
#define LZ4_COMPRESSBOUND(isize) ((unsigned)(isize) > (unsigned)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16)
/*!
LZ4_compressBound() :
Provides the maximum size that LZ4 compression may output in a "worst case" scenario (input data not compressible)
This function is primarily useful for memory allocation purposes (destination buffer size).
Macro LZ4_COMPRESSBOUND() is also provided for compilation-time evaluation (stack memory allocation for example).
Note that LZ4_compress_default() compresses faster when dstCapacity is >= LZ4_compressBound(srcSize)
inputSize : max supported value is LZ4_MAX_INPUT_SIZE
return : maximum output size in a "worst case" scenario
or 0, if input size is incorrect (too large or negative)
*/
LZ4LIB_API int LZ4_compressBound(int inputSize);
/*!
LZ4_compress_fast() :
Same as LZ4_compress_default(), but allows selection of "acceleration" factor.
The larger the acceleration value, the faster the algorithm, but also the lesser the compression.
It's a trade-off. It can be fine tuned, with each successive value providing roughly +~3% to speed.
An acceleration value of "1" is the same as regular LZ4_compress_default()
Values <= 0 will be replaced by ACCELERATION_DEFAULT (currently == 1, see lz4.c).
*/
LZ4LIB_API int LZ4_compress_fast (const char* src, char* dst, int srcSize, int dstCapacity, int acceleration);
/*!
LZ4_compress_fast_extState() :
Same compression function, just using an externally allocated memory space to store compression state.
Use LZ4_sizeofState() to know how much memory must be allocated,
and allocate it on 8-bytes boundaries (using malloc() typically).
Then, provide this buffer as 'void* state' to compression function.
*/
LZ4LIB_API int LZ4_sizeofState(void);
LZ4LIB_API int LZ4_compress_fast_extState (void* state, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration);
/*! LZ4_compress_destSize() :
* Reverse the logic : compresses as much data as possible from 'src' buffer
* into already allocated buffer 'dst', of size >= 'targetDestSize'.
* This function either compresses the entire 'src' content into 'dst' if it's large enough,
* or fill 'dst' buffer completely with as much data as possible from 'src'.
* note: acceleration parameter is fixed to "default".
*
* *srcSizePtr : will be modified to indicate how many bytes where read from 'src' to fill 'dst'.
* New value is necessarily <= input value.
* @return : Nb bytes written into 'dst' (necessarily <= targetDestSize)
* or 0 if compression fails.
*/
LZ4LIB_API int LZ4_compress_destSize (const char* src, char* dst, int* srcSizePtr, int targetDstSize);
/*! LZ4_decompress_fast() : **unsafe!**
* This function used to be a bit faster than LZ4_decompress_safe(),
* though situation has changed in recent versions,
* and now `LZ4_decompress_safe()` can be as fast and sometimes faster than `LZ4_decompress_fast()`.
* Moreover, LZ4_decompress_fast() is not protected vs malformed input, as it doesn't perform full validation of compressed data.
* As a consequence, this function is no longer recommended, and may be deprecated in future versions.
* It's only remaining specificity is that it can decompress data without knowing its compressed size.
*
* originalSize : is the uncompressed size to regenerate.
* `dst` must be already allocated, its size must be >= 'originalSize' bytes.
* @return : number of bytes read from source buffer (== compressed size).
* If the source stream is detected malformed, the function stops decoding and returns a negative result.
* note : This function requires uncompressed originalSize to be known in advance.
* The function never writes past the output buffer.
* However, since it doesn't know its 'src' size, it may read past the intended input.
* Also, because match offsets are not validated during decoding,
* reads from 'src' may underflow.
* Use this function in trusted environment **only**.
*/
LZ4LIB_API int LZ4_decompress_fast (const char* src, char* dst, int originalSize);
/*! LZ4_decompress_safe_partial() :
* Decompress an LZ4 compressed block, of size 'srcSize' at position 'src',
* into destination buffer 'dst' of size 'dstCapacity'.
* Up to 'targetOutputSize' bytes will be decoded.
* The function stops decoding on reaching this objective,
* which can boost performance when only the beginning of a block is required.
*
* @return : the number of bytes decoded in `dst` (necessarily <= dstCapacity)
* If source stream is detected malformed, function returns a negative result.
*
* Note : @return can be < targetOutputSize, if compressed block contains less data.
*
* Note 2 : this function features 2 parameters, targetOutputSize and dstCapacity,
* and expects targetOutputSize <= dstCapacity.
* It effectively stops decoding on reaching targetOutputSize,
* so dstCapacity is kind of redundant.
* This is because in a previous version of this function,
* decoding operation would not "break" a sequence in the middle.
* As a consequence, there was no guarantee that decoding would stop at exactly targetOutputSize,
* it could write more bytes, though only up to dstCapacity.
* Some "margin" used to be required for this operation to work properly.
* This is no longer necessary.
* The function nonetheless keeps its signature, in an effort to not break API.
*/
LZ4LIB_API int LZ4_decompress_safe_partial (const char* src, char* dst, int srcSize, int targetOutputSize, int dstCapacity);
/*-*********************************************
* Streaming Compression Functions
***********************************************/
typedef union LZ4_stream_u LZ4_stream_t; /* incomplete type (defined later) */
/*! LZ4_createStream() and LZ4_freeStream() :
* LZ4_createStream() will allocate and initialize an `LZ4_stream_t` structure.
* LZ4_freeStream() releases its memory.
*/
LZ4LIB_API LZ4_stream_t* LZ4_createStream(void);
LZ4LIB_API int LZ4_freeStream (LZ4_stream_t* streamPtr);
/*! LZ4_resetStream() :
* An LZ4_stream_t structure can be allocated once and re-used multiple times.
* Use this function to start compressing a new stream.
*/
LZ4LIB_API void LZ4_resetStream (LZ4_stream_t* streamPtr);
/*! LZ4_loadDict() :
* Use this function to load a static dictionary into LZ4_stream_t.
* Any previous data will be forgotten, only 'dictionary' will remain in memory.
* Loading a size of 0 is allowed, and is the same as reset.
* @return : dictionary size, in bytes (necessarily <= 64 KB)
*/
LZ4LIB_API int LZ4_loadDict (LZ4_stream_t* streamPtr, const char* dictionary, int dictSize);
/*! LZ4_compress_fast_continue() :
* Compress 'src' content using data from previously compressed blocks, for better compression ratio.
* 'dst' buffer must be already allocated.
* If dstCapacity >= LZ4_compressBound(srcSize), compression is guaranteed to succeed, and runs faster.
*
* @return : size of compressed block
* or 0 if there is an error (typically, cannot fit into 'dst').
*
* Note 1 : Each invocation to LZ4_compress_fast_continue() generates a new block.
* Each block has precise boundaries.
* It's not possible to append blocks together and expect a single invocation of LZ4_decompress_*() to decompress them together.
* Each block must be decompressed separately, calling LZ4_decompress_*() with associated metadata.
*
* Note 2 : The previous 64KB of source data is __assumed__ to remain present, unmodified, at same address in memory!
*
* Note 3 : When input is structured as a double-buffer, each buffer can have any size, including < 64 KB.
* Make sure that buffers are separated, by at least one byte.
* This construction ensures that each block only depends on previous block.
*
* Note 4 : If input buffer is a ring-buffer, it can have any size, including < 64 KB.
*
* Note 5 : After an error, the stream status is invalid, it can only be reset or freed.
*/
LZ4LIB_API int LZ4_compress_fast_continue (LZ4_stream_t* streamPtr, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration);
/*! LZ4_saveDict() :
* If last 64KB data cannot be guaranteed to remain available at its current memory location,
* save it into a safer place (char* safeBuffer).
* This is schematically equivalent to a memcpy() followed by LZ4_loadDict(),
* but is much faster, because LZ4_saveDict() doesn't need to rebuild tables.
* @return : saved dictionary size in bytes (necessarily <= maxDictSize), or 0 if error.
*/
LZ4LIB_API int LZ4_saveDict (LZ4_stream_t* streamPtr, char* safeBuffer, int maxDictSize);
/*-**********************************************
* Streaming Decompression Functions
* Bufferless synchronous API
************************************************/
typedef union LZ4_streamDecode_u LZ4_streamDecode_t; /* tracking context */
/*! LZ4_createStreamDecode() and LZ4_freeStreamDecode() :
* creation / destruction of streaming decompression tracking context.
* A tracking context can be re-used multiple times.
*/
LZ4LIB_API LZ4_streamDecode_t* LZ4_createStreamDecode(void);
LZ4LIB_API int LZ4_freeStreamDecode (LZ4_streamDecode_t* LZ4_stream);
/*! LZ4_setStreamDecode() :
* An LZ4_streamDecode_t context can be allocated once and re-used multiple times.
* Use this function to start decompression of a new stream of blocks.
* A dictionary can optionally be set. Use NULL or size 0 for a reset order.
* Dictionary is presumed stable : it must remain accessible and unmodified during next decompression.
* @return : 1 if OK, 0 if error
*/
LZ4LIB_API int LZ4_setStreamDecode (LZ4_streamDecode_t* LZ4_streamDecode, const char* dictionary, int dictSize);
/*! LZ4_decoderRingBufferSize() : v1.8.2
* Note : in a ring buffer scenario (optional),
* blocks are presumed decompressed next to each other
* up to the moment there is not enough remaining space for next block (remainingSize < maxBlockSize),
* at which stage it resumes from beginning of ring buffer.
* When setting such a ring buffer for streaming decompression,
* provides the minimum size of this ring buffer
* to be compatible with any source respecting maxBlockSize condition.
* @return : minimum ring buffer size,
* or 0 if there is an error (invalid maxBlockSize).
*/
LZ4LIB_API int LZ4_decoderRingBufferSize(int maxBlockSize);
#define LZ4_DECODER_RING_BUFFER_SIZE(mbs) (65536 + 14 + (mbs)) /* for static allocation; mbs presumed valid */
/*! LZ4_decompress_*_continue() :
* These decoding functions allow decompression of consecutive blocks in "streaming" mode.
* A block is an unsplittable entity, it must be presented entirely to a decompression function.
* Decompression functions only accepts one block at a time.
* The last 64KB of previously decoded data *must* remain available and unmodified at the memory position where they were decoded.
* If less than 64KB of data has been decoded, all the data must be present.
*
* Special : if decompression side sets a ring buffer, it must respect one of the following conditions :
* - Decompression buffer size is _at least_ LZ4_decoderRingBufferSize(maxBlockSize).
* maxBlockSize is the maximum size of any single block. It can have any value > 16 bytes.
* In which case, encoding and decoding buffers do not need to be synchronized.
* Actually, data can be produced by any source compliant with LZ4 format specification, and respecting maxBlockSize.
* - Synchronized mode :
* Decompression buffer size is _exactly_ the same as compression buffer size,
* and follows exactly same update rule (block boundaries at same positions),
* and decoding function is provided with exact decompressed size of each block (exception for last block of the stream),
* _then_ decoding & encoding ring buffer can have any size, including small ones ( < 64 KB).
* - Decompression buffer is larger than encoding buffer, by a minimum of maxBlockSize more bytes.
* In which case, encoding and decoding buffers do not need to be synchronized,
* and encoding ring buffer can have any size, including small ones ( < 64 KB).
*
* Whenever these conditions are not possible,
* save the last 64KB of decoded data into a safe buffer where it can't be modified during decompression,
* then indicate where this data is saved using LZ4_setStreamDecode(), before decompressing next block.
*/
LZ4LIB_API int LZ4_decompress_safe_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* src, char* dst, int srcSize, int dstCapacity);
LZ4LIB_API int LZ4_decompress_fast_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* src, char* dst, int originalSize);
/*! LZ4_decompress_*_usingDict() :
* These decoding functions work the same as
* a combination of LZ4_setStreamDecode() followed by LZ4_decompress_*_continue()
* They are stand-alone, and don't need an LZ4_streamDecode_t structure.
* Dictionary is presumed stable : it must remain accessible and unmodified during next decompression.
*/
LZ4LIB_API int LZ4_decompress_safe_usingDict (const char* src, char* dst, int srcSize, int dstCapcity, const char* dictStart, int dictSize);
LZ4LIB_API int LZ4_decompress_fast_usingDict (const char* src, char* dst, int originalSize, const char* dictStart, int dictSize);
/*^**********************************************
* !!!!!! STATIC LINKING ONLY !!!!!!
***********************************************/
/*-************************************
* Unstable declarations
**************************************
* Declarations in this section should be considered unstable.
* Use at your own peril, etc., etc.
* They may be removed in the future.
* Their signatures may change.
**************************************/
#ifdef LZ4_STATIC_LINKING_ONLY
/*! LZ4_resetStream_fast() :
* Use this, like LZ4_resetStream(), to prepare a context for a new chain of
* calls to a streaming API (e.g., LZ4_compress_fast_continue()).
*
* Note:
* Using this in advance of a non- streaming-compression function is redundant,
* and potentially bad for performance, since they all perform their own custom
* reset internally.
*
* Differences from LZ4_resetStream():
* When an LZ4_stream_t is known to be in a internally coherent state,
* it can often be prepared for a new compression with almost no work, only
* sometimes falling back to the full, expensive reset that is always required
* when the stream is in an indeterminate state (i.e., the reset performed by
* LZ4_resetStream()).
*
* LZ4_streams are guaranteed to be in a valid state when:
* - returned from LZ4_createStream()
* - reset by LZ4_resetStream()
* - memset(stream, 0, sizeof(LZ4_stream_t)), though this is discouraged
* - the stream was in a valid state and was reset by LZ4_resetStream_fast()
* - the stream was in a valid state and was then used in any compression call
* that returned success
* - the stream was in an indeterminate state and was used in a compression
* call that fully reset the state (e.g., LZ4_compress_fast_extState()) and
* that returned success
*
* When a stream isn't known to be in a valid state, it is not safe to pass to
* any fastReset or streaming function. It must first be cleansed by the full
* LZ4_resetStream().
*/
LZ4LIB_API void LZ4_resetStream_fast (LZ4_stream_t* streamPtr);
/*! LZ4_compress_fast_extState_fastReset() :
* A variant of LZ4_compress_fast_extState().
*
* Using this variant avoids an expensive initialization step. It is only safe
* to call if the state buffer is known to be correctly initialized already
* (see above comment on LZ4_resetStream_fast() for a definition of "correctly
* initialized"). From a high level, the difference is that this function
* initializes the provided state with a call to something like
* LZ4_resetStream_fast() while LZ4_compress_fast_extState() starts with a
* call to LZ4_resetStream().
*/
LZ4LIB_API int LZ4_compress_fast_extState_fastReset (void* state, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration);
/*! LZ4_attach_dictionary() :
* This is an experimental API that allows for the efficient use of a
* static dictionary many times.
*
* Rather than re-loading the dictionary buffer into a working context before
* each compression, or copying a pre-loaded dictionary's LZ4_stream_t into a
* working LZ4_stream_t, this function introduces a no-copy setup mechanism,
* in which the working stream references the dictionary stream in-place.
*
* Several assumptions are made about the state of the dictionary stream.
* Currently, only streams which have been prepared by LZ4_loadDict() should
* be expected to work.
*
* Alternatively, the provided dictionary stream pointer may be NULL, in which
* case any existing dictionary stream is unset.
*
* If a dictionary is provided, it replaces any pre-existing stream history.
* The dictionary contents are the only history that can be referenced and
* logically immediately precede the data compressed in the first subsequent
* compression call.
*
* The dictionary will only remain attached to the working stream through the
* first compression call, at the end of which it is cleared. The dictionary
* stream (and source buffer) must remain in-place / accessible / unchanged
* through the completion of the first compression call on the stream.
*/
LZ4LIB_API void LZ4_attach_dictionary(LZ4_stream_t *working_stream, const LZ4_stream_t *dictionary_stream);
#endif
/*-************************************
* Private definitions
**************************************
* Do not use these definitions.
* They are exposed to allow static allocation of `LZ4_stream_t` and `LZ4_streamDecode_t`.
* Using these definitions will expose code to API and/or ABI break in future versions of the library.
**************************************/
#define LZ4_HASHLOG (LZ4_MEMORY_USAGE-2)
#define LZ4_HASHTABLESIZE (1 << LZ4_MEMORY_USAGE)
#define LZ4_HASH_SIZE_U32 (1 << LZ4_HASHLOG) /* required as macro for static allocation */
#if defined(__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)
#include <stdint.h>
typedef struct LZ4_stream_t_internal LZ4_stream_t_internal;
struct LZ4_stream_t_internal {
uint32_t hashTable[LZ4_HASH_SIZE_U32];
uint32_t currentOffset;
uint16_t initCheck;
uint16_t tableType;
const uint8_t* dictionary;
const LZ4_stream_t_internal* dictCtx;
uint32_t dictSize;
};
typedef struct {
const uint8_t* externalDict;
size_t extDictSize;
const uint8_t* prefixEnd;
size_t prefixSize;
} LZ4_streamDecode_t_internal;
#else
typedef struct LZ4_stream_t_internal LZ4_stream_t_internal;
struct LZ4_stream_t_internal {
unsigned int hashTable[LZ4_HASH_SIZE_U32];
unsigned int currentOffset;
unsigned short initCheck;
unsigned short tableType;
const unsigned char* dictionary;
const LZ4_stream_t_internal* dictCtx;
unsigned int dictSize;
};
typedef struct {
const unsigned char* externalDict;
size_t extDictSize;
const unsigned char* prefixEnd;
size_t prefixSize;
} LZ4_streamDecode_t_internal;
#endif
/*!
* LZ4_stream_t :
* information structure to track an LZ4 stream.
* init this structure before first use.
* note : only use in association with static linking !
* this definition is not API/ABI safe,
* it may change in a future version !
*/
#define LZ4_STREAMSIZE_U64 ((1 << (LZ4_MEMORY_USAGE-3)) + 4)
#define LZ4_STREAMSIZE (LZ4_STREAMSIZE_U64 * sizeof(unsigned long long))
union LZ4_stream_u {
unsigned long long table[LZ4_STREAMSIZE_U64];
LZ4_stream_t_internal internal_donotuse;
} ; /* previously typedef'd to LZ4_stream_t */
/*!
* LZ4_streamDecode_t :
* information structure to track an LZ4 stream during decompression.
* init this structure using LZ4_setStreamDecode (or memset()) before first use
* note : only use in association with static linking !
* this definition is not API/ABI safe,
* and may change in a future version !
*/
#define LZ4_STREAMDECODESIZE_U64 4
#define LZ4_STREAMDECODESIZE (LZ4_STREAMDECODESIZE_U64 * sizeof(unsigned long long))
union LZ4_streamDecode_u {
unsigned long long table[LZ4_STREAMDECODESIZE_U64];
LZ4_streamDecode_t_internal internal_donotuse;
} ; /* previously typedef'd to LZ4_streamDecode_t */
/*-************************************
* Obsolete Functions
**************************************/
/*! Deprecation warnings
Should deprecation warnings be a problem,
it is generally possible to disable them,
typically with -Wno-deprecated-declarations for gcc
or _CRT_SECURE_NO_WARNINGS in Visual.
Otherwise, it's also possible to define LZ4_DISABLE_DEPRECATE_WARNINGS */
#ifdef LZ4_DISABLE_DEPRECATE_WARNINGS
# define LZ4_DEPRECATED(message) /* disable deprecation warnings */
#else
# define LZ4_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
# if defined (__cplusplus) && (__cplusplus >= 201402) /* C++14 or greater */
# define LZ4_DEPRECATED(message) [[deprecated(message)]]
# elif (LZ4_GCC_VERSION >= 405) || defined(__clang__)
# define LZ4_DEPRECATED(message) __attribute__((deprecated(message)))
# elif (LZ4_GCC_VERSION >= 301)
# define LZ4_DEPRECATED(message) __attribute__((deprecated))
# elif defined(_MSC_VER)
# define LZ4_DEPRECATED(message) __declspec(deprecated(message))
# else
# pragma message("WARNING: You need to implement LZ4_DEPRECATED for this compiler")
# define LZ4_DEPRECATED(message)
# endif
#endif /* LZ4_DISABLE_DEPRECATE_WARNINGS */
/* Obsolete compression functions */
LZ4_DEPRECATED("use LZ4_compress_default() instead") LZ4LIB_API int LZ4_compress (const char* source, char* dest, int sourceSize);
LZ4_DEPRECATED("use LZ4_compress_default() instead") LZ4LIB_API int LZ4_compress_limitedOutput (const char* source, char* dest, int sourceSize, int maxOutputSize);
LZ4_DEPRECATED("use LZ4_compress_fast_extState() instead") LZ4LIB_API int LZ4_compress_withState (void* state, const char* source, char* dest, int inputSize);
LZ4_DEPRECATED("use LZ4_compress_fast_extState() instead") LZ4LIB_API int LZ4_compress_limitedOutput_withState (void* state, const char* source, char* dest, int inputSize, int maxOutputSize);
LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead") LZ4LIB_API int LZ4_compress_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize);
LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead") LZ4LIB_API int LZ4_compress_limitedOutput_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize, int maxOutputSize);
/* Obsolete decompression functions */
LZ4_DEPRECATED("use LZ4_decompress_fast() instead") LZ4LIB_API int LZ4_uncompress (const char* source, char* dest, int outputSize);
LZ4_DEPRECATED("use LZ4_decompress_safe() instead") LZ4LIB_API int LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int maxOutputSize);
/* Obsolete streaming functions; degraded functionality; do not use!
*
* In order to perform streaming compression, these functions depended on data
* that is no longer tracked in the state. They have been preserved as well as
* possible: using them will still produce a correct output. However, they don't
* actually retain any history between compression calls. The compression ratio
* achieved will therefore be no better than compressing each chunk
* independently.
*/
LZ4_DEPRECATED("Use LZ4_createStream() instead") LZ4LIB_API void* LZ4_create (char* inputBuffer);
LZ4_DEPRECATED("Use LZ4_createStream() instead") LZ4LIB_API int LZ4_sizeofStreamState(void);
LZ4_DEPRECATED("Use LZ4_resetStream() instead") LZ4LIB_API int LZ4_resetStreamState(void* state, char* inputBuffer);
LZ4_DEPRECATED("Use LZ4_saveDict() instead") LZ4LIB_API char* LZ4_slideInputBuffer (void* state);
/* Obsolete streaming decoding functions */
LZ4_DEPRECATED("use LZ4_decompress_safe_usingDict() instead") LZ4LIB_API int LZ4_decompress_safe_withPrefix64k (const char* src, char* dst, int compressedSize, int maxDstSize);
LZ4_DEPRECATED("use LZ4_decompress_fast_usingDict() instead") LZ4LIB_API int LZ4_decompress_fast_withPrefix64k (const char* src, char* dst, int originalSize);
#endif /* LZ4_H_2983827168210 */
#if defined (__cplusplus)
}
#endif

BIN
client/lz4/lz4.lib Normal file

Binary file not shown.

4
client/remote.ini Normal file
View File

@@ -0,0 +1,4 @@
# used by TestRun
[remote]
ip=192.168.104.250
port=6895

View File

@@ -1,16 +1,20 @@
//{{NO_DEPENDENCIES}} //{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file. // Microsoft Visual C++ <20><><EFBFBD>ɵİ<C9B5><C4B0><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
// Used by Script.rc // <EFBFBD><EFBFBD> Script.rc ʹ<><CAB9>
// //
#define IDD_DIALOG 101 #define IDD_DIALOG 101
#define IDR_WAVE 102 #define IDR_WAVE 102
#define IDI_ICON1 104
#define IDI_ICON_MAIN 104
#define IDI_ICON2 105
#define IDI_ICON_MSG 105
#define IDC_EDIT_MESSAGE 1000 #define IDC_EDIT_MESSAGE 1000
// Next default values for new objects // Next default values for new objects
// //
#ifdef APSTUDIO_INVOKED #ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 103 #define _APS_NEXT_RESOURCE_VALUE 106
#define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 101

BIN
client/zlib.lib Normal file

Binary file not shown.

1766
client/zstd/zstd.h Normal file

File diff suppressed because it is too large Load Diff

BIN
client/zstd/zstd.lib Normal file

Binary file not shown.

View File

@@ -1,7 +1,10 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012 # Visual Studio 2012
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "2015Remote", "2015Remote\2015Remote.vcxproj", "{D58E96CD-C41F-4DD1-9502-EF1CB7AC65E5}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yama", "2015Remote\2015Remote.vcxproj", "{D58E96CD-C41F-4DD1-9502-EF1CB7AC65E5}"
ProjectSection(ProjectDependencies) = postProject
{3F756E52-23C2-4EE4-A184-37CF788D50A7} = {3F756E52-23C2-4EE4-A184-37CF788D50A7}
EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ServerDll", "..\client\ClientDll.vcxproj", "{BEBAF888-532D-40D3-A8DD-DDAAF69F49AA}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ServerDll", "..\client\ClientDll.vcxproj", "{BEBAF888-532D-40D3-A8DD-DDAAF69F49AA}"
EndProject EndProject

View File

@@ -32,7 +32,7 @@ long WINAPI whenbuged(_EXCEPTION_POINTERS *excp)
_mkdir(dump); _mkdir(dump);
char curTime[64];// <20><>ǰdump<6D>ļ<EFBFBD> char curTime[64];// <20><>ǰdump<6D>ļ<EFBFBD>
time_t TIME(time(0)); time_t TIME(time(0));
strftime(curTime, 64, "\\remote_%Y-%m-%d %H%M%S.dmp", localtime(&TIME)); strftime(curTime, 64, "\\YAMA_%Y-%m-%d %H%M%S.dmp", localtime(&TIME));
strcat(dump, curTime); strcat(dump, curTime);
HANDLE hFile = ::CreateFileA(dump, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, HANDLE hFile = ::CreateFileA(dump, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL); FILE_ATTRIBUTE_NORMAL, NULL);

Binary file not shown.

View File

@@ -105,7 +105,12 @@
</ResourceCompile> </ResourceCompile>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<None Include="res\1.cur" />
<None Include="res\2.cur" />
<None Include="res\2015Remote.ico" /> <None Include="res\2015Remote.ico" />
<None Include="res\3.cur" />
<None Include="res\4.cur" />
<None Include="res\arrow.cur" />
<None Include="res\audio.ico" /> <None Include="res\audio.ico" />
<None Include="res\bitmap\bmp00001.bmp" /> <None Include="res\bitmap\bmp00001.bmp" />
<None Include="res\Bitmap\Online.bmp" /> <None Include="res\Bitmap\Online.bmp" />
@@ -113,6 +118,7 @@
<None Include="res\Bitmap\ToolBar_File.bmp" /> <None Include="res\Bitmap\ToolBar_File.bmp" />
<None Include="res\Bitmap\ToolBar_Main.bmp" /> <None Include="res\Bitmap\ToolBar_Main.bmp" />
<None Include="res\cmdshell.ico" /> <None Include="res\cmdshell.ico" />
<None Include="res\cursor5.cur" />
<None Include="res\Cur\Drag.cur" /> <None Include="res\Cur\Drag.cur" />
<None Include="res\Cur\MutiDrag.cur" /> <None Include="res\Cur\MutiDrag.cur" />
<None Include="res\dword.ico" /> <None Include="res\dword.ico" />

View File

@@ -111,6 +111,24 @@
<None Include="res\string.ico"> <None Include="res\string.ico">
<Filter>资源文件</Filter> <Filter>资源文件</Filter>
</None> </None>
<None Include="res\4.cur">
<Filter>资源文件</Filter>
</None>
<None Include="res\2.cur">
<Filter>资源文件</Filter>
</None>
<None Include="res\3.cur">
<Filter>资源文件</Filter>
</None>
<None Include="res\1.cur">
<Filter>资源文件</Filter>
</None>
<None Include="res\cursor5.cur">
<Filter>资源文件</Filter>
</None>
<None Include="res\arrow.cur">
<Filter>资源文件</Filter>
</None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="2015Remote.h"> <ClInclude Include="2015Remote.h">

View File

@@ -302,7 +302,7 @@ VOID CMy2015RemoteDlg::InitControl()
rect.bottom+=20; rect.bottom+=20;
MoveWindow(rect); MoveWindow(rect);
for (int i = 0;i<g_Column_Count_Online;i++) for (int i = 0;i<g_Column_Count_Online;++i)
{ {
m_CList_Online.InsertColumn(i, g_Column_Data_Online[i].szTitle,LVCFMT_CENTER,g_Column_Data_Online[i].nWidth); m_CList_Online.InsertColumn(i, g_Column_Data_Online[i].szTitle,LVCFMT_CENTER,g_Column_Data_Online[i].nWidth);
@@ -310,7 +310,7 @@ VOID CMy2015RemoteDlg::InitControl()
} }
m_CList_Online.SetExtendedStyle(LVS_EX_FULLROWSELECT); m_CList_Online.SetExtendedStyle(LVS_EX_FULLROWSELECT);
for (int i = 0; i < g_Column_Count_Message; i++) for (int i = 0; i < g_Column_Count_Message; ++i)
{ {
m_CList_Message.InsertColumn(i, g_Column_Data_Message[i].szTitle,LVCFMT_CENTER,g_Column_Data_Message[i].nWidth); m_CList_Message.InsertColumn(i, g_Column_Data_Message[i].szTitle,LVCFMT_CENTER,g_Column_Data_Message[i].nWidth);
g_Column_Message_Width+=g_Column_Data_Message[i].nWidth; g_Column_Message_Width+=g_Column_Data_Message[i].nWidth;
@@ -499,7 +499,7 @@ void CMy2015RemoteDlg::OnSize(UINT nType, int cx, int cy)
rc.bottom = cy-160; //<2F>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> rc.bottom = cy-160; //<2F>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_CList_Online.MoveWindow(rc); m_CList_Online.MoveWindow(rc);
for(int i=0;i<g_Column_Count_Online;i++){ //<2F><><EFBFBD><EFBFBD>ÿһ<C3BF><D2BB><EFBFBD><EFBFBD> for(int i=0;i<g_Column_Count_Online;++i){ //<2F><><EFBFBD><EFBFBD>ÿһ<C3BF><D2BB><EFBFBD><EFBFBD>
double Temp=g_Column_Data_Online[i].nWidth; //<2F>õ<EFBFBD><C3B5><EFBFBD>ǰ<EFBFBD>еĿ<D0B5><C4BF><EFBFBD> 138 double Temp=g_Column_Data_Online[i].nWidth; //<2F>õ<EFBFBD><C3B5><EFBFBD>ǰ<EFBFBD>еĿ<D0B5><C4BF><EFBFBD> 138
Temp/=g_Column_Online_Width; //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ռ<EFBFBD>ܳ<EFBFBD><DCB3>ȵļ<C8B5><C4BC><EFBFBD>֮<EFBFBD><D6AE> Temp/=g_Column_Online_Width; //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ռ<EFBFBD>ܳ<EFBFBD><DCB3>ȵļ<C8B5><C4BC><EFBFBD>֮<EFBFBD><D6AE>
Temp*=cx; //<2F><>ԭ<EFBFBD><D4AD><EFBFBD>ij<EFBFBD><C4B3>ȳ<EFBFBD><C8B3><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>֮<EFBFBD><D6AE><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ǰ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD> Temp*=cx; //<2F><>ԭ<EFBFBD><D4AD><EFBFBD>ij<EFBFBD><C4B3>ȳ<EFBFBD><C8B3><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>֮<EFBFBD><D6AE><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ǰ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>
@@ -516,7 +516,7 @@ void CMy2015RemoteDlg::OnSize(UINT nType, int cx, int cy)
rc.right = cx-1; //<2F>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> rc.right = cx-1; //<2F>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
rc.bottom = cy-20; //<2F>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> rc.bottom = cy-20; //<2F>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_CList_Message.MoveWindow(rc); m_CList_Message.MoveWindow(rc);
for(int i=0;i<g_Column_Count_Message;i++){ //<2F><><EFBFBD><EFBFBD>ÿһ<C3BF><D2BB><EFBFBD><EFBFBD> for(int i=0;i<g_Column_Count_Message;++i){ //<2F><><EFBFBD><EFBFBD>ÿһ<C3BF><D2BB><EFBFBD><EFBFBD>
double Temp=g_Column_Data_Message[i].nWidth; //<2F>õ<EFBFBD><C3B5><EFBFBD>ǰ<EFBFBD>еĿ<D0B5><C4BF><EFBFBD> double Temp=g_Column_Data_Message[i].nWidth; //<2F>õ<EFBFBD><C3B5><EFBFBD>ǰ<EFBFBD>еĿ<D0B5><C4BF><EFBFBD>
Temp/=g_Column_Message_Width; //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ռ<EFBFBD>ܳ<EFBFBD><DCB3>ȵļ<C8B5><C4BC><EFBFBD>֮<EFBFBD><D6AE> Temp/=g_Column_Message_Width; //<2F><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>ռ<EFBFBD>ܳ<EFBFBD><DCB3>ȵļ<C8B5><C4BC><EFBFBD>֮<EFBFBD><D6AE>
Temp*=cx; //<2F><>ԭ<EFBFBD><D4AD><EFBFBD>ij<EFBFBD><C4B3>ȳ<EFBFBD><C8B3><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>֮<EFBFBD><D6AE><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ǰ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD> Temp*=cx; //<2F><>ԭ<EFBFBD><D4AD><EFBFBD>ij<EFBFBD><C4B3>ȳ<EFBFBD><C8B3><EFBFBD><EFBFBD><EFBFBD>ռ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>֮<EFBFBD><D6AE><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ǰ<EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD>
@@ -568,22 +568,6 @@ void CMy2015RemoteDlg::OnTimer(UINT_PTR nIDEvent)
void CMy2015RemoteDlg::OnClose() void CMy2015RemoteDlg::OnClose()
{ {
bool bOpened = false;
for (std::vector<CFileManagerDlg *>::iterator iter = v_FileDlg.begin();
iter != v_FileDlg.end(); ++iter)
{
CFileManagerDlg *cur = *iter;
if (!cur->m_bIsClosed){
bOpened = true;
break;
}
}
if (bOpened)
{
MessageBox(_T("<EFBFBD><EFBFBD><EFBFBD>ȹر<EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!"));
return;
}
// 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>ֵ // 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>ֵ
KillTimer(0); KillTimer(0);
@@ -591,6 +575,15 @@ void CMy2015RemoteDlg::OnClose()
Shell_NotifyIcon(NIM_DELETE, &m_Nid); Shell_NotifyIcon(NIM_DELETE, &m_Nid);
#endif #endif
BYTE bToken = COMMAND_BYE;
int n = m_CList_Online.GetItemCount();
for(int Pos = 0; Pos < n; ++Pos)
{
CONTEXT_OBJECT* ContextObject = (CONTEXT_OBJECT*)m_CList_Online.GetItemData(Pos);
m_iocpServer->OnClientPreSending(ContextObject, &bToken, sizeof(BYTE));
}
Sleep(200);
EnterCriticalSection(&m_cs); EnterCriticalSection(&m_cs);
for (std::vector<CFileManagerDlg *>::iterator iter = v_FileDlg.begin(); for (std::vector<CFileManagerDlg *>::iterator iter = v_FileDlg.begin();
iter != v_FileDlg.end(); ++iter) iter != v_FileDlg.end(); ++iter)
@@ -614,7 +607,7 @@ void CMy2015RemoteDlg::OnClose()
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Sleep<65><70><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1><EFBFBD><E2B2BB><EFBFBD>˳<EFBFBD>ʱ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IOCP<43><50>Ҫ<EFBFBD><D2AA><EFBFBD>ظ<EFBFBD>Щ<EFBFBD><D0A9><EFBFBD><EFBFBD> //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Sleep<65><70><EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><DCB1><EFBFBD><E2B2BB><EFBFBD>˳<EFBFBD>ʱ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IOCP<43><50>Ҫ<EFBFBD><D2AA><EFBFBD>ظ<EFBFBD>Щ<EFBFBD><D0A9><EFBFBD><EFBFBD>
ShowWindow(SW_HIDE); ShowWindow(SW_HIDE);
Sleep(500); Sleep(300);
if (m_iocpServer!=NULL) if (m_iocpServer!=NULL)
{ {
@@ -642,7 +635,7 @@ void CMy2015RemoteDlg::OnNMRClickOnline(NMHDR *pNMHDR, LRESULT *pResult)
int iCount = SubMenu->GetMenuItemCount(); int iCount = SubMenu->GetMenuItemCount();
if (m_CList_Online.GetSelectedCount() == 0) //<2F><><EFBFBD><EFBFBD>û<EFBFBD><C3BB>ѡ<EFBFBD><D1A1> if (m_CList_Online.GetSelectedCount() == 0) //<2F><><EFBFBD><EFBFBD>û<EFBFBD><C3BB>ѡ<EFBFBD><D1A1>
{ {
for (int i = 0;i<iCount;i++) for (int i = 0;i<iCount;++i)
{ {
SubMenu->EnableMenuItem(i, MF_BYPOSITION | MF_DISABLED | MF_GRAYED); //<2F>˵<EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SubMenu->EnableMenuItem(i, MF_BYPOSITION | MF_DISABLED | MF_GRAYED); //<2F>˵<EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
} }
@@ -666,6 +659,8 @@ void CMy2015RemoteDlg::OnOnlineMessage()
void CMy2015RemoteDlg::OnOnlineDelete() void CMy2015RemoteDlg::OnOnlineDelete()
{ {
// TODO: <20>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB4A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> // TODO: <20>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB4A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (IDYES != MessageBox(_T("ȷ<EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>ѡ<EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><EFBFBD>ؼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?"), _T("<EFBFBD><EFBFBD>ʾ"), MB_ICONQUESTION | MB_YESNO))
return;
BYTE bToken = COMMAND_BYE; //<2F>򱻿ض˷<D8B6><CBB7><EFBFBD>һ<EFBFBD><D2BB>COMMAND_SYSTEM BYTE bToken = COMMAND_BYE; //<2F>򱻿ض˷<D8B6><CBB7><EFBFBD>һ<EFBFBD><D2BB>COMMAND_SYSTEM
SendSelectedCommand(&bToken, sizeof(BYTE)); //Context PreSending PostSending SendSelectedCommand(&bToken, sizeof(BYTE)); //Context PreSending PostSending
@@ -674,7 +669,7 @@ void CMy2015RemoteDlg::OnOnlineDelete()
int iCount = m_CList_Online.GetSelectedCount(); int iCount = m_CList_Online.GetSelectedCount();
int i = 0; int i = 0;
for (i=0;i<iCount;i++) for (i=0;i<iCount;++i)
{ {
POSITION Pos = m_CList_Online.GetFirstSelectedItemPosition(); POSITION Pos = m_CList_Online.GetFirstSelectedItemPosition();
int iItem = m_CList_Online.GetNextSelectedItem(Pos); int iItem = m_CList_Online.GetNextSelectedItem(Pos);
@@ -716,7 +711,6 @@ VOID CMy2015RemoteDlg::OnOnlineDesktopManager()
VOID CMy2015RemoteDlg::OnOnlineFileManager() VOID CMy2015RemoteDlg::OnOnlineFileManager()
{ {
BYTE bToken = COMMAND_LIST_DRIVE; //<2F><><EFBFBD>̾<EFBFBD><CCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BYTE bToken = COMMAND_LIST_DRIVE; //<2F><><EFBFBD>̾<EFBFBD><CCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F>򱻿ض˷<D8B6><CBB7><EFBFBD><EFBFBD><EFBFBD>ϢCOMMAND_LIST_DRIVE <20>ڱ<EFBFBD><DAB1>ض<EFBFBD><D8B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>COMMAND_LIST_DRIVE
SendSelectedCommand(&bToken, sizeof(BYTE)); SendSelectedCommand(&bToken, sizeof(BYTE));
} }
@@ -756,9 +750,9 @@ void CMy2015RemoteDlg::OnOnlineBuildClient()
VOID CMy2015RemoteDlg::SendSelectedCommand(PBYTE szBuffer, ULONG ulLength) VOID CMy2015RemoteDlg::SendSelectedCommand(PBYTE szBuffer, ULONG ulLength)
{ {
POSITION Pos = m_CList_Online.GetFirstSelectedItemPosition(); //1[pcontext client] 2 3 //1 2 POSITION Pos = m_CList_Online.GetFirstSelectedItemPosition(); //1[pcontext client] 2 3 //1 2
while(Pos) while(Pos)
{ {
int iItem = m_CList_Online.GetNextSelectedItem(Pos); int iItem = m_CList_Online.GetNextSelectedItem(Pos);
CONTEXT_OBJECT* ContextObject = (CONTEXT_OBJECT*)m_CList_Online.GetItemData(iItem); //<2F><><EFBFBD>б<EFBFBD><D0B1><EFBFBD>Ŀ<EFBFBD><C4BF>ȡ<EFBFBD><C8A1>ClientContext<78><EFBFBD><E1B9B9> CONTEXT_OBJECT* ContextObject = (CONTEXT_OBJECT*)m_CList_Online.GetItemData(iItem); //<2F><><EFBFBD>б<EFBFBD><D0B1><EFBFBD>Ŀ<EFBFBD><C4BF>ȡ<EFBFBD><C8A1>ClientContext<78><EFBFBD><E1B9B9>
// <20><><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>ݰ<EFBFBD> //<2F>鿴ClientContext<78><EFBFBD><E1B9B9> // <20><><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>ݰ<EFBFBD> //<2F>鿴ClientContext<78><EFBFBD><E1B9B9>
@@ -1074,10 +1068,16 @@ LRESULT CMy2015RemoteDlg::OnUserOfflineMsg(WPARAM wParam, LPARAM lParam)
LeaveCriticalSection(&m_cs); LeaveCriticalSection(&m_cs);
dlgInfo *p = (dlgInfo *)wParam; dlgInfo *p = (dlgInfo *)wParam;
if (p && p->v1 > 0) if (p)
{ {
switch(p->v1) switch(p->v1)
{ {
case TALK_DLG:
{
CTalkDlg *Dlg = (CTalkDlg*)p->hDlg;
delete Dlg;
break;
}
case VIDEO_DLG: case VIDEO_DLG:
{ {
CVideoDlg *Dlg = (CVideoDlg*)p->hDlg; CVideoDlg *Dlg = (CVideoDlg*)p->hDlg;
@@ -1117,18 +1117,19 @@ LRESULT CMy2015RemoteDlg::OnUserOfflineMsg(WPARAM wParam, LPARAM lParam)
case FILEMANAGER_DLG: case FILEMANAGER_DLG:
{ {
CFileManagerDlg *Dlg = (CFileManagerDlg*)p->hDlg; CFileManagerDlg *Dlg = (CFileManagerDlg*)p->hDlg;
::SendMessage(Dlg->GetSafeHwnd(), WM_CLOSE, 0, 0); //delete Dlg; //<2F><><EFBFBD><EFBFBD><E2B4A6>
//delete Dlg; <20><><EFBFBD><EFBFBD><E2B4A6>
break; break;
} }
case REGISTER_DLG: case REGISTER_DLG:
{ {
CRegisterDlg *Dlg = (CRegisterDlg*)p->hDlg; CRegisterDlg *Dlg = (CRegisterDlg*)p->hDlg;
delete Dlg; //delete Dlg; //<2F><><EFBFBD><EFBFBD><E2B4A6>
break; break;
} }
default:break;
} }
delete p; delete p;
p = NULL;
} }
return S_OK; return S_OK;

View File

@@ -48,22 +48,22 @@ protected:
DECLARE_MESSAGE_MAP() DECLARE_MESSAGE_MAP()
public: public:
VOID CMy2015RemoteDlg::InitControl(); //<2F><>ʼ<EFBFBD>ؼ<EFBFBD> VOID InitControl(); //<2F><>ʼ<EFBFBD>ؼ<EFBFBD>
VOID CMy2015RemoteDlg::TestOnline(); //<2F><><EFBFBD>Ժ<EFBFBD><D4BA><EFBFBD> VOID TestOnline(); //<2F><><EFBFBD>Ժ<EFBFBD><D4BA><EFBFBD>
VOID CMy2015RemoteDlg::AddList(CString strIP, CString strAddr, CString strPCName, CString strOS, VOID AddList(CString strIP, CString strAddr, CString strPCName, CString strOS,
CString strCPU, CString strVideo, CString strPing,CONTEXT_OBJECT* ContextObject); CString strCPU, CString strVideo, CString strPing,CONTEXT_OBJECT* ContextObject);
VOID CMy2015RemoteDlg::ShowMessage(BOOL bOk, CString strMsg); VOID ShowMessage(BOOL bOk, CString strMsg);
VOID CMy2015RemoteDlg::CreatStatusBar(); VOID CreatStatusBar();
VOID CMy2015RemoteDlg::CreateToolBar(); VOID CreateToolBar();
VOID CMy2015RemoteDlg::CreateNotifyBar(); VOID CreateNotifyBar();
VOID CMy2015RemoteDlg::CreateSolidMenu(); VOID CreateSolidMenu();
VOID CMy2015RemoteDlg::ListenPort(); VOID ListenPort();
VOID CMy2015RemoteDlg::Activate(int nPort,int nMaxConnection); VOID Activate(int nPort,int nMaxConnection);
static VOID CALLBACK NotifyProc(CONTEXT_OBJECT* ContextObject); static VOID CALLBACK NotifyProc(CONTEXT_OBJECT* ContextObject);
static VOID CALLBACK OfflineProc(CONTEXT_OBJECT* ContextObject); static VOID CALLBACK OfflineProc(CONTEXT_OBJECT* ContextObject);
static VOID CMy2015RemoteDlg::MessageHandle(CONTEXT_OBJECT* ContextObject); static VOID MessageHandle(CONTEXT_OBJECT* ContextObject);
VOID CMy2015RemoteDlg::SendSelectedCommand(PBYTE szBuffer, ULONG ulLength); VOID SendSelectedCommand(PBYTE szBuffer, ULONG ulLength);
// <20><>ʾ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ // <20><>ʾ<EFBFBD>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
CListCtrl m_CList_Online; CListCtrl m_CList_Online;
CListCtrl m_CList_Message; CListCtrl m_CList_Message;

View File

@@ -34,7 +34,7 @@ CAudio::CAudio()
m_ulBufferLength = 1000; m_ulBufferLength = 1000;
int i = 0; int i = 0;
for (i = 0; i < 2; i++) for (i = 0; i < 2; ++i)
{ {
m_InAudioData[i] = new BYTE[m_ulBufferLength]; m_InAudioData[i] = new BYTE[m_ulBufferLength];
m_InAudioHeader[i] = new WAVEHDR; m_InAudioHeader[i] = new WAVEHDR;
@@ -51,7 +51,7 @@ CAudio::~CAudio()
{ {
waveInStop(m_hWaveIn); waveInStop(m_hWaveIn);
waveInReset(m_hWaveIn); waveInReset(m_hWaveIn);
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; ++i)
waveInUnprepareHeader(m_hWaveIn, m_InAudioHeader[i], sizeof(WAVEHDR)); waveInUnprepareHeader(m_hWaveIn, m_InAudioHeader[i], sizeof(WAVEHDR));
waveInClose(m_hWaveIn); waveInClose(m_hWaveIn);
@@ -60,7 +60,7 @@ CAudio::~CAudio()
printf("û<EFBFBD>гɹ<EFBFBD><EFBFBD>ر<EFBFBD>waveInCallBack.\n"); printf("û<EFBFBD>гɹ<EFBFBD><EFBFBD>ر<EFBFBD>waveInCallBack.\n");
} }
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; ++i)
{ {
delete [] m_InAudioData[i]; delete [] m_InAudioData[i];
m_InAudioData[i] = NULL; m_InAudioData[i] = NULL;
@@ -83,12 +83,12 @@ CAudio::~CAudio()
if (m_bIsWaveOutUsed) if (m_bIsWaveOutUsed)
{ {
waveOutReset(m_hWaveOut); waveOutReset(m_hWaveOut);
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; ++i)
waveOutUnprepareHeader(m_hWaveOut, m_InAudioHeader[i], sizeof(WAVEHDR)); waveOutUnprepareHeader(m_hWaveOut, m_InAudioHeader[i], sizeof(WAVEHDR));
waveOutClose(m_hWaveOut); waveOutClose(m_hWaveOut);
} }
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; ++i)
{ {
delete [] m_OutAudioData[i]; delete [] m_OutAudioData[i];
m_OutAudioData[i] = NULL; m_OutAudioData[i] = NULL;
@@ -118,7 +118,7 @@ BOOL CAudio::InitializeWaveIn()
} }
//¼<><C2BC><EFBFBD><20><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> //¼<><C2BC><EFBFBD><20><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
for (int i=0; i<2; i++) for (int i=0; i<2; ++i)
{ {
m_InAudioHeader[i]->lpData = (LPSTR)m_InAudioData[i]; //m_lpInAudioData ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> m_InAudioHeader[i]->lpData = (LPSTR)m_InAudioData[i]; //m_lpInAudioData ָ<><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
m_InAudioHeader[i]->dwBufferLength = m_ulBufferLength; m_InAudioHeader[i]->dwBufferLength = m_ulBufferLength;
@@ -214,7 +214,7 @@ BOOL CAudio::InitializeWaveOut()
if (!waveOutGetNumDevs()) if (!waveOutGetNumDevs())
return FALSE; return FALSE;
int i; int i;
for (i = 0; i < 2; i++) for (i = 0; i < 2; ++i)
memset(m_OutAudioData[i], 0, m_ulBufferLength); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> memset(m_OutAudioData[i], 0, m_ulBufferLength); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
MMRESULT mmResult; MMRESULT mmResult;
@@ -222,7 +222,7 @@ BOOL CAudio::InitializeWaveOut()
if (mmResult != MMSYSERR_NOERROR) if (mmResult != MMSYSERR_NOERROR)
return false; return false;
for (i = 0; i < 2; i++) for (i = 0; i < 2; ++i)
{ {
m_OutAudioHeader[i]->lpData = (LPSTR)m_OutAudioData[i]; m_OutAudioHeader[i]->lpData = (LPSTR)m_OutAudioData[i];
m_OutAudioHeader[i]->dwBufferLength = m_ulBufferLength; m_OutAudioHeader[i]->dwBufferLength = m_ulBufferLength;

View File

@@ -27,8 +27,8 @@ public:
DWORD m_nWaveInIndex; DWORD m_nWaveInIndex;
bool m_hThreadCallBack; bool m_hThreadCallBack;
static DWORD WINAPI waveInCallBack(LPVOID lParam); //<2F><><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD>ض<EFBFBD> static DWORD WINAPI waveInCallBack(LPVOID lParam); //<2F><><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD>ض<EFBFBD>
LPBYTE CAudio::GetRecordBuffer(LPDWORD dwBufferSize); LPBYTE GetRecordBuffer(LPDWORD dwBufferSize);
BOOL CAudio::InitializeWaveIn(); BOOL InitializeWaveIn();
BOOL m_bIsWaveInUsed; BOOL m_bIsWaveInUsed;
HWAVEOUT m_hWaveOut; HWAVEOUT m_hWaveOut;
@@ -37,8 +37,8 @@ public:
DWORD m_nWaveOutIndex; DWORD m_nWaveOutIndex;
LPWAVEHDR m_OutAudioHeader[2]; //<2F><><EFBFBD><EFBFBD>ͷ LPWAVEHDR m_OutAudioHeader[2]; //<2F><><EFBFBD><EFBFBD>ͷ
LPBYTE m_OutAudioData[2]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> LPBYTE m_OutAudioData[2]; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BOOL CAudio::PlayBuffer(LPBYTE szBuffer, DWORD dwBufferSize); BOOL PlayBuffer(LPBYTE szBuffer, DWORD dwBufferSize);
BOOL CAudio::InitializeWaveOut(); BOOL InitializeWaveOut();
}; };
#endif // !defined(AFX_AUDIO_H__56854DE7_5FE4_486F_9AFC_CE3726EF7CBC__INCLUDED_) #endif // !defined(AFX_AUDIO_H__56854DE7_5FE4_486F_9AFC_CE3726EF7CBC__INCLUDED_)

View File

@@ -121,13 +121,16 @@ void CAudioDlg::OnReceiveComplete(void)
void CAudioDlg::OnClose() void CAudioDlg::OnClose()
{ {
// 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>ֵ // 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>ֵ
#if CLOSE_DELETE_DLG
m_ContextObject->v1 = 0; m_ContextObject->v1 = 0;
#endif
CancelIo((HANDLE)m_ContextObject->sClientSocket); CancelIo((HANDLE)m_ContextObject->sClientSocket);
closesocket(m_ContextObject->sClientSocket); closesocket(m_ContextObject->sClientSocket);
m_bIsWorking = FALSE; m_bIsWorking = FALSE;
WaitForSingleObject(m_hWorkThread, INFINITE); WaitForSingleObject(m_hWorkThread, INFINITE);
CDialog::OnClose(); CDialog::OnClose();
#if CLOSE_DELETE_DLG
delete this; delete this;
#endif
} }

View File

@@ -162,7 +162,7 @@ VOID CBuffer::ClearBuffer()
LeaveCriticalSection(&m_cs); LeaveCriticalSection(&m_cs);
} }
ULONG CBuffer::GetBufferLength() //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD> ULONG CBuffer::GetBufferLength() const //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
{ {
if (m_Base == NULL) if (m_Base == NULL)
return 0; return 0;
@@ -171,12 +171,12 @@ ULONG CBuffer::GetBufferLength() //
} }
ULONG CBuffer::GetBufferMaxLength() ULONG CBuffer::GetBufferMaxLength() const
{ {
return m_ulMaxLength; return m_ulMaxLength;
} }
PBYTE CBuffer::GetBuffer(ULONG ulPos) PBYTE CBuffer::GetBuffer(ULONG ulPos) const
{ {
if (m_Base==NULL) if (m_Base==NULL)
{ {

View File

@@ -7,14 +7,14 @@ public:
CBuffer(void); CBuffer(void);
~CBuffer(void); ~CBuffer(void);
ULONG GetBufferMaxLength(); ULONG GetBufferMaxLength() const;
ULONG ReadBuffer(PBYTE Buffer, ULONG ulLength); ULONG ReadBuffer(PBYTE Buffer, ULONG ulLength);
ULONG GetBufferLength(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>; ULONG GetBufferLength() const; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>;
ULONG DeAllocateBuffer(ULONG ulLength); ULONG DeAllocateBuffer(ULONG ulLength);
VOID ClearBuffer(); VOID ClearBuffer();
ULONG ReAllocateBuffer(ULONG ulLength); ULONG ReAllocateBuffer(ULONG ulLength);
BOOL WriteBuffer(PBYTE Buffer, ULONG ulLength); BOOL WriteBuffer(PBYTE Buffer, ULONG ulLength);
PBYTE GetBuffer(ULONG ulPos=0); PBYTE GetBuffer(ULONG ulPos=0) const;
ULONG RemoveComletedBuffer(ULONG ulLength); ULONG RemoveComletedBuffer(ULONG ulLength);
VOID ReleaseMember(); VOID ReleaseMember();
VOID InitMember(); VOID InitMember();

View File

@@ -125,7 +125,7 @@ int MemoryFind(const char *szBuffer, const char *Key, int iBufferSize, int iKeyS
{ {
return -1; return -1;
} }
for (i = 0; i < iBufferSize; i++) for (i = 0; i < iBufferSize; ++i)
{ {
for (j = 0; j < iKeySize; j ++) for (j = 0; j < iKeySize; j ++)
if (szBuffer[i+j] != Key[j]) break; //0x12345678 78 56 34 12 if (szBuffer[i+j] != Key[j]) break; //0x12345678 78 56 34 12

View File

@@ -43,10 +43,9 @@ CFileManagerDlg::CFileManagerDlg(CWnd* pParent, CIOCPServer* pIOCPServer, Client
sizeof(SHFILEINFO), sizeof(SHFILEINFO),
SHGFI_ICON | SHGFI_USEFILEATTRIBUTES SHGFI_ICON | SHGFI_USEFILEATTRIBUTES
); );
m_hIcon = sfi.hIcon; m_hIcon = sfi.hIcon;
HIMAGELIST hImageList;
// <20><><EFBFBD><EFBFBD>ϵͳͼ<CDB3><CDBC><EFBFBD>б<EFBFBD> // <20><><EFBFBD><EFBFBD>ϵͳͼ<CDB3><CDBC><EFBFBD>б<EFBFBD>
hImageList = (HIMAGELIST)SHGetFileInfo static HIMAGELIST hImageList_Large = (HIMAGELIST)SHGetFileInfo
( (
NULL, NULL,
0, 0,
@@ -54,10 +53,11 @@ CFileManagerDlg::CFileManagerDlg(CWnd* pParent, CIOCPServer* pIOCPServer, Client
sizeof(SHFILEINFO), sizeof(SHFILEINFO),
SHGFI_LARGEICON | SHGFI_SYSICONINDEX SHGFI_LARGEICON | SHGFI_SYSICONINDEX
); );
m_pImageList_Large = CImageList::FromHandle(hImageList); static CImageList *pLarge = CImageList::FromHandle(hImageList_Large);
m_pImageList_Large = pLarge;
// <20><><EFBFBD><EFBFBD>ϵͳͼ<CDB3><CDBC><EFBFBD>б<EFBFBD> // <20><><EFBFBD><EFBFBD>ϵͳͼ<CDB3><CDBC><EFBFBD>б<EFBFBD>
hImageList = (HIMAGELIST)SHGetFileInfo static HIMAGELIST hImageList_Small = (HIMAGELIST)SHGetFileInfo
( (
NULL, NULL,
0, 0,
@@ -65,7 +65,8 @@ CFileManagerDlg::CFileManagerDlg(CWnd* pParent, CIOCPServer* pIOCPServer, Client
sizeof(SHFILEINFO), sizeof(SHFILEINFO),
SHGFI_SMALLICON | SHGFI_SYSICONINDEX SHGFI_SMALLICON | SHGFI_SYSICONINDEX
); );
m_pImageList_Small = CImageList::FromHandle(hImageList); static CImageList *pSmall = CImageList::FromHandle(hImageList_Small);
m_pImageList_Small = pSmall;
// <20><>ʼ<EFBFBD><CABC>Ӧ<EFBFBD>ô<EFBFBD><C3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD>СΪ0 // <20><>ʼ<EFBFBD><CABC>Ӧ<EFBFBD>ô<EFBFBD><C3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD>СΪ0
@@ -447,7 +448,7 @@ void CFileManagerDlg::FixedLocalFileList(CString directory)
); );
// i Ϊ 0 ʱ<><CAB1>Ŀ¼<C4BF><C2BC>i Ϊ 1ʱ<31><CAB1><EFBFBD>ļ<EFBFBD> // i Ϊ 0 ʱ<><CAB1>Ŀ¼<C4BF><C2BC>i Ϊ 1ʱ<31><CAB1><EFBFBD>ļ<EFBFBD>
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; ++i)
{ {
CFileFind file; CFileFind file;
BOOL bContinue; BOOL bContinue;
@@ -878,12 +879,18 @@ void CFileManagerDlg::OnClose()
{ {
// TODO: Add your message handler code here and/or call default // TODO: Add your message handler code here and/or call default
CoUninitialize(); CoUninitialize();
m_pContext->m_Dialog = 0;
#if CLOSE_DELETE_DLG
m_pContext->v1 = 0;
#endif
closesocket(m_pContext->m_Socket); closesocket(m_pContext->m_Socket);
CDialog::OnClose(); CDialog::OnClose();
m_bIsClosed = true; m_bIsClosed = true;
#if CLOSE_DELETE_DLG
//delete this; //<2F>˴<EFBFBD><CBB4>ͷ<EFBFBD><CDB7>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>ڵ<EFBFBD>2<EFBFBD>α<EFBFBD><CEB1><EFBFBD> //delete this; //<2F>˴<EFBFBD><CBB4>ͷ<EFBFBD><CDB7>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>ڵ<EFBFBD>2<EFBFBD>α<EFBFBD><CEB1><EFBFBD>
#endif
} }
CString CFileManagerDlg::GetParentDirectory(CString strPath) CString CFileManagerDlg::GetParentDirectory(CString strPath)
@@ -1049,7 +1056,7 @@ void CFileManagerDlg::FixedRemoteFileList(BYTE *pbBuffer, DWORD dwBufferLen)
if (dwBufferLen != 0) if (dwBufferLen != 0)
{ {
// //
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; ++i)
{ {
// <20><><EFBFBD><EFBFBD>Token<65><6E><EFBFBD><EFBFBD>5<EFBFBD>ֽ<EFBFBD> // <20><><EFBFBD><EFBFBD>Token<65><6E><EFBFBD><EFBFBD>5<EFBFBD>ֽ<EFBFBD>
char *pList = (char *)(pbBuffer + 1); char *pList = (char *)(pbBuffer + 1);
@@ -1083,7 +1090,7 @@ void CFileManagerDlg::FixedRemoteFileList(BYTE *pbBuffer, DWORD dwBufferLen)
memcpy(&dwFileSizeHigh, pList, 4); memcpy(&dwFileSizeHigh, pList, 4);
memcpy(&dwFileSizeLow, pList + 4, 4); memcpy(&dwFileSizeLow, pList + 4, 4);
CString strSize; CString strSize;
strSize.Format("%10d KB", (dwFileSizeHigh * (MAXDWORD+1)) / 1024 + dwFileSizeLow / 1024 + (dwFileSizeLow % 1024 ? 1 : 0)); strSize.Format("%10d KB", (dwFileSizeHigh * (MAXDWORD+long long(1))) / 1024 + dwFileSizeLow / 1024 + (dwFileSizeLow % 1024 ? 1 : 0));
m_list_remote.SetItemText(nItem, 1, strSize); m_list_remote.SetItemText(nItem, 1, strSize);
memcpy(&ftm_strReceiveLocalFileTime, pList + 8, sizeof(FILETIME)); memcpy(&ftm_strReceiveLocalFileTime, pList + 8, sizeof(FILETIME));
CTime time(ftm_strReceiveLocalFileTime); CTime time(ftm_strReceiveLocalFileTime);
@@ -1496,7 +1503,7 @@ BOOL CFileManagerDlg::SendUploadJob()
if (hFile == INVALID_HANDLE_VALUE) if (hFile == INVALID_HANDLE_VALUE)
return FALSE; return FALSE;
dwSizeLow = GetFileSize (hFile, &dwSizeHigh); dwSizeLow = GetFileSize (hFile, &dwSizeHigh);
m_nOperatingFileLength = (dwSizeHigh * (MAXDWORD+1)) + dwSizeLow; m_nOperatingFileLength = (dwSizeHigh * (MAXDWORD+long long(1))) + dwSizeLow;
CloseHandle(hFile); CloseHandle(hFile);
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD> // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
@@ -1530,7 +1537,7 @@ BOOL CFileManagerDlg::SendDeleteJob()
if (file.GetAt(file.GetLength() - 1) == '\\') if (file.GetAt(file.GetLength() - 1) == '\\')
{ {
ShowMessage("Զ<EFBFBD>̣<EFBFBD>ɾ<EFBFBD><EFBFBD>Ŀ¼ %s\*.* <20><><EFBFBD><EFBFBD>", file); ShowMessage("Զ<EFBFBD>̣<EFBFBD>ɾ<EFBFBD><EFBFBD>Ŀ¼ %s\\*.* <20><><EFBFBD><EFBFBD>", file);
bPacket[0] = COMMAND_DELETE_DIRECTORY; bPacket[0] = COMMAND_DELETE_DIRECTORY;
} }
else else
@@ -1572,7 +1579,7 @@ void CFileManagerDlg::CreateLocalRecvFile()
DWORD dwSizeHigh = pFileSize->dwSizeHigh; DWORD dwSizeHigh = pFileSize->dwSizeHigh;
DWORD dwSizeLow = pFileSize->dwSizeLow; DWORD dwSizeLow = pFileSize->dwSizeLow;
m_nOperatingFileLength = (dwSizeHigh * (MAXDWORD+1)) + dwSizeLow; m_nOperatingFileLength = (dwSizeHigh * (MAXDWORD+long long(1))) + dwSizeLow;
// <20><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD> // <20><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
m_strOperatingFile = m_pContext->m_DeCompressionBuffer.GetBuffer(9); m_strOperatingFile = m_pContext->m_DeCompressionBuffer.GetBuffer(9);
@@ -1662,7 +1669,7 @@ void CFileManagerDlg::CreateLocalRecvFile()
memcpy(bToken + 1, &FindFileData.nFileSizeHigh, 4); memcpy(bToken + 1, &FindFileData.nFileSizeHigh, 4);
memcpy(bToken + 5, &FindFileData.nFileSizeLow, 4); memcpy(bToken + 5, &FindFileData.nFileSizeLow, 4);
// <20><><EFBFBD>յij<D5B5><C4B3>ȵ<EFBFBD><C8B5><EFBFBD> // <20><><EFBFBD>յij<D5B5><C4B3>ȵ<EFBFBD><C8B5><EFBFBD>
m_nCounter += FindFileData.nFileSizeHigh * (MAXDWORD+1); m_nCounter += FindFileData.nFileSizeHigh * (MAXDWORD+long long(1));
m_nCounter += FindFileData.nFileSizeLow; m_nCounter += FindFileData.nFileSizeLow;
dwCreationDisposition = OPEN_EXISTING; dwCreationDisposition = OPEN_EXISTING;
@@ -1760,7 +1767,7 @@ void CFileManagerDlg::WriteLocalRecvFile()
SetFilePointer(hFile, dwOffsetLow, &dwOffsetHigh, FILE_BEGIN); SetFilePointer(hFile, dwOffsetLow, &dwOffsetHigh, FILE_BEGIN);
int nRet = 0, i = 0; int nRet = 0, i = 0;
for (; i < MAX_WRITE_RETRY; i++) for (; i < MAX_WRITE_RETRY; ++i)
{ {
// д<><D0B4><EFBFBD>ļ<EFBFBD> // д<><D0B4><EFBFBD>ļ<EFBFBD>
nRet = WriteFile nRet = WriteFile
@@ -1811,7 +1818,7 @@ void CFileManagerDlg::EndLocalRecvFile()
m_nTransferMode = TRANSFER_MODE_NORMAL; m_nTransferMode = TRANSFER_MODE_NORMAL;
EnableControl(TRUE); EnableControl(TRUE);
FixedLocalFileList("."); FixedLocalFileList(".");
ShowMessage("<EFBFBD><EFBFBD><EFBFBD>أ<EFBFBD>װ<EFBFBD><EFBFBD>Ŀ¼ %s\*.* <20><><EFBFBD><EFBFBD>", m_Local_Path); ShowMessage("<EFBFBD><EFBFBD><EFBFBD>أ<EFBFBD>װ<EFBFBD><EFBFBD>Ŀ¼ %s\\*.* <20><><EFBFBD><EFBFBD>", m_Local_Path);
} }
else else
{ {
@@ -1834,7 +1841,7 @@ void CFileManagerDlg::EndLocalUploadFile()
m_bIsStop = false; m_bIsStop = false;
EnableControl(TRUE); EnableControl(TRUE);
GetRemoteFileList("."); GetRemoteFileList(".");
ShowMessage("Զ<EFBFBD>̣<EFBFBD>װ<EFBFBD><EFBFBD>Ŀ¼ %s\*.* <20><><EFBFBD><EFBFBD>", m_Remote_Path); ShowMessage("Զ<EFBFBD>̣<EFBFBD>װ<EFBFBD><EFBFBD>Ŀ¼ %s\\*.* <20><><EFBFBD><EFBFBD>", m_Remote_Path);
} }
else else
{ {
@@ -1852,7 +1859,7 @@ void CFileManagerDlg::EndRemoteDeleteFile()
m_bIsStop = false; m_bIsStop = false;
EnableControl(TRUE); EnableControl(TRUE);
GetRemoteFileList("."); GetRemoteFileList(".");
ShowMessage("Զ<EFBFBD>̣<EFBFBD>װ<EFBFBD><EFBFBD>Ŀ¼ %s\*.* <20><><EFBFBD><EFBFBD>", m_Remote_Path); ShowMessage("Զ<EFBFBD>̣<EFBFBD>װ<EFBFBD><EFBFBD>Ŀ¼ %s\\*.* <20><><EFBFBD><EFBFBD>", m_Remote_Path);
} }
else else
{ {
@@ -2330,7 +2337,7 @@ void CFileManagerDlg::OnRclickListLocal(NMHDR* pNMHDR, LRESULT* pResult)
if (pListCtrl->GetSelectedCount() == 0) if (pListCtrl->GetSelectedCount() == 0)
{ {
int count = pM->GetMenuItemCount(); int count = pM->GetMenuItemCount();
for (int i = 0; i < count; i++) for (int i = 0; i < count; ++i)
{ {
pM->EnableMenuItem(i, MF_BYPOSITION | MF_GRAYED); pM->EnableMenuItem(i, MF_BYPOSITION | MF_GRAYED);
} }
@@ -2370,7 +2377,7 @@ void CFileManagerDlg::OnRclickListRemote(NMHDR* pNMHDR, LRESULT* pResult)
if (pListCtrl->GetSelectedCount() == 0) if (pListCtrl->GetSelectedCount() == 0)
{ {
int count = pM->GetMenuItemCount(); int count = pM->GetMenuItemCount();
for (int i = 0; i < count; i++) for (int i = 0; i < count; ++i)
{ {
pM->EnableMenuItem(i, MF_BYPOSITION | MF_GRAYED); pM->EnableMenuItem(i, MF_BYPOSITION | MF_GRAYED);
} }

View File

@@ -3,8 +3,27 @@
#include "2015Remote.h" #include "2015Remote.h"
#include <iostream> #include <iostream>
#if USING_ZLIB
#include "zlib.h" #include "zlib.h"
#include "zconf.h" #define Z_FAILED(p) (Z_OK != (p))
#define Z_SUCCESS(p) (!Z_FAILED(p))
#else
#if USING_LZ4
#include "lz4/lz4.h"
#pragma comment(lib, "lz4/lz4.lib")
#define Z_FAILED(p) (0 == (p))
#define Z_SUCCESS(p) (!Z_FAILED(p))
#define compress(dest, destLen, source, sourceLen) LZ4_compress_default((const char*)source, (char*)dest, sourceLen, *(destLen))
#define uncompress(dest, destLen, source, sourceLen) LZ4_decompress_safe((const char*)source, (char*)dest, sourceLen, *(destLen))
#else
#include "zstd/zstd.h"
#pragma comment(lib, "zstd/zstd.lib")
#define Z_FAILED(p) ZSTD_isError(p)
#define Z_SUCCESS(p) (!Z_FAILED(p))
#define compress(dest, destLen, source, sourceLen) ZSTD_compress(dest, *(destLen), source, sourceLen, ZSTD_CLEVEL_DEFAULT)
#define uncompress(dest, destLen, source, sourceLen) ZSTD_decompress(dest, *(destLen), source, sourceLen)
#endif
#endif
using namespace std; using namespace std;
CRITICAL_SECTION IOCPServer::m_cs = {0}; CRITICAL_SECTION IOCPServer::m_cs = {0};
@@ -98,7 +117,8 @@ IOCPServer::~IOCPServer(void)
while (!m_ContextFreePoolList.IsEmpty()) while (!m_ContextFreePoolList.IsEmpty())
{ {
CONTEXT_OBJECT *ContextObject = m_ContextFreePoolList.RemoveHead(); CONTEXT_OBJECT *ContextObject = m_ContextFreePoolList.RemoveHead();
SAFE_DELETE(ContextObject->olps); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD>2019.1.14
//SAFE_DELETE(ContextObject->olps);
delete ContextObject; delete ContextObject;
} }
@@ -251,7 +271,7 @@ BOOL IOCPServer::InitializeIOCP(VOID)
ULONG ulWorkThreadCount = m_ulThreadPoolMax; ULONG ulWorkThreadCount = m_ulThreadPoolMax;
HANDLE hWorkThread = NULL; 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> 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, 0,
@@ -451,13 +471,14 @@ BOOL IOCPServer::OnClientReceiving(PCONTEXT_OBJECT ContextObject, DWORD dwTrans
//<2F><><EFBFBD><EFBFBD><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD>ǰ<EFBFBD><C7B0>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD>û<EFBFBD>н<EFBFBD>ѹ<EFBFBD><D1B9>ȡ<EFBFBD><C8A1>pData 448 //<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); ContextObject->InCompressedBuffer.ReadBuffer(CompressedBuffer, ulCompressedLength);
int iRet = uncompress(DeCompressedBuffer, &ulOriginalLength, CompressedBuffer, ulCompressedLength); int iRet = uncompress(DeCompressedBuffer, &ulOriginalLength, CompressedBuffer, ulCompressedLength);
if (iRet == Z_OK) if (Z_SUCCESS(iRet))
{ {
ContextObject->InDeCompressedBuffer.ClearBuffer(); ContextObject->InDeCompressedBuffer.ClearBuffer();
ContextObject->InCompressedBuffer.ClearBuffer(); ContextObject->InCompressedBuffer.ClearBuffer();
ContextObject->InDeCompressedBuffer.WriteBuffer(DeCompressedBuffer, ulOriginalLength); ContextObject->InDeCompressedBuffer.WriteBuffer(DeCompressedBuffer, ulOriginalLength);
m_NotifyProc(ContextObject); //֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD> m_NotifyProc(ContextObject); //֪ͨ<CDA8><D6AA><EFBFBD><EFBFBD>
}else{ }else{
OutputDebugStringA("[ERROR] uncompress failed \n");
throw "Bad Buffer"; throw "Bad Buffer";
} }
delete [] CompressedBuffer; delete [] CompressedBuffer;
@@ -485,15 +506,25 @@ VOID IOCPServer::OnClientPreSending(CONTEXT_OBJECT* ContextObject, PBYTE szBuffe
{ {
if (ulOriginalLength > 0) if (ulOriginalLength > 0)
{ {
#if USING_ZLIB
unsigned long ulCompressedLength = (double)ulOriginalLength * 1.001 + 12; unsigned long ulCompressedLength = (double)ulOriginalLength * 1.001 + 12;
#elif USING_LZ4
unsigned long ulCompressedLength = LZ4_compressBound(ulOriginalLength);
#else
unsigned long ulCompressedLength = ZSTD_compressBound(ulOriginalLength);
#endif
LPBYTE CompressedBuffer = new BYTE[ulCompressedLength]; LPBYTE CompressedBuffer = new BYTE[ulCompressedLength];
int iRet = compress(CompressedBuffer, &ulCompressedLength, (LPBYTE)szBuffer, ulOriginalLength); int iRet = compress(CompressedBuffer, &ulCompressedLength, (LPBYTE)szBuffer, ulOriginalLength);
if (iRet != Z_OK) if (Z_FAILED(iRet))
{ {
OutputDebugStringA("[ERROR] compress failed \n");
delete [] CompressedBuffer; delete [] CompressedBuffer;
return; return;
} }
#if !USING_ZLIB
ulCompressedLength = iRet;
#endif
ULONG ulPackTotalLength = ulCompressedLength + HDR_LENGTH; ULONG ulPackTotalLength = ulCompressedLength + HDR_LENGTH;
ContextObject->OutCompressedBuffer.WriteBuffer((LPBYTE)m_szPacketFlag,FLAG_LENGTH); ContextObject->OutCompressedBuffer.WriteBuffer((LPBYTE)m_szPacketFlag,FLAG_LENGTH);
ContextObject->OutCompressedBuffer.WriteBuffer((PBYTE)&ulPackTotalLength, sizeof(ULONG)); ContextObject->OutCompressedBuffer.WriteBuffer((PBYTE)&ulPackTotalLength, sizeof(ULONG));

View File

@@ -148,7 +148,7 @@ public:
OVERLAPPEDPLUS(IOType ioType) OVERLAPPEDPLUS(IOType ioType)
{ {
#ifdef _DEBUG #if 0
char szLog[100]; char szLog[100];
sprintf_s(szLog, "=> [new] OVERLAPPEDPLUS %x by thread [%d].\n", this, GetCurrentThreadId()); sprintf_s(szLog, "=> [new] OVERLAPPEDPLUS %x by thread [%d].\n", this, GetCurrentThreadId());
OutputDebugStringA(szLog); OutputDebugStringA(szLog);
@@ -159,7 +159,7 @@ public:
~OVERLAPPEDPLUS() ~OVERLAPPEDPLUS()
{ {
#ifdef _DEBUG #if 0
char szLog[100]; char szLog[100];
sprintf_s(szLog, "=> [delete] OVERLAPPEDPLUS %x by thread [%d].\n", this, GetCurrentThreadId()); sprintf_s(szLog, "=> [delete] OVERLAPPEDPLUS %x by thread [%d].\n", this, GetCurrentThreadId());
OutputDebugStringA(szLog); OutputDebugStringA(szLog);

View File

@@ -107,12 +107,16 @@ BOOL CRegisterDlg::OnInitDialog()
void CRegisterDlg::OnClose() void CRegisterDlg::OnClose()
{ {
#if CLOSE_DELETE_DLG
m_ContextObject->v1 = 0; m_ContextObject->v1 = 0;
#endif
CancelIo((HANDLE)m_ContextObject->sClientSocket); CancelIo((HANDLE)m_ContextObject->sClientSocket);
closesocket(m_ContextObject->sClientSocket); closesocket(m_ContextObject->sClientSocket);
CDialog::OnClose(); CDialog::OnClose();
m_bIsClosed = TRUE; m_bIsClosed = TRUE;
//delete this; #if CLOSE_DELETE_DLG
//delete this;//<2F>˴<EFBFBD>ͬ<EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#endif
} }
@@ -246,7 +250,7 @@ void CRegisterDlg::AddPath(char* szBuffer)
DWORD size =msg.size; DWORD size =msg.size;
int count=msg.count; int count=msg.count;
if(size>0&&count>0){ //һ<><EFBFBD><E3B1A3><EFBFBD><EFBFBD>ʩ if(size>0&&count>0){ //һ<><EFBFBD><E3B1A3><EFBFBD><EFBFBD>ʩ
for(int i=0;i<count;i++){ for(int i=0;i<count;++i){
if (m_bIsClosed) if (m_bIsClosed)
break; break;
char* szKeyName=szBuffer+size*i+msgsize; char* szKeyName=szBuffer+size*i+msgsize;
@@ -267,7 +271,7 @@ void CRegisterDlg::AddKey(char* szBuffer)
REGMSG msg; REGMSG msg;
memcpy((void*)&msg,szBuffer,sizeof(msg)); memcpy((void*)&msg,szBuffer,sizeof(msg));
char* szTemp=szBuffer+sizeof(msg); char* szTemp=szBuffer+sizeof(msg);
for(int i=0;i<msg.count;i++) for(int i=0;i<msg.count;++i)
{ {
if (m_bIsClosed) if (m_bIsClosed)
break; break;

View File

@@ -39,10 +39,10 @@ public:
HTREEITEM HKCC; HTREEITEM HKCC;
HTREEITEM m_hSelectedItem; HTREEITEM m_hSelectedItem;
BOOL m_isEnable; BOOL m_isEnable;
char CRegisterDlg::GetFatherPath(CString& strFullPath); char GetFatherPath(CString& strFullPath);
CString CRegisterDlg::GetFullPath(HTREEITEM hCurrent); CString GetFullPath(HTREEITEM hCurrent);
afx_msg void OnTvnSelchangedTree(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnTvnSelchangedTree(NMHDR *pNMHDR, LRESULT *pResult);
void CRegisterDlg::OnReceiveComplete(void); void OnReceiveComplete(void);
void CRegisterDlg::AddPath(char* szBuffer); void AddPath(char* szBuffer);
void CRegisterDlg::AddKey(char* szBuffer); void AddKey(char* szBuffer);
}; };

View File

@@ -37,7 +37,7 @@ CScreenSpyDlg::CScreenSpyDlg(CWnd* Parent, IOCPServer* IOCPServer, CONTEXT_OBJEC
GetSystemDirectory(szFullPath, MAX_PATH); GetSystemDirectory(szFullPath, MAX_PATH);
lstrcat(szFullPath, "\\shell32.dll"); //ͼ<><CDBC> lstrcat(szFullPath, "\\shell32.dll"); //ͼ<><CDBC>
m_hIcon = ExtractIcon(AfxGetApp()->m_hInstance, szFullPath, 17); m_hIcon = ExtractIcon(AfxGetApp()->m_hInstance, szFullPath, 17);
m_hCursor = LoadCursor(AfxGetApp()->m_hInstance,IDC_ARROW); m_hCursor = LoadCursor(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDC_ARROW));
sockaddr_in ClientAddr; sockaddr_in ClientAddr;
memset(&ClientAddr, 0, sizeof(ClientAddr)); memset(&ClientAddr, 0, sizeof(ClientAddr));
@@ -148,6 +148,7 @@ BOOL CScreenSpyDlg::OnInitDialog()
m_bIsTraceCursor = FALSE; //<2F><><EFBFBD>Ǹ<EFBFBD><C7B8><EFBFBD> m_bIsTraceCursor = FALSE; //<2F><><EFBFBD>Ǹ<EFBFBD><C7B8><EFBFBD>
m_ClientCursorPos.x = 0; m_ClientCursorPos.x = 0;
m_ClientCursorPos.y = 0; m_ClientCursorPos.y = 0;
m_bCursorIndex = 0;
SendNext(); SendNext();
@@ -157,12 +158,16 @@ BOOL CScreenSpyDlg::OnInitDialog()
VOID CScreenSpyDlg::OnClose() VOID CScreenSpyDlg::OnClose()
{ {
#if CLOSE_DELETE_DLG
m_ContextObject->v1 = 0; m_ContextObject->v1 = 0;
#endif
CancelIo((HANDLE)m_ContextObject->sClientSocket); CancelIo((HANDLE)m_ContextObject->sClientSocket);
closesocket(m_ContextObject->sClientSocket); closesocket(m_ContextObject->sClientSocket);
CDialog::OnClose(); CDialog::OnClose();
#if CLOSE_DELETE_DLG
delete this; delete this;
#endif
} }
@@ -226,6 +231,13 @@ VOID CScreenSpyDlg::DrawNextScreenDiff(void)
} }
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD> // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>
BYTE bOldCursorIndex;
memcpy(&bOldCursorIndex, &m_bCursorIndex, sizeof(BYTE));
memcpy(&m_bCursorIndex, m_ContextObject->InDeCompressedBuffer.GetBuffer(2+sizeof(POINT)), sizeof(BYTE));
if (bOldCursorIndex != m_bCursorIndex)
{
bChange = TRUE;
}
// <20><>Ļ<EFBFBD>Ƿ<EFBFBD><C7B7> // <20><>Ļ<EFBFBD>Ƿ<EFBFBD><C7B7>
if (NextScreenLength > 0) if (NextScreenLength > 0)
@@ -286,7 +298,7 @@ void CScreenSpyDlg::OnPaint()
m_hFullDC, m_hFullDC,
m_ClientCursorPos.x - m_ulHScrollPos, m_ClientCursorPos.x - m_ulHScrollPos,
m_ClientCursorPos.y - m_ulVScrollPos, m_ClientCursorPos.y - m_ulVScrollPos,
m_hIcon, m_hCursor,
0,0, 0,0,
0, 0,
NULL, NULL,

View File

@@ -8,42 +8,43 @@ class CScreenSpyDlg : public CDialog
DECLARE_DYNAMIC(CScreenSpyDlg) DECLARE_DYNAMIC(CScreenSpyDlg)
public: public:
CScreenSpyDlg::CScreenSpyDlg(CWnd* Parent, IOCPServer* IOCPServer=NULL, CONTEXT_OBJECT *ContextObject=NULL); CScreenSpyDlg(CWnd* Parent, IOCPServer* IOCPServer=NULL, CONTEXT_OBJECT *ContextObject=NULL);
virtual ~CScreenSpyDlg(); virtual ~CScreenSpyDlg();
CONTEXT_OBJECT* m_ContextObject; CONTEXT_OBJECT* m_ContextObject;
IOCPServer* m_iocpServer; IOCPServer* m_iocpServer;
VOID CScreenSpyDlg::SendNext(void); VOID SendNext(void);
VOID CScreenSpyDlg::OnReceiveComplete(); VOID OnReceiveComplete();
HDC m_hFullDC; HDC m_hFullDC;
HDC m_hFullMemDC; HDC m_hFullMemDC;
HBITMAP m_BitmapHandle; HBITMAP m_BitmapHandle;
PVOID m_BitmapData_Full; PVOID m_BitmapData_Full;
LPBITMAPINFO m_BitmapInfor_Full; LPBITMAPINFO m_BitmapInfor_Full;
VOID CScreenSpyDlg::DrawFirstScreen(void); VOID DrawFirstScreen(void);
VOID CScreenSpyDlg::DrawNextScreenDiff(void); VOID DrawNextScreenDiff(void);
BOOL m_bIsFirst; BOOL m_bIsFirst;
ULONG m_ulHScrollPos; ULONG m_ulHScrollPos;
ULONG m_ulVScrollPos; ULONG m_ulVScrollPos;
VOID CScreenSpyDlg::DrawTipString(CString strString); VOID DrawTipString(CString strString);
HICON m_hIcon; HICON m_hIcon;
HICON m_hCursor; HICON m_hCursor;
POINT m_ClientCursorPos; POINT m_ClientCursorPos;
BYTE m_bCursorIndex;
CString m_strClientIP; CString m_strClientIP;
BOOL m_bIsTraceCursor; BOOL m_bIsTraceCursor;
VOID CScreenSpyDlg::SendCommand(MSG* Msg); VOID SendCommand(MSG* Msg);
VOID CScreenSpyDlg::UpdateServerClipboard(char *szBuffer,ULONG ulLength); VOID UpdateServerClipboard(char *szBuffer,ULONG ulLength);
VOID CScreenSpyDlg::SendServerClipboard(void); VOID SendServerClipboard(void);
BOOL m_bIsCtrl; BOOL m_bIsCtrl;
LPBYTE m_szData; LPBYTE m_szData;
BOOL m_bSend; BOOL m_bSend;
ULONG m_ulMsgCount; ULONG m_ulMsgCount;
BOOL CScreenSpyDlg::SaveSnapshot(void); BOOL SaveSnapshot(void);
// <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> // <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
enum { IDD = IDD_DIALOG_SCREEN_SPY }; enum { IDD = IDD_DIALOG_SCREEN_SPY };

View File

@@ -81,7 +81,7 @@ int CServicesDlg::ShowServicesList(void)
m_ControlList.DeleteAllItems(); m_ControlList.DeleteAllItems();
int i = 0; int i = 0;
for (i = 0; dwOffset < m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1; i++) for (i = 0; dwOffset < m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1; ++i)
{ {
szDisplayName = szBuffer + dwOffset; szDisplayName = szBuffer + dwOffset;
szServiceName = szDisplayName + lstrlen(szDisplayName) +1; szServiceName = szDisplayName + lstrlen(szDisplayName) +1;
@@ -110,11 +110,15 @@ int CServicesDlg::ShowServicesList(void)
void CServicesDlg::OnClose() void CServicesDlg::OnClose()
{ {
// 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>ֵ // 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>ֵ
#if CLOSE_DELETE_DLG
m_ContextObject->v1 = 0; m_ContextObject->v1 = 0;
#endif
CancelIo((HANDLE)m_ContextObject->sClientSocket); CancelIo((HANDLE)m_ContextObject->sClientSocket);
closesocket(m_ContextObject->sClientSocket); closesocket(m_ContextObject->sClientSocket);
CDialog::OnClose(); CDialog::OnClose();
#if CLOSE_DELETE_DLG
delete this; delete this;
#endif
} }

View File

@@ -14,9 +14,9 @@ public:
virtual ~CServicesDlg(); virtual ~CServicesDlg();
CONTEXT_OBJECT* m_ContextObject; CONTEXT_OBJECT* m_ContextObject;
IOCPServer* m_iocpServer; IOCPServer* m_iocpServer;
int CServicesDlg::ShowServicesList(void); int ShowServicesList(void);
void CServicesDlg::OnReceiveComplete(void); void OnReceiveComplete(void);
void CServicesDlg::ServicesConfig(BYTE bCmd); void ServicesConfig(BYTE bCmd);
// <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> // <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
enum { IDD = IDD_DIALOG_SERVICES }; enum { IDD = IDD_DIALOG_SERVICES };

View File

@@ -111,12 +111,16 @@ VOID CShellDlg::AddKeyBoardData(void)
void CShellDlg::OnClose() void CShellDlg::OnClose()
{ {
#if CLOSE_DELETE_DLG
m_ContextObject->v1 = 0; m_ContextObject->v1 = 0;
#endif
CancelIo((HANDLE)m_ContextObject->sClientSocket); CancelIo((HANDLE)m_ContextObject->sClientSocket);
closesocket(m_ContextObject->sClientSocket); closesocket(m_ContextObject->sClientSocket);
CDialog::OnClose(); CDialog::OnClose();
#if CLOSE_DELETE_DLG
delete this; delete this;
#endif
} }

View File

@@ -13,10 +13,10 @@ public:
virtual ~CShellDlg(); virtual ~CShellDlg();
CONTEXT_OBJECT* m_ContextObject; CONTEXT_OBJECT* m_ContextObject;
IOCPServer* m_iocpServer; IOCPServer* m_iocpServer;
VOID CShellDlg::OnReceiveComplete(); VOID OnReceiveComplete();
HICON m_hIcon; HICON m_hIcon;
UINT m_nReceiveLength; UINT m_nReceiveLength;
VOID CShellDlg::AddKeyBoardData(void); VOID AddKeyBoardData(void);
UINT m_nCurSel; //<2F><><EFBFBD>õ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>; UINT m_nCurSel; //<2F><><EFBFBD>õ<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>;
// <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> // <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>

View File

@@ -98,7 +98,7 @@ void CSystemDlg::ShowWindowsList(void)
m_ControlList.DeleteAllItems(); m_ControlList.DeleteAllItems();
CString str; CString str;
int i ; int i ;
for ( i = 0; dwOffset <m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1; i++) for ( i = 0; dwOffset <m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1; ++i)
{ {
LPDWORD lpPID = LPDWORD(szBuffer + dwOffset); //<2F><><EFBFBD>ھ<EFBFBD><DABE><EFBFBD> LPDWORD lpPID = LPDWORD(szBuffer + dwOffset); //<2F><><EFBFBD>ھ<EFBFBD><DABE><EFBFBD>
szTitle = (char *)szBuffer + dwOffset + sizeof(DWORD); //<2F><><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD> szTitle = (char *)szBuffer + dwOffset + sizeof(DWORD); //<2F><><EFBFBD>ڱ<EFBFBD><DAB1><EFBFBD>
@@ -128,7 +128,7 @@ void CSystemDlg::ShowProcessList(void)
m_ControlList.DeleteAllItems(); m_ControlList.DeleteAllItems();
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿһ<C3BF><D2BB><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽṹ<DDBD><E1B9B9> Id+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+0+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+0 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿһ<C3BF><D2BB><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݽṹ<DDBD><E1B9B9> Id+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+0+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+0
int i; int i;
for (i = 0; dwOffset < m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1; i++) for (i = 0; dwOffset < m_ContextObject->InDeCompressedBuffer.GetBufferLength() - 1; ++i)
{ {
LPDWORD PID = LPDWORD(szBuffer + dwOffset); //<2F><><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>ID LPDWORD PID = LPDWORD(szBuffer + dwOffset); //<2F><><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>ID
szExeFile = szBuffer + dwOffset + sizeof(DWORD); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID֮<44><D6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> szExeFile = szBuffer + dwOffset + sizeof(DWORD); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ID֮<44><D6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@ -157,11 +157,15 @@ void CSystemDlg::ShowProcessList(void)
void CSystemDlg::OnClose() void CSystemDlg::OnClose()
{ {
// 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>ֵ // 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>ֵ
#if CLOSE_DELETE_DLG
m_ContextObject->v1 = 0; m_ContextObject->v1 = 0;
#endif
CancelIo((HANDLE)m_ContextObject->sClientSocket); CancelIo((HANDLE)m_ContextObject->sClientSocket);
closesocket(m_ContextObject->sClientSocket); closesocket(m_ContextObject->sClientSocket);
CDialog::OnClose(); CDialog::OnClose();
#if CLOSE_DELETE_DLG
delete this; delete this;
#endif
} }

View File

@@ -13,11 +13,11 @@ public:
virtual ~CSystemDlg(); virtual ~CSystemDlg();
CONTEXT_OBJECT* m_ContextObject; CONTEXT_OBJECT* m_ContextObject;
IOCPServer* m_iocpServer; IOCPServer* m_iocpServer;
VOID CSystemDlg::GetProcessList(void); VOID GetProcessList(void);
VOID CSystemDlg::ShowProcessList(void); VOID ShowProcessList(void);
void CSystemDlg::ShowWindowsList(void); void ShowWindowsList(void);
void CSystemDlg::GetWindowsList(void); void GetWindowsList(void);
void CSystemDlg::OnReceiveComplete(void); void OnReceiveComplete(void);
BOOL m_bHow; BOOL m_bHow;
// <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> // <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
enum { IDD = IDD_DIALOG_SYSTEM }; enum { IDD = IDD_DIALOG_SYSTEM };

View File

@@ -41,6 +41,8 @@ BOOL CTalkDlg::OnInitDialog()
{ {
CDialog::OnInitDialog(); CDialog::OnInitDialog();
m_hIcon = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME));
SetIcon(m_hIcon, FALSE);
BYTE bToken = COMMAND_NEXT; BYTE bToken = COMMAND_NEXT;
m_iocpServer->OnClientPreSending(m_ContextObject, &bToken, sizeof(BYTE)); m_iocpServer->OnClientPreSending(m_ContextObject, &bToken, sizeof(BYTE));
@@ -96,9 +98,13 @@ BOOL CTalkDlg::PreTranslateMessage(MSG* pMsg)
void CTalkDlg::OnClose() void CTalkDlg::OnClose()
{ {
// 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>ֵ // 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>ֵ
#if CLOSE_DELETE_DLG
m_ContextObject->v1 = 0; m_ContextObject->v1 = 0;
#endif
CancelIo((HANDLE)m_ContextObject->sClientSocket); CancelIo((HANDLE)m_ContextObject->sClientSocket);
closesocket(m_ContextObject->sClientSocket); closesocket(m_ContextObject->sClientSocket);
CDialog::OnClose(); CDialog::OnClose();
#if CLOSE_DELETE_DLG
delete this; delete this;
#endif
} }

View File

@@ -16,6 +16,7 @@ public:
enum { IDD = IDD_DIALOG_TALK }; enum { IDD = IDD_DIALOG_TALK };
CONTEXT_OBJECT* m_ContextObject; CONTEXT_OBJECT* m_ContextObject;
IOCPServer* m_iocpServer; IOCPServer* m_iocpServer;
HICON m_hIcon;
protected: protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧<><D6A7> virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧<><D6A7>

View File

@@ -118,7 +118,7 @@ void CTrueColorToolBar::AddDropDownButton(CWnd* pParent, UINT uButtonID, UINT uM
void CTrueColorToolBar::OnToolbarDropDown(NMHDR* pnmh, LRESULT *plr) void CTrueColorToolBar::OnToolbarDropDown(NMHDR* pnmh, LRESULT *plr)
{ {
NMTOOLBARA * pnmtb=(NMTOOLBARA *)pnmh; NMTOOLBARA * pnmtb=(NMTOOLBARA *)pnmh;
for (int i = 0; i < m_lstDropDownButton.GetSize(); i++) { for (int i = 0; i < m_lstDropDownButton.GetSize(); ++i) {
stDropDownInfo DropDownInfo = m_lstDropDownButton.GetAt(i); stDropDownInfo DropDownInfo = m_lstDropDownButton.GetAt(i);

View File

@@ -123,12 +123,16 @@ BOOL CVideoDlg::OnInitDialog()
void CVideoDlg::OnClose() void CVideoDlg::OnClose()
{ {
#if CLOSE_DELETE_DLG
m_ContextObject->v1 = 0; m_ContextObject->v1 = 0;
#endif
CancelIo((HANDLE)m_ContextObject->sClientSocket); CancelIo((HANDLE)m_ContextObject->sClientSocket);
closesocket(m_ContextObject->sClientSocket); closesocket(m_ContextObject->sClientSocket);
CDialog::OnClose(); CDialog::OnClose();
#if CLOSE_DELETE_DLG
delete this; delete this;
#endif
} }
void CVideoDlg::OnReceiveComplete(void) void CVideoDlg::OnReceiveComplete(void)

View File

@@ -152,11 +152,11 @@ public:
LPBITMAPINFO m_BitmapInfor_Full; LPBITMAPINFO m_BitmapInfor_Full;
BYTE* m_BitmapData_Full; BYTE* m_BitmapData_Full;
BYTE* m_BitmapCompressedData_Full; BYTE* m_BitmapCompressedData_Full;
void CVideoDlg::ResetScreen(void); void ResetScreen(void);
void CVideoDlg::OnReceiveComplete(void); void OnReceiveComplete(void);
void CVideoDlg::DrawDIB(void); void DrawDIB(void);
void CVideoDlg::InitCodec(DWORD fccHandler); void InitCodec(DWORD fccHandler);
HDC m_hDC; HDC m_hDC;
HDRAWDIB m_hDD; HDRAWDIB m_hDD;

631
server/2015Remote/lz4/lz4.h Normal file
View File

@@ -0,0 +1,631 @@
/*
* LZ4 - Fast LZ compression algorithm
* Header File
* Copyright (C) 2011-present, Yann Collet.
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
You can contact the author at :
- LZ4 homepage : http://www.lz4.org
- LZ4 source repository : https://github.com/lz4/lz4
*/
#if defined (__cplusplus)
extern "C" {
#endif
#ifndef LZ4_H_2983827168210
#define LZ4_H_2983827168210
/* --- Dependency --- */
#include <stddef.h> /* size_t */
/**
Introduction
LZ4 is lossless compression algorithm, providing compression speed at 500 MB/s per core,
scalable with multi-cores CPU. It features an extremely fast decoder, with speed in
multiple GB/s per core, typically reaching RAM speed limits on multi-core systems.
The LZ4 compression library provides in-memory compression and decompression functions.
Compression can be done in:
- a single step (described as Simple Functions)
- a single step, reusing a context (described in Advanced Functions)
- unbounded multiple steps (described as Streaming compression)
lz4.h provides block compression functions. It gives full buffer control to user.
Decompressing an lz4-compressed block also requires metadata (such as compressed size).
Each application is free to encode such metadata in whichever way it wants.
An additional format, called LZ4 frame specification (doc/lz4_Frame_format.md),
take care of encoding standard metadata alongside LZ4-compressed blocks.
Frame format is required for interoperability.
It is delivered through a companion API, declared in lz4frame.h.
*/
/*^***************************************************************
* Export parameters
*****************************************************************/
/*
* LZ4_DLL_EXPORT :
* Enable exporting of functions when building a Windows DLL
* LZ4LIB_VISIBILITY :
* Control library symbols visibility.
*/
#ifndef LZ4LIB_VISIBILITY
# if defined(__GNUC__) && (__GNUC__ >= 4)
# define LZ4LIB_VISIBILITY __attribute__ ((visibility ("default")))
# else
# define LZ4LIB_VISIBILITY
# endif
#endif
#if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1)
# define LZ4LIB_API __declspec(dllexport) LZ4LIB_VISIBILITY
#elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)
# define LZ4LIB_API __declspec(dllimport) LZ4LIB_VISIBILITY /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/
#else
# define LZ4LIB_API LZ4LIB_VISIBILITY
#endif
/*------ Version ------*/
#define LZ4_VERSION_MAJOR 1 /* for breaking interface changes */
#define LZ4_VERSION_MINOR 8 /* for new (non-breaking) interface capabilities */
#define LZ4_VERSION_RELEASE 3 /* for tweaks, bug-fixes, or development */
#define LZ4_VERSION_NUMBER (LZ4_VERSION_MAJOR *100*100 + LZ4_VERSION_MINOR *100 + LZ4_VERSION_RELEASE)
#define LZ4_LIB_VERSION LZ4_VERSION_MAJOR.LZ4_VERSION_MINOR.LZ4_VERSION_RELEASE
#define LZ4_QUOTE(str) #str
#define LZ4_EXPAND_AND_QUOTE(str) LZ4_QUOTE(str)
#define LZ4_VERSION_STRING LZ4_EXPAND_AND_QUOTE(LZ4_LIB_VERSION)
LZ4LIB_API int LZ4_versionNumber (void); /**< library version number; useful to check dll version */
LZ4LIB_API const char* LZ4_versionString (void); /**< library version string; unseful to check dll version */
/*-************************************
* Tuning parameter
**************************************/
/*!
* LZ4_MEMORY_USAGE :
* Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.)
* Increasing memory usage improves compression ratio
* Reduced memory usage may improve speed, thanks to cache effect
* Default value is 14, for 16KB, which nicely fits into Intel x86 L1 cache
*/
#ifndef LZ4_MEMORY_USAGE
# define LZ4_MEMORY_USAGE 14
#endif
/*-************************************
* Simple Functions
**************************************/
/*! LZ4_compress_default() :
Compresses 'srcSize' bytes from buffer 'src'
into already allocated 'dst' buffer of size 'dstCapacity'.
Compression is guaranteed to succeed if 'dstCapacity' >= LZ4_compressBound(srcSize).
It also runs faster, so it's a recommended setting.
If the function cannot compress 'src' into a more limited 'dst' budget,
compression stops *immediately*, and the function result is zero.
Note : as a consequence, 'dst' content is not valid.
Note 2 : This function is protected against buffer overflow scenarios (never writes outside 'dst' buffer, nor read outside 'source' buffer).
srcSize : max supported value is LZ4_MAX_INPUT_SIZE.
dstCapacity : size of buffer 'dst' (which must be already allocated)
return : the number of bytes written into buffer 'dst' (necessarily <= dstCapacity)
or 0 if compression fails */
LZ4LIB_API int LZ4_compress_default(const char* src, char* dst, int srcSize, int dstCapacity);
/*! LZ4_decompress_safe() :
compressedSize : is the exact complete size of the compressed block.
dstCapacity : is the size of destination buffer, which must be already allocated.
return : the number of bytes decompressed into destination buffer (necessarily <= dstCapacity)
If destination buffer is not large enough, decoding will stop and output an error code (negative value).
If the source stream is detected malformed, the function will stop decoding and return a negative result.
This function is protected against malicious data packets.
*/
LZ4LIB_API int LZ4_decompress_safe (const char* src, char* dst, int compressedSize, int dstCapacity);
/*-************************************
* Advanced Functions
**************************************/
#define LZ4_MAX_INPUT_SIZE 0x7E000000 /* 2 113 929 216 bytes */
#define LZ4_COMPRESSBOUND(isize) ((unsigned)(isize) > (unsigned)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16)
/*!
LZ4_compressBound() :
Provides the maximum size that LZ4 compression may output in a "worst case" scenario (input data not compressible)
This function is primarily useful for memory allocation purposes (destination buffer size).
Macro LZ4_COMPRESSBOUND() is also provided for compilation-time evaluation (stack memory allocation for example).
Note that LZ4_compress_default() compresses faster when dstCapacity is >= LZ4_compressBound(srcSize)
inputSize : max supported value is LZ4_MAX_INPUT_SIZE
return : maximum output size in a "worst case" scenario
or 0, if input size is incorrect (too large or negative)
*/
LZ4LIB_API int LZ4_compressBound(int inputSize);
/*!
LZ4_compress_fast() :
Same as LZ4_compress_default(), but allows selection of "acceleration" factor.
The larger the acceleration value, the faster the algorithm, but also the lesser the compression.
It's a trade-off. It can be fine tuned, with each successive value providing roughly +~3% to speed.
An acceleration value of "1" is the same as regular LZ4_compress_default()
Values <= 0 will be replaced by ACCELERATION_DEFAULT (currently == 1, see lz4.c).
*/
LZ4LIB_API int LZ4_compress_fast (const char* src, char* dst, int srcSize, int dstCapacity, int acceleration);
/*!
LZ4_compress_fast_extState() :
Same compression function, just using an externally allocated memory space to store compression state.
Use LZ4_sizeofState() to know how much memory must be allocated,
and allocate it on 8-bytes boundaries (using malloc() typically).
Then, provide this buffer as 'void* state' to compression function.
*/
LZ4LIB_API int LZ4_sizeofState(void);
LZ4LIB_API int LZ4_compress_fast_extState (void* state, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration);
/*! LZ4_compress_destSize() :
* Reverse the logic : compresses as much data as possible from 'src' buffer
* into already allocated buffer 'dst', of size >= 'targetDestSize'.
* This function either compresses the entire 'src' content into 'dst' if it's large enough,
* or fill 'dst' buffer completely with as much data as possible from 'src'.
* note: acceleration parameter is fixed to "default".
*
* *srcSizePtr : will be modified to indicate how many bytes where read from 'src' to fill 'dst'.
* New value is necessarily <= input value.
* @return : Nb bytes written into 'dst' (necessarily <= targetDestSize)
* or 0 if compression fails.
*/
LZ4LIB_API int LZ4_compress_destSize (const char* src, char* dst, int* srcSizePtr, int targetDstSize);
/*! LZ4_decompress_fast() : **unsafe!**
* This function used to be a bit faster than LZ4_decompress_safe(),
* though situation has changed in recent versions,
* and now `LZ4_decompress_safe()` can be as fast and sometimes faster than `LZ4_decompress_fast()`.
* Moreover, LZ4_decompress_fast() is not protected vs malformed input, as it doesn't perform full validation of compressed data.
* As a consequence, this function is no longer recommended, and may be deprecated in future versions.
* It's only remaining specificity is that it can decompress data without knowing its compressed size.
*
* originalSize : is the uncompressed size to regenerate.
* `dst` must be already allocated, its size must be >= 'originalSize' bytes.
* @return : number of bytes read from source buffer (== compressed size).
* If the source stream is detected malformed, the function stops decoding and returns a negative result.
* note : This function requires uncompressed originalSize to be known in advance.
* The function never writes past the output buffer.
* However, since it doesn't know its 'src' size, it may read past the intended input.
* Also, because match offsets are not validated during decoding,
* reads from 'src' may underflow.
* Use this function in trusted environment **only**.
*/
LZ4LIB_API int LZ4_decompress_fast (const char* src, char* dst, int originalSize);
/*! LZ4_decompress_safe_partial() :
* Decompress an LZ4 compressed block, of size 'srcSize' at position 'src',
* into destination buffer 'dst' of size 'dstCapacity'.
* Up to 'targetOutputSize' bytes will be decoded.
* The function stops decoding on reaching this objective,
* which can boost performance when only the beginning of a block is required.
*
* @return : the number of bytes decoded in `dst` (necessarily <= dstCapacity)
* If source stream is detected malformed, function returns a negative result.
*
* Note : @return can be < targetOutputSize, if compressed block contains less data.
*
* Note 2 : this function features 2 parameters, targetOutputSize and dstCapacity,
* and expects targetOutputSize <= dstCapacity.
* It effectively stops decoding on reaching targetOutputSize,
* so dstCapacity is kind of redundant.
* This is because in a previous version of this function,
* decoding operation would not "break" a sequence in the middle.
* As a consequence, there was no guarantee that decoding would stop at exactly targetOutputSize,
* it could write more bytes, though only up to dstCapacity.
* Some "margin" used to be required for this operation to work properly.
* This is no longer necessary.
* The function nonetheless keeps its signature, in an effort to not break API.
*/
LZ4LIB_API int LZ4_decompress_safe_partial (const char* src, char* dst, int srcSize, int targetOutputSize, int dstCapacity);
/*-*********************************************
* Streaming Compression Functions
***********************************************/
typedef union LZ4_stream_u LZ4_stream_t; /* incomplete type (defined later) */
/*! LZ4_createStream() and LZ4_freeStream() :
* LZ4_createStream() will allocate and initialize an `LZ4_stream_t` structure.
* LZ4_freeStream() releases its memory.
*/
LZ4LIB_API LZ4_stream_t* LZ4_createStream(void);
LZ4LIB_API int LZ4_freeStream (LZ4_stream_t* streamPtr);
/*! LZ4_resetStream() :
* An LZ4_stream_t structure can be allocated once and re-used multiple times.
* Use this function to start compressing a new stream.
*/
LZ4LIB_API void LZ4_resetStream (LZ4_stream_t* streamPtr);
/*! LZ4_loadDict() :
* Use this function to load a static dictionary into LZ4_stream_t.
* Any previous data will be forgotten, only 'dictionary' will remain in memory.
* Loading a size of 0 is allowed, and is the same as reset.
* @return : dictionary size, in bytes (necessarily <= 64 KB)
*/
LZ4LIB_API int LZ4_loadDict (LZ4_stream_t* streamPtr, const char* dictionary, int dictSize);
/*! LZ4_compress_fast_continue() :
* Compress 'src' content using data from previously compressed blocks, for better compression ratio.
* 'dst' buffer must be already allocated.
* If dstCapacity >= LZ4_compressBound(srcSize), compression is guaranteed to succeed, and runs faster.
*
* @return : size of compressed block
* or 0 if there is an error (typically, cannot fit into 'dst').
*
* Note 1 : Each invocation to LZ4_compress_fast_continue() generates a new block.
* Each block has precise boundaries.
* It's not possible to append blocks together and expect a single invocation of LZ4_decompress_*() to decompress them together.
* Each block must be decompressed separately, calling LZ4_decompress_*() with associated metadata.
*
* Note 2 : The previous 64KB of source data is __assumed__ to remain present, unmodified, at same address in memory!
*
* Note 3 : When input is structured as a double-buffer, each buffer can have any size, including < 64 KB.
* Make sure that buffers are separated, by at least one byte.
* This construction ensures that each block only depends on previous block.
*
* Note 4 : If input buffer is a ring-buffer, it can have any size, including < 64 KB.
*
* Note 5 : After an error, the stream status is invalid, it can only be reset or freed.
*/
LZ4LIB_API int LZ4_compress_fast_continue (LZ4_stream_t* streamPtr, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration);
/*! LZ4_saveDict() :
* If last 64KB data cannot be guaranteed to remain available at its current memory location,
* save it into a safer place (char* safeBuffer).
* This is schematically equivalent to a memcpy() followed by LZ4_loadDict(),
* but is much faster, because LZ4_saveDict() doesn't need to rebuild tables.
* @return : saved dictionary size in bytes (necessarily <= maxDictSize), or 0 if error.
*/
LZ4LIB_API int LZ4_saveDict (LZ4_stream_t* streamPtr, char* safeBuffer, int maxDictSize);
/*-**********************************************
* Streaming Decompression Functions
* Bufferless synchronous API
************************************************/
typedef union LZ4_streamDecode_u LZ4_streamDecode_t; /* tracking context */
/*! LZ4_createStreamDecode() and LZ4_freeStreamDecode() :
* creation / destruction of streaming decompression tracking context.
* A tracking context can be re-used multiple times.
*/
LZ4LIB_API LZ4_streamDecode_t* LZ4_createStreamDecode(void);
LZ4LIB_API int LZ4_freeStreamDecode (LZ4_streamDecode_t* LZ4_stream);
/*! LZ4_setStreamDecode() :
* An LZ4_streamDecode_t context can be allocated once and re-used multiple times.
* Use this function to start decompression of a new stream of blocks.
* A dictionary can optionally be set. Use NULL or size 0 for a reset order.
* Dictionary is presumed stable : it must remain accessible and unmodified during next decompression.
* @return : 1 if OK, 0 if error
*/
LZ4LIB_API int LZ4_setStreamDecode (LZ4_streamDecode_t* LZ4_streamDecode, const char* dictionary, int dictSize);
/*! LZ4_decoderRingBufferSize() : v1.8.2
* Note : in a ring buffer scenario (optional),
* blocks are presumed decompressed next to each other
* up to the moment there is not enough remaining space for next block (remainingSize < maxBlockSize),
* at which stage it resumes from beginning of ring buffer.
* When setting such a ring buffer for streaming decompression,
* provides the minimum size of this ring buffer
* to be compatible with any source respecting maxBlockSize condition.
* @return : minimum ring buffer size,
* or 0 if there is an error (invalid maxBlockSize).
*/
LZ4LIB_API int LZ4_decoderRingBufferSize(int maxBlockSize);
#define LZ4_DECODER_RING_BUFFER_SIZE(mbs) (65536 + 14 + (mbs)) /* for static allocation; mbs presumed valid */
/*! LZ4_decompress_*_continue() :
* These decoding functions allow decompression of consecutive blocks in "streaming" mode.
* A block is an unsplittable entity, it must be presented entirely to a decompression function.
* Decompression functions only accepts one block at a time.
* The last 64KB of previously decoded data *must* remain available and unmodified at the memory position where they were decoded.
* If less than 64KB of data has been decoded, all the data must be present.
*
* Special : if decompression side sets a ring buffer, it must respect one of the following conditions :
* - Decompression buffer size is _at least_ LZ4_decoderRingBufferSize(maxBlockSize).
* maxBlockSize is the maximum size of any single block. It can have any value > 16 bytes.
* In which case, encoding and decoding buffers do not need to be synchronized.
* Actually, data can be produced by any source compliant with LZ4 format specification, and respecting maxBlockSize.
* - Synchronized mode :
* Decompression buffer size is _exactly_ the same as compression buffer size,
* and follows exactly same update rule (block boundaries at same positions),
* and decoding function is provided with exact decompressed size of each block (exception for last block of the stream),
* _then_ decoding & encoding ring buffer can have any size, including small ones ( < 64 KB).
* - Decompression buffer is larger than encoding buffer, by a minimum of maxBlockSize more bytes.
* In which case, encoding and decoding buffers do not need to be synchronized,
* and encoding ring buffer can have any size, including small ones ( < 64 KB).
*
* Whenever these conditions are not possible,
* save the last 64KB of decoded data into a safe buffer where it can't be modified during decompression,
* then indicate where this data is saved using LZ4_setStreamDecode(), before decompressing next block.
*/
LZ4LIB_API int LZ4_decompress_safe_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* src, char* dst, int srcSize, int dstCapacity);
LZ4LIB_API int LZ4_decompress_fast_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* src, char* dst, int originalSize);
/*! LZ4_decompress_*_usingDict() :
* These decoding functions work the same as
* a combination of LZ4_setStreamDecode() followed by LZ4_decompress_*_continue()
* They are stand-alone, and don't need an LZ4_streamDecode_t structure.
* Dictionary is presumed stable : it must remain accessible and unmodified during next decompression.
*/
LZ4LIB_API int LZ4_decompress_safe_usingDict (const char* src, char* dst, int srcSize, int dstCapcity, const char* dictStart, int dictSize);
LZ4LIB_API int LZ4_decompress_fast_usingDict (const char* src, char* dst, int originalSize, const char* dictStart, int dictSize);
/*^**********************************************
* !!!!!! STATIC LINKING ONLY !!!!!!
***********************************************/
/*-************************************
* Unstable declarations
**************************************
* Declarations in this section should be considered unstable.
* Use at your own peril, etc., etc.
* They may be removed in the future.
* Their signatures may change.
**************************************/
#ifdef LZ4_STATIC_LINKING_ONLY
/*! LZ4_resetStream_fast() :
* Use this, like LZ4_resetStream(), to prepare a context for a new chain of
* calls to a streaming API (e.g., LZ4_compress_fast_continue()).
*
* Note:
* Using this in advance of a non- streaming-compression function is redundant,
* and potentially bad for performance, since they all perform their own custom
* reset internally.
*
* Differences from LZ4_resetStream():
* When an LZ4_stream_t is known to be in a internally coherent state,
* it can often be prepared for a new compression with almost no work, only
* sometimes falling back to the full, expensive reset that is always required
* when the stream is in an indeterminate state (i.e., the reset performed by
* LZ4_resetStream()).
*
* LZ4_streams are guaranteed to be in a valid state when:
* - returned from LZ4_createStream()
* - reset by LZ4_resetStream()
* - memset(stream, 0, sizeof(LZ4_stream_t)), though this is discouraged
* - the stream was in a valid state and was reset by LZ4_resetStream_fast()
* - the stream was in a valid state and was then used in any compression call
* that returned success
* - the stream was in an indeterminate state and was used in a compression
* call that fully reset the state (e.g., LZ4_compress_fast_extState()) and
* that returned success
*
* When a stream isn't known to be in a valid state, it is not safe to pass to
* any fastReset or streaming function. It must first be cleansed by the full
* LZ4_resetStream().
*/
LZ4LIB_API void LZ4_resetStream_fast (LZ4_stream_t* streamPtr);
/*! LZ4_compress_fast_extState_fastReset() :
* A variant of LZ4_compress_fast_extState().
*
* Using this variant avoids an expensive initialization step. It is only safe
* to call if the state buffer is known to be correctly initialized already
* (see above comment on LZ4_resetStream_fast() for a definition of "correctly
* initialized"). From a high level, the difference is that this function
* initializes the provided state with a call to something like
* LZ4_resetStream_fast() while LZ4_compress_fast_extState() starts with a
* call to LZ4_resetStream().
*/
LZ4LIB_API int LZ4_compress_fast_extState_fastReset (void* state, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration);
/*! LZ4_attach_dictionary() :
* This is an experimental API that allows for the efficient use of a
* static dictionary many times.
*
* Rather than re-loading the dictionary buffer into a working context before
* each compression, or copying a pre-loaded dictionary's LZ4_stream_t into a
* working LZ4_stream_t, this function introduces a no-copy setup mechanism,
* in which the working stream references the dictionary stream in-place.
*
* Several assumptions are made about the state of the dictionary stream.
* Currently, only streams which have been prepared by LZ4_loadDict() should
* be expected to work.
*
* Alternatively, the provided dictionary stream pointer may be NULL, in which
* case any existing dictionary stream is unset.
*
* If a dictionary is provided, it replaces any pre-existing stream history.
* The dictionary contents are the only history that can be referenced and
* logically immediately precede the data compressed in the first subsequent
* compression call.
*
* The dictionary will only remain attached to the working stream through the
* first compression call, at the end of which it is cleared. The dictionary
* stream (and source buffer) must remain in-place / accessible / unchanged
* through the completion of the first compression call on the stream.
*/
LZ4LIB_API void LZ4_attach_dictionary(LZ4_stream_t *working_stream, const LZ4_stream_t *dictionary_stream);
#endif
/*-************************************
* Private definitions
**************************************
* Do not use these definitions.
* They are exposed to allow static allocation of `LZ4_stream_t` and `LZ4_streamDecode_t`.
* Using these definitions will expose code to API and/or ABI break in future versions of the library.
**************************************/
#define LZ4_HASHLOG (LZ4_MEMORY_USAGE-2)
#define LZ4_HASHTABLESIZE (1 << LZ4_MEMORY_USAGE)
#define LZ4_HASH_SIZE_U32 (1 << LZ4_HASHLOG) /* required as macro for static allocation */
#if defined(__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */)
#include <stdint.h>
typedef struct LZ4_stream_t_internal LZ4_stream_t_internal;
struct LZ4_stream_t_internal {
uint32_t hashTable[LZ4_HASH_SIZE_U32];
uint32_t currentOffset;
uint16_t initCheck;
uint16_t tableType;
const uint8_t* dictionary;
const LZ4_stream_t_internal* dictCtx;
uint32_t dictSize;
};
typedef struct {
const uint8_t* externalDict;
size_t extDictSize;
const uint8_t* prefixEnd;
size_t prefixSize;
} LZ4_streamDecode_t_internal;
#else
typedef struct LZ4_stream_t_internal LZ4_stream_t_internal;
struct LZ4_stream_t_internal {
unsigned int hashTable[LZ4_HASH_SIZE_U32];
unsigned int currentOffset;
unsigned short initCheck;
unsigned short tableType;
const unsigned char* dictionary;
const LZ4_stream_t_internal* dictCtx;
unsigned int dictSize;
};
typedef struct {
const unsigned char* externalDict;
size_t extDictSize;
const unsigned char* prefixEnd;
size_t prefixSize;
} LZ4_streamDecode_t_internal;
#endif
/*!
* LZ4_stream_t :
* information structure to track an LZ4 stream.
* init this structure before first use.
* note : only use in association with static linking !
* this definition is not API/ABI safe,
* it may change in a future version !
*/
#define LZ4_STREAMSIZE_U64 ((1 << (LZ4_MEMORY_USAGE-3)) + 4)
#define LZ4_STREAMSIZE (LZ4_STREAMSIZE_U64 * sizeof(unsigned long long))
union LZ4_stream_u {
unsigned long long table[LZ4_STREAMSIZE_U64];
LZ4_stream_t_internal internal_donotuse;
} ; /* previously typedef'd to LZ4_stream_t */
/*!
* LZ4_streamDecode_t :
* information structure to track an LZ4 stream during decompression.
* init this structure using LZ4_setStreamDecode (or memset()) before first use
* note : only use in association with static linking !
* this definition is not API/ABI safe,
* and may change in a future version !
*/
#define LZ4_STREAMDECODESIZE_U64 4
#define LZ4_STREAMDECODESIZE (LZ4_STREAMDECODESIZE_U64 * sizeof(unsigned long long))
union LZ4_streamDecode_u {
unsigned long long table[LZ4_STREAMDECODESIZE_U64];
LZ4_streamDecode_t_internal internal_donotuse;
} ; /* previously typedef'd to LZ4_streamDecode_t */
/*-************************************
* Obsolete Functions
**************************************/
/*! Deprecation warnings
Should deprecation warnings be a problem,
it is generally possible to disable them,
typically with -Wno-deprecated-declarations for gcc
or _CRT_SECURE_NO_WARNINGS in Visual.
Otherwise, it's also possible to define LZ4_DISABLE_DEPRECATE_WARNINGS */
#ifdef LZ4_DISABLE_DEPRECATE_WARNINGS
# define LZ4_DEPRECATED(message) /* disable deprecation warnings */
#else
# define LZ4_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
# if defined (__cplusplus) && (__cplusplus >= 201402) /* C++14 or greater */
# define LZ4_DEPRECATED(message) [[deprecated(message)]]
# elif (LZ4_GCC_VERSION >= 405) || defined(__clang__)
# define LZ4_DEPRECATED(message) __attribute__((deprecated(message)))
# elif (LZ4_GCC_VERSION >= 301)
# define LZ4_DEPRECATED(message) __attribute__((deprecated))
# elif defined(_MSC_VER)
# define LZ4_DEPRECATED(message) __declspec(deprecated(message))
# else
# pragma message("WARNING: You need to implement LZ4_DEPRECATED for this compiler")
# define LZ4_DEPRECATED(message)
# endif
#endif /* LZ4_DISABLE_DEPRECATE_WARNINGS */
/* Obsolete compression functions */
LZ4_DEPRECATED("use LZ4_compress_default() instead") LZ4LIB_API int LZ4_compress (const char* source, char* dest, int sourceSize);
LZ4_DEPRECATED("use LZ4_compress_default() instead") LZ4LIB_API int LZ4_compress_limitedOutput (const char* source, char* dest, int sourceSize, int maxOutputSize);
LZ4_DEPRECATED("use LZ4_compress_fast_extState() instead") LZ4LIB_API int LZ4_compress_withState (void* state, const char* source, char* dest, int inputSize);
LZ4_DEPRECATED("use LZ4_compress_fast_extState() instead") LZ4LIB_API int LZ4_compress_limitedOutput_withState (void* state, const char* source, char* dest, int inputSize, int maxOutputSize);
LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead") LZ4LIB_API int LZ4_compress_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize);
LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead") LZ4LIB_API int LZ4_compress_limitedOutput_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize, int maxOutputSize);
/* Obsolete decompression functions */
LZ4_DEPRECATED("use LZ4_decompress_fast() instead") LZ4LIB_API int LZ4_uncompress (const char* source, char* dest, int outputSize);
LZ4_DEPRECATED("use LZ4_decompress_safe() instead") LZ4LIB_API int LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int maxOutputSize);
/* Obsolete streaming functions; degraded functionality; do not use!
*
* In order to perform streaming compression, these functions depended on data
* that is no longer tracked in the state. They have been preserved as well as
* possible: using them will still produce a correct output. However, they don't
* actually retain any history between compression calls. The compression ratio
* achieved will therefore be no better than compressing each chunk
* independently.
*/
LZ4_DEPRECATED("Use LZ4_createStream() instead") LZ4LIB_API void* LZ4_create (char* inputBuffer);
LZ4_DEPRECATED("Use LZ4_createStream() instead") LZ4LIB_API int LZ4_sizeofStreamState(void);
LZ4_DEPRECATED("Use LZ4_resetStream() instead") LZ4LIB_API int LZ4_resetStreamState(void* state, char* inputBuffer);
LZ4_DEPRECATED("Use LZ4_saveDict() instead") LZ4LIB_API char* LZ4_slideInputBuffer (void* state);
/* Obsolete streaming decoding functions */
LZ4_DEPRECATED("use LZ4_decompress_safe_usingDict() instead") LZ4LIB_API int LZ4_decompress_safe_withPrefix64k (const char* src, char* dst, int compressedSize, int maxDstSize);
LZ4_DEPRECATED("use LZ4_decompress_fast_usingDict() instead") LZ4LIB_API int LZ4_decompress_fast_withPrefix64k (const char* src, char* dst, int originalSize);
#endif /* LZ4_H_2983827168210 */
#if defined (__cplusplus)
}
#endif

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

View File

@@ -5,6 +5,14 @@
#pragma once #pragma once
// <20>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>ZLIB
#define USING_ZLIB 0
#if !USING_ZLIB
// <20>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>LZ4
#define USING_LZ4 1
#endif
#ifndef _SECURE_ATL #ifndef _SECURE_ATL
#define _SECURE_ATL 1 #define _SECURE_ATL 1
#endif #endif
@@ -16,6 +24,9 @@
// <20>Ƴ<EFBFBD><C6B3>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD>MFC<46>ؼ<EFBFBD><D8BC><EFBFBD>֧<EFBFBD>֣<EFBFBD><D6A3><EFBFBD>С<EFBFBD><D0A1>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>С // <20>Ƴ<EFBFBD><C6B3>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD>MFC<46>ؼ<EFBFBD><D8BC><EFBFBD>֧<EFBFBD>֣<EFBFBD><D6A3><EFBFBD>С<EFBFBD><D0A1>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD>С
#define _AFX_NO_MFC_CONTROLS_IN_DIALOGS #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS
// <20>رնԻ<D5B6><D4BB><EFBFBD>ʱɾ<CAB1><C9BE><EFBFBD>Ի<EFBFBD><D4BB><EFBFBD>
#define CLOSE_DELETE_DLG 0
// <20><><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>й©<D0B9><C2A9><EFBFBD>谲װVLD<4C><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD> // <20><><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>й©<D0B9><C2A9><EFBFBD>谲װVLD<4C><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>
#include "vld.h" #include "vld.h"

View File

@@ -1,102 +1,257 @@
/* zconf.h -- configuration of the zlib compression library /* 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 * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
/* @(#) $Id$ */ /* @(#) $Id$ */
#ifndef _ZCONF_H #ifndef ZCONF_H
#define _ZCONF_H #define ZCONF_H
/* /*
* If you *really* need a unique prefix for all types and library functions, * 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. * 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 #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
# define deflateInit_ z_deflateInit_ # define Z_PREFIX_SET
# 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 deflateCopy z_deflateCopy
# define deflateReset z_deflateReset
# define deflateParams z_deflateParams
# define inflateInit2_ z_inflateInit2_
# 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 uncompress z_uncompress
# define adler32 z_adler32
# define crc32 z_crc32
# define get_crc_table z_get_crc_table
# define Byte z_Byte /* all linked symbols and init macros */
# define uInt z_uInt # define _dist_code z__dist_code
# define uLong z_uLong # define _length_code z__length_code
# define Bytef z_Bytef # define _tr_align z__tr_align
# define charf z_charf # define _tr_flush_bits z__tr_flush_bits
# define intf z_intf # define _tr_flush_block z__tr_flush_block
# define uIntf z_uIntf # define _tr_init z__tr_init
# define uLongf z_uLongf # define _tr_stored_block z__tr_stored_block
# define voidpf z_voidpf # define _tr_tally z__tr_tally
# define voidp z_voidp # define adler32 z_adler32
#endif # define adler32_combine z_adler32_combine
# define adler32_combine64 z_adler32_combine64
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) # define adler32_z z_adler32_z
# define WIN32 # ifndef Z_SOLO
#endif # define compress z_compress
#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386) # define compress2 z_compress2
# ifndef __32BIT__ # define compressBound z_compressBound
# define __32BIT__
# endif # 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 deflateBound z_deflateBound
# define deflateCopy z_deflateCopy
# 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 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 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 #endif
#if defined(__MSDOS__) && !defined(MSDOS) #if defined(__MSDOS__) && !defined(MSDOS)
# define MSDOS # define MSDOS
#endif #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 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
* than 64k bytes at a time (needed on systems with 16-bit int). * than 64k bytes at a time (needed on systems with 16-bit int).
*/ */
#if defined(MSDOS) && !defined(__32BIT__) #ifdef SYS16BIT
# define MAXSEG_64K # define MAXSEG_64K
#endif #endif
#ifdef MSDOS #ifdef MSDOS
# define UNALIGNED_OK # define UNALIGNED_OK
#endif #endif
#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC) #ifdef __STDC_VERSION__
# define STDC
#endif
#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
# ifndef STDC # ifndef STDC
# define STDC # define STDC
# endif # 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 #endif
#ifndef STDC #ifndef STDC
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
# define const # define const /* note: need a more gentle solution here */
# endif # endif
#endif #endif
/* Some Mac compilers merge all .h files incorrectly: */ #if defined(ZLIB_CONST) && !defined(z_const)
#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__) # define z_const const
# define NO_DUMMY_DECL #else
# define z_const
#endif #endif
/* Old Borland C incorrectly complains about missing returns: */ #ifdef Z_SOLO
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500) typedef unsigned long z_size_t;
# define NEED_DUMMY_RETURN #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 #endif
/* Maximum value for memLevel in deflateInit2 */ /* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL #ifndef MAX_MEM_LEVEL
# ifdef MAXSEG_64K # ifdef MAXSEG_64K
@@ -124,7 +279,7 @@
Of course this will generally degrade compression (there's no free lunch). Of course this will generally degrade compression (there's no free lunch).
The memory requirements for inflate are (in bytes) 1 << windowBits 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. for small objects.
*/ */
@@ -138,79 +293,101 @@
# endif # endif
#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 /* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations). * model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have * 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, * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
* just define FAR to be empty. * just define FAR to be empty.
*/ */
#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__) #ifdef SYS16BIT
/* MSC small or medium model */ # if defined(M_I86SM) || defined(M_I86MM)
# define SMALL_MEDIUM /* MSC small or medium model */
# ifdef _MSC_VER
# define FAR _far
# else
# define FAR far
# endif
#endif
#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
# ifndef __32BIT__
# define SMALL_MEDIUM # define SMALL_MEDIUM
# define FAR _far # ifdef _MSC_VER
# define FAR _far
# else
# define FAR far
# endif
# 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
#endif #endif
/* Compile with -DZLIB_DLL for Windows DLL support */ #if defined(WINDOWS) || defined(WIN32)
#if defined(ZLIB_DLL) /* If building or using zlib as a DLL, define ZLIB_DLL.
# if defined(_WINDOWS) || defined(WINDOWS) * 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 # ifdef FAR
# undef FAR # undef FAR
# endif # endif
# include <windows.h> # include <windows.h>
# define ZEXPORT WINAPI /* No need for _export, use ZLIB.DEF instead. */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
# define ZEXPORT WINAPI
# ifdef WIN32 # ifdef WIN32
# define ZEXPORTVA WINAPIV # define ZEXPORTVA WINAPIV
# else # else
# define ZEXPORTVA FAR _cdecl _export # define ZEXPORTVA FAR CDECL
# 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
# endif # endif
# endif # endif
#endif #endif
#if defined (__BEOS__) #if defined (__BEOS__)
# if defined (ZLIB_DLL) # ifdef ZLIB_DLL
# define ZEXTERN extern __declspec(dllexport) # ifdef ZLIB_INTERNAL
# else # define ZEXPORT __declspec(dllexport)
# define ZEXTERN extern __declspec(dllimport) # define ZEXPORTVA __declspec(dllexport)
# else
# define ZEXPORT __declspec(dllimport)
# define ZEXPORTVA __declspec(dllimport)
# endif
# endif # endif
#endif #endif
#ifndef ZEXTERN
# define ZEXTERN extern
#endif
#ifndef ZEXPORT #ifndef ZEXPORT
# define ZEXPORT # define ZEXPORT
#endif #endif
#ifndef ZEXPORTVA #ifndef ZEXPORTVA
# define ZEXPORTVA # define ZEXPORTVA
#endif #endif
#ifndef ZEXTERN
# define ZEXTERN extern
#endif
#ifndef FAR #ifndef FAR
# define FAR # define FAR
#endif #endif
#if !defined(MACOS) && !defined(TARGET_OS_MAC) #if !defined(__MACTYPES__)
typedef unsigned char Byte; /* 8 bits */ typedef unsigned char Byte; /* 8 bits */
#endif #endif
typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned int uInt; /* 16 bits or more */
@@ -228,52 +405,130 @@ typedef uInt FAR uIntf;
typedef uLong FAR uLongf; typedef uLong FAR uLongf;
#ifdef STDC #ifdef STDC
typedef void FAR *voidpf; typedef void const *voidpc;
typedef void *voidp; typedef void FAR *voidpf;
typedef void *voidp;
#else #else
typedef Byte FAR *voidpf; typedef Byte const *voidpc;
typedef Byte *voidp; typedef Byte FAR *voidpf;
typedef Byte *voidp;
#endif #endif
#ifdef HAVE_UNISTD_H #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
# include <sys/types.h> /* for off_t */ # include <limits.h>
# include <unistd.h> /* for SEEK_* and off_t */ # if (UINT_MAX == 0xffffffffUL)
# define z_off_t off_t # define Z_U4 unsigned
# elif (ULONG_MAX == 0xffffffffUL)
# define Z_U4 unsigned long
# elif (USHRT_MAX == 0xffffffffUL)
# define Z_U4 unsigned short
# endif
#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_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif #endif
#ifndef z_off_t #ifndef z_off_t
# define z_off_t long # define z_off_t long
#endif
#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
/* MVS linker does not support external names larger than 8 bytes */ /* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__) #if defined(__MVS__)
# pragma map(deflateInit_,"DEIN") #pragma map(deflateInit_,"DEIN")
# pragma map(deflateInit2_,"DEIN2") #pragma map(deflateInit2_,"DEIN2")
# pragma map(deflateEnd,"DEEND") #pragma map(deflateEnd,"DEEND")
# pragma map(inflateInit_,"ININ") #pragma map(deflateBound,"DEBND")
# pragma map(inflateInit2_,"ININ2") #pragma map(inflateInit_,"ININ")
# pragma map(inflateEnd,"INEND") #pragma map(inflateInit2_,"ININ2")
# pragma map(inflateSync,"INSY") #pragma map(inflateEnd,"INEND")
# pragma map(inflateSetDictionary,"INSEDI") #pragma map(inflateSync,"INSY")
# pragma map(inflate_blocks,"INBL") #pragma map(inflateSetDictionary,"INSEDI")
# pragma map(inflate_blocks_new,"INBLNE") #pragma map(compressBound,"CMBND")
# pragma map(inflate_blocks_free,"INBLFR") #pragma map(inflate_table,"INTABL")
# pragma map(inflate_blocks_reset,"INBLRE") #pragma map(inflate_fast,"INFA")
# pragma map(inflate_codes_free,"INCOFR") #pragma map(inflate_copyright,"INCOPY")
# 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")
#endif #endif
#endif /* _ZCONF_H */ #endif /* ZCONF_H */

File diff suppressed because it is too large Load Diff

BIN
server/2015Remote/zlib.lib Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.