]> source.dussan.org Git - tigervnc.git/commitdiff
Stop trying to send ListConnInfo via WM_COPYDATA
authorPierre Ossman <ossman@cendio.se>
Fri, 9 Nov 2018 16:14:57 +0000 (17:14 +0100)
committerPierre Ossman <ossman@cendio.se>
Fri, 9 Nov 2018 16:16:04 +0000 (17:16 +0100)
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.

win/winvnc/ControlPanel.cxx
win/winvnc/STrayIcon.cxx

index e7262287033cb5366012462be5b0d94a742fbea5..72831e55ae76684311cb494a581562fa781e6b43 100644 (file)
@@ -140,6 +140,8 @@ void ControlPanel::SendCommand(DWORD command, int data)
 {
   COPYDATASTRUCT copyData;
   copyData.dwData = command;
+  copyData.cbData = 0;
+  copyData.lpData = 0;
   getSelConnInfo();
   if (data != -1) {
     ListConnStatus.Copy(&ListSelConn);
@@ -148,8 +150,6 @@ void ControlPanel::SendCommand(DWORD command, int data)
   } else {
     ListConnStatus.Clear();
   }
-  copyData.cbData = 0;
-  copyData.lpData = &ListConnStatus;
   SendMessage(m_hSTIcon, WM_COPYDATA, 0, (LPARAM)&copyData);
 }
 
index fa483ee0c274fb1d257ae24b007d7ae2b0edaeeb..a90819d081cc428098bc92fb8e4f36775c35b5e8 100644 (file)
@@ -184,7 +184,7 @@ public:
         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);