Changeset 6981 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Feb 18, 2008 10:05:36 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 28172
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedClipboard/service.cpp
r5999 r6981 234 234 } 235 235 236 /** 237 * Disconnect the host side of the shared clipboard and send a "host disconnected" message 238 * to the guest side. 239 */ 240 static DECLCALLBACK(int) svcDisconnect (uint32_t u32ClientID, void *pvClient) 241 { 242 VBOXCLIPBOARDCLIENTDATA *pClient = (VBOXCLIPBOARDCLIENTDATA *)pvClient; 243 244 vboxSvcClipboardReportMsg (pClient, VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT, 0); 245 246 vboxClipboardDisconnect (pClient); 247 248 memset (pClient, 0, sizeof (*pClient)); 249 250 g_pClient = NULL; 251 252 return VINF_SUCCESS; 253 } 254 236 255 static DECLCALLBACK(int) svcConnect (uint32_t u32ClientID, void *pvClient) 237 256 { 238 257 VBOXCLIPBOARDCLIENTDATA *pClient = (VBOXCLIPBOARDCLIENTDATA *)pvClient; 239 258 259 int rc = VINF_SUCCESS; 260 261 /* If there is already a client connected then we want to release it first. */ 262 if (g_pClient != NULL) 263 { 264 uint32_t u32ClientID = g_pClient->u32ClientID; 265 266 svcDisconnect(u32ClientID, g_pClient); 267 /* And free the resources in the hgcm subsystem. */ 268 g_pHelpers->pfnDisconnectClient(g_pHelpers->pvInstance, u32ClientID); 269 } 270 240 271 /* Register the client. */ 241 int rc = VINF_SUCCESS;242 243 272 memset (pClient, 0, sizeof (*pClient)); 244 273 … … 246 275 247 276 rc = vboxClipboardConnect (pClient); 248 277 249 278 if (VBOX_SUCCESS (rc)) 250 279 { 251 280 g_pClient = pClient; 252 281 } 253 282 254 283 Log(("vboxClipboardConnect: rc = %Vrc\n", rc)); 255 284 256 285 return rc; 257 }258 259 static DECLCALLBACK(int) svcDisconnect (uint32_t u32ClientID, void *pvClient)260 {261 VBOXCLIPBOARDCLIENTDATA *pClient = (VBOXCLIPBOARDCLIENTDATA *)pvClient;262 263 vboxSvcClipboardReportMsg (pClient, VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT, 0);264 265 vboxClipboardDisconnect (pClient);266 267 memset (pClient, 0, sizeof (*pClient));268 269 g_pClient = NULL;270 271 return VINF_SUCCESS;272 286 } 273 287
Note:
See TracChangeset
for help on using the changeset viewer.