Merge pull request #67 from yuanyuanxiang/bugFix

fix: #64 Size of MSG is different on Win32 and Win64
This commit is contained in:
yuanyuanxiang
2025-04-01 03:59:39 +08:00
committed by GitHub
4 changed files with 102 additions and 14 deletions

View File

@@ -535,8 +535,7 @@ BOOL CScreenSpyDlg::PreTranslateMessage(MSG* pMsg)
case WM_MBUTTONUP:
case WM_MOUSEWHEEL:
{
MSG Msg;
memcpy(&Msg, pMsg, sizeof(MSG));
MSG64 Msg(*pMsg);
Msg.lParam = MAKEDWORD(HIWORD(pMsg->lParam) + m_ulVScrollPos, LOWORD(pMsg->lParam) + m_ulHScrollPos);
Msg.pt.x += m_ulHScrollPos;
Msg.pt.y += m_ulVScrollPos;
@@ -551,8 +550,7 @@ BOOL CScreenSpyDlg::PreTranslateMessage(MSG* pMsg)
return TRUE;
if (pMsg->wParam != VK_LWIN && pMsg->wParam != VK_RWIN)
{
MSG Msg;
memcpy(&Msg, pMsg, sizeof(MSG));
MSG64 Msg(*pMsg);
Msg.lParam = MAKEDWORD(HIWORD(pMsg->lParam) + m_ulVScrollPos, LOWORD(pMsg->lParam) + m_ulHScrollPos);
Msg.pt.x += m_ulHScrollPos;
Msg.pt.y += m_ulVScrollPos;
@@ -567,15 +565,15 @@ BOOL CScreenSpyDlg::PreTranslateMessage(MSG* pMsg)
}
VOID CScreenSpyDlg::SendCommand(MSG* Msg)
VOID CScreenSpyDlg::SendCommand(const MSG64* Msg)
{
if (!m_bIsCtrl)
return;
const int length = sizeof(MSG) + 1;
const int length = sizeof(MSG64) + 1;
BYTE szData[length + 3];
szData[0] = COMMAND_SCREEN_CONTROL;
memcpy(szData + 1, Msg, sizeof(MSG));
memcpy(szData + 1, Msg, sizeof(MSG64));
szData[length] = 0;
m_iocpServer->OnClientPreSending(m_ContextObject, szData, length);
}

View File

@@ -59,7 +59,7 @@ public:
CString m_strClientIP;
BOOL m_bIsTraceCursor;
CCursorInfo m_CursorInfo; //<2F>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ϵͳ<CFB5>Ĺ<EFBFBD><C4B9><EFBFBD><EFBFBD><EFBFBD>
VOID SendCommand(MSG* Msg);
VOID SendCommand(const MSG64* Msg);
VOID UpdateServerClipboard(char *szBuffer,ULONG ulLength);
VOID SendServerClipboard(void);