Stop trying to send ListConnInfo via WM_COPYDATA
Windows tries to do a copy of it, and it is too complex to survive
that. Just reference the object directly as we know the source of
the message here.
diff --git a/win/winvnc/ControlPanel.cxx b/win/winvnc/ControlPanel.cxx
index e726228..72831e5 100644
--- a/win/winvnc/ControlPanel.cxx
+++ b/win/winvnc/ControlPanel.cxx
@@ -140,6 +140,8 @@
{
COPYDATASTRUCT copyData;
copyData.dwData = command;
+ copyData.cbData = 0;
+ copyData.lpData = 0;
getSelConnInfo();
if (data != -1) {
ListConnStatus.Copy(&ListSelConn);
@@ -148,8 +150,6 @@
} else {
ListConnStatus.Clear();
}
- copyData.cbData = 0;
- copyData.lpData = &ListConnStatus;
SendMessage(m_hSTIcon, WM_COPYDATA, 0, (LPARAM)©Data);
}
diff --git a/win/winvnc/STrayIcon.cxx b/win/winvnc/STrayIcon.cxx
index fa483ee..a90819d 100644
--- a/win/winvnc/STrayIcon.cxx
+++ b/win/winvnc/STrayIcon.cxx
@@ -184,7 +184,7 @@
case 2:
return thread.server.disconnectClients("IPC disconnect") ? 1 : 0;
case 3:
- thread.server.setClientsStatus((ListConnInfo *)command->lpData);
+ thread.server.setClientsStatus(&CPanel->ListConnStatus);
case 4:
thread.server.getClientsInfo(&LCInfo);
CPanel->UpdateListView(&LCInfo);