Changeset 79088 in vbox
- Timestamp:
- Jun 11, 2019 12:16:49 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/GuestHost/SharedClipboard-uri.h
r79036 r79088 378 378 }; 379 379 380 int SharedClipboardDataHeaderInit(PVBOXCLIPBOARDDATAHDR pDataHdr); 381 void SharedClipboardDataHeaderDestroy(PVBOXCLIPBOARDDATAHDR pDataHdr); 382 380 383 /** 381 384 * Structure for keeping Shared Clipboard meta data. -
trunk/include/VBox/HostServices/VBoxClipboardExt.h
r78683 r79088 80 80 typedef struct _VBOXCLIPBOARDEXTAREAPARMS 81 81 { 82 /** The clipboard area's ID . */82 /** The clipboard area's ID the callback is for. */ 83 83 SHAREDCLIPBOARDAREAID uID; 84 84 union … … 88 88 void *pvData; 89 89 uint32_t cbData; 90 /** Area register flags; not used yet and must be set to 0. */ 90 91 VBOXCLIPBOARDEXTAREAREGISTETRFLAGS fFlags; 91 92 } fn_register; 92 93 struct 93 94 { 95 /** Area attach flags; not used yet and must be set to 0. */ 94 96 VBOXCLIPBOARDEXTAREAATTACHFLAGS fFlags; 95 97 } fn_attach; 96 98 } u; 97 99 } VBOXCLIPBOARDEXTAREAPARMS, *PVBOXCLIPBOARDEXTAREAPARMS; 98 #endif 100 #endif /* VBOX_WITH_SHARED_CLIPBOARD_URI_LIST */ 99 101 100 102 #endif /* !VBOX_INCLUDED_HostServices_VBoxClipboardExt_h */ -
trunk/src/VBox/GuestHost/SharedClipboard/ClipboardProvider-HostService.cpp
r79036 r79088 55 55 } 56 56 57 int SharedClipboardProviderHostService::ReadMetaData(const PVBOXCLIPBOARDDATAHDR pDataHdr, void *pvMeta, uint32_t cbMeta, uint32_t *pcbRead,58 uint32_t fFlags /* = 0 */)57 int SharedClipboardProviderHostService::ReadMetaData(const PVBOXCLIPBOARDDATAHDR pDataHdr, void *pvMeta, uint32_t cbMeta, 58 uint32_t *pcbRead, uint32_t fFlags /* = 0 */) 59 59 { 60 60 RT_NOREF(pDataHdr, pvMeta, cbMeta, pcbRead, fFlags); -
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-common.cpp
r79036 r79088 354 354 #ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST 355 355 /** 356 * Initializes an URI data header struct. 357 * 358 * @returns VBox status code. 359 * @param pDataHdr Data header struct to initialize. 360 */ 361 int SharedClipboardDataHeaderInit(PVBOXCLIPBOARDDATAHDR pDataHdr) 362 { 363 AssertPtrReturn(pDataHdr, VERR_INVALID_POINTER); 364 365 RT_BZERO(pDataHdr, sizeof(VBOXCLIPBOARDDATAHDR)); 366 367 return VINF_SUCCESS; 368 } 369 370 /** 371 * Destroys an URI data header struct. 372 * 373 * @param pDataHdr Data header struct to destroy. 374 */ 375 void SharedClipboardDataHeaderDestroy(PVBOXCLIPBOARDDATAHDR pDataHdr) 376 { 377 if (!pDataHdr) 378 return; 379 380 if (pDataHdr->pvMetaFmt) 381 { 382 Assert(pDataHdr->cbMetaFmt); 383 384 RTMemFree(pDataHdr->pvMetaFmt); 385 pDataHdr->pvMetaFmt = NULL; 386 pDataHdr->cbMetaFmt = 0; 387 } 388 389 if (pDataHdr->pvChecksum) 390 { 391 Assert(pDataHdr->cbChecksum); 392 393 RTMemFree(pDataHdr->pvChecksum); 394 pDataHdr->pvChecksum = NULL; 395 pDataHdr->cbChecksum = 0; 396 } 397 } 398 399 /** 356 400 * Initializes an URI clipboard transfer struct. 357 401 * … … 368 412 AssertPtrReturn(ppTransfer, VERR_INVALID_POINTER); 369 413 414 LogFlowFuncEnter(); 415 370 416 PSHAREDCLIPBOARDURITRANSFER pTransfer = (PSHAREDCLIPBOARDURITRANSFER)RTMemAlloc(sizeof(SHAREDCLIPBOARDURITRANSFER)); 371 417 if (!pTransfer) 372 418 return VERR_NO_MEMORY; 373 419 374 LogFlowFuncEnter();375 376 420 pTransfer->enmDir = enmDir; 377 421 378 SharedClipboardMetaDataInit(&pTransfer->Meta); 379 380 pTransfer->pProvider = SharedClipboardProvider::Create(pCtx); 381 if (!pTransfer->pProvider) 382 return VERR_NO_MEMORY; 383 384 pTransfer->Thread.hThread = NIL_RTTHREAD; 385 pTransfer->Thread.fCancelled = false; 386 pTransfer->Thread.fStarted = false; 387 388 pTransfer->pvUser = NULL; 389 pTransfer->cbUser = 0; 390 391 *ppTransfer = pTransfer; 392 393 LogFlowFuncLeave(); 394 return VINF_SUCCESS; 422 int rc = SharedClipboardDataHeaderInit(&pTransfer->Header); 423 if (RT_SUCCESS(rc)) 424 { 425 rc = SharedClipboardMetaDataInit(&pTransfer->Meta); 426 if (RT_SUCCESS(rc)) 427 { 428 pTransfer->pProvider = SharedClipboardProvider::Create(pCtx); 429 if (pTransfer->pProvider) 430 { 431 pTransfer->Thread.hThread = NIL_RTTHREAD; 432 pTransfer->Thread.fCancelled = false; 433 pTransfer->Thread.fStarted = false; 434 435 pTransfer->pvUser = NULL; 436 pTransfer->cbUser = 0; 437 438 *ppTransfer = pTransfer; 439 } 440 else 441 rc = VERR_NO_MEMORY; 442 } 443 } 444 445 LogFlowFuncLeaveRC(rc); 446 return rc; 395 447 } 396 448 … … 399 451 * 400 452 * @returns VBox status code. 401 * @param pURI URI clipboard transfer structto destroy.453 * @param pURI URI clipboard transfer to destroy. 402 454 */ 403 455 int SharedClipboardURITransferDestroy(PSHAREDCLIPBOARDURITRANSFER pTransfer) … … 412 464 return rc; 413 465 466 SharedClipboardDataHeaderDestroy(&pTransfer->Header); 414 467 SharedClipboardMetaDataDestroy(&pTransfer->Meta); 415 468 … … 431 484 * Resets an clipboard URI transfer. 432 485 * 433 * @param pTransfer URI clipboard transfer structto reset.486 * @param pTransfer URI clipboard transfer to reset. 434 487 */ 435 488 void SharedClipboardURITransferReset(PSHAREDCLIPBOARDURITRANSFER pTransfer) … … 451 504 * 452 505 * @returns VBox status code. 453 * @param pTransfer URI clipboard transfer structto return current URI object for.506 * @param pTransfer URI clipboard transfer to return current URI object for. 454 507 */ 455 508 const SharedClipboardURIObject *SharedClipboardURITransferGetCurrentObject(PSHAREDCLIPBOARDURITRANSFER pTransfer) … … 464 517 * 465 518 * @returns VBox status code. 466 * @param pTransfer URI clipboard transfer structto return provider for.519 * @param pTransfer URI clipboard transfer to return provider for. 467 520 */ 468 521 SharedClipboardProvider *SharedClipboardURITransferGetProvider(PSHAREDCLIPBOARDURITRANSFER pTransfer) … … 477 530 * 478 531 * @returns Pointer to URI list. 479 * @param pTransfer URI clipboard transfer structto return URI list for.532 * @param pTransfer URI clipboard transfer to return URI list for. 480 533 */ 481 534 const SharedClipboardURIList *SharedClipboardURITransferGetList(PSHAREDCLIPBOARDURITRANSFER pTransfer) … … 488 541 * 489 542 * @returns Pointer to URI object. 490 * @param pTransfer URI clipboard transfer structto return URI object for.543 * @param pTransfer URI clipboard transfer to return URI object for. 491 544 */ 492 545 const SharedClipboardURIObject *SharedClipboardURITransferGetObject(PSHAREDCLIPBOARDURITRANSFER pTransfer, uint64_t uIdx) … … 525 578 * 526 579 * @returns VBox status code. 527 * @param pTransfer URI clipboard transfer structto set callbacks for.580 * @param pTransfer URI clipboard transfer to set callbacks for. 528 581 * @param pCallbacks Pointer to callback table to set. Specify NULL to unset existing callbacks. 529 582 */ … … 547 600 * 548 601 * @returns VBox status code. 549 * @param pTransfer URI clipboard transfer structto create thread for.602 * @param pTransfer URI clipboard transfer to create thread for. 550 603 */ 551 604 static int sharedClipboardURITransferThreadCreate(PSHAREDCLIPBOARDURITRANSFER pTransfer) … … 565 618 int rc = RTThreadCreate(&pTransfer->Thread.hThread, pfnRTThread, 566 619 pTransfer /* pvUser */, 0, RTTHREADTYPE_DEFAULT, RTTHREADFLAGS_WAITABLE, 567 " vbxshclp");620 "shclp"); 568 621 if (RT_SUCCESS(rc)) 569 622 { … … 583 636 * 584 637 * @returns VBox status code. 585 * @param pTransfer URI clipboard transfer structto destroy thread for.638 * @param pTransfer URI clipboard transfer to destroy thread for. 586 639 * @param uTimeoutMs Timeout (in ms) to wait for thread creation. 587 640 */ … … 664 717 * 665 718 * @returns VBox status code. 666 * @param pTransfer URI clipboard transfer structto set meta data for.719 * @param pTransfer URI clipboard transfer to set meta data for. 667 720 * @param pvMeta Pointer to meta data buffer. 668 721 * @param cbMeta Size (in bytes) of meta data buffer. … … 686 739 * 687 740 * @returns VBox status code. 688 * @param pTransfer URI clipboard transfer structto set meta data for.741 * @param pTransfer URI clipboard transfer to set meta data for. 689 742 * @param pvMeta Pointer to meta data buffer. 690 743 * @param cbMeta Size (in bytes) of meta data buffer. … … 700 753 } 701 754 755 /** 756 * Reads meta for a clipboard URI transfer. 757 * 758 * @returns VBox status code. 759 * @param pTransfer URI clipboard transfer to read meta data for. 760 * @param pcbRead How much meta data (in bytes) was read on success. 761 */ 702 762 int SharedClipboardURITransferMetaDataRead(PSHAREDCLIPBOARDURITRANSFER pTransfer, uint32_t *pcbRead) 703 763 { … … 935 995 AssertPtrReturn(pTransfer, VERR_INVALID_POINTER); 936 996 997 LogFlowFuncEnter(); 998 937 999 int rc = SharedClipboardURITransferMetaDataWrite(pTransfer, NULL /* pcbWritten */); 938 1000 if (RT_SUCCESS(rc)) … … 1010 1072 * @returns VBox status code. 1011 1073 * @param pURI URI clipboard context to add transfer to. 1012 * @param pTransfer Pointer to URI clipboard transfer structto add.1074 * @param pTransfer Pointer to URI clipboard transfer to add. 1013 1075 */ 1014 1076 int SharedClipboardURICtxTransferAdd(PSHAREDCLIPBOARDURICTX pURI, PSHAREDCLIPBOARDURITRANSFER pTransfer) … … 1033 1095 * @returns VBox status code. 1034 1096 * @param pURI URI clipboard context to remove transfer from. 1035 * @param pTransfer Pointer to URI clipboard transfer structto remove.1097 * @param pTransfer Pointer to URI clipboard transfer to remove. 1036 1098 */ 1037 1099 int SharedClipboardURICtxTransferRemove(PSHAREDCLIPBOARDURICTX pURI, PSHAREDCLIPBOARDURITRANSFER pTransfer) -
trunk/src/VBox/GuestHost/SharedClipboard/clipboard-win.cpp
r79036 r79088 23 23 24 24 #ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST 25 # include <iprt/win/windows.h> 26 # include <iprt/win/shlobj.h> /* For CFSTR_FILEDESCRIPTORXXX + CFSTR_FILECONTENTS. */ 25 27 # include <iprt/utf16.h> 26 28 #endif … … 306 308 307 309 #ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST 308 /* Handles file system entries which are locally present 309 * on source for transferring to the target. */ 310 /* CF_HDROP handles file system entries which are locally present 311 * on source for transferring to the target. 312 * 313 * This does *not* invoke any IDataObject / IStream implementations! */ 310 314 case CF_HDROP: 311 315 vboxFormat = VBOX_SHARED_CLIPBOARD_FMT_URI_LIST; … … 324 328 if (RTStrCmp(szFormatName, VBOX_CLIPBOARD_WIN_REGFMT_HTML) == 0) 325 329 vboxFormat = VBOX_SHARED_CLIPBOARD_FMT_HTML; 330 #ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST 331 /* These types invoke our IDataObject / IStream implementations. */ 332 else if ( (RTStrCmp(szFormatName, CFSTR_FILEDESCRIPTORA) == 0) 333 || (RTStrCmp(szFormatName, CFSTR_FILECONTENTS) == 0)) 334 vboxFormat = VBOX_SHARED_CLIPBOARD_FMT_URI_LIST; 335 /** @todo Do we need to handle CFSTR_FILEDESCRIPTORW here as well? */ 336 #endif 326 337 } 327 338 } -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc-win.cpp
r79036 r79088 583 583 { 584 584 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); 585 586 LogFlowFuncEnter(); 585 587 586 588 int rc; -
trunk/src/VBox/HostServices/SharedClipboard/VBoxSharedClipboardSvc.cpp
r79036 r79088 208 208 if (pClientData->State.fHostMsgQuit) 209 209 { 210 LogFlowFunc((" vboxSvcClipboardReturnMsg: Quit\n"));210 LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT\n")); 211 211 VBoxHGCMParmUInt32Set(&paParms[0], VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT); 212 212 VBoxHGCMParmUInt32Set(&paParms[1], 0); … … 217 217 uint32_t fFormat = 0; 218 218 219 LogFlowFunc(("vboxSvcClipboardReturnMsg: ReadData %02X\n", pClientData->State.u32RequestedFormat)); 219 LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA: u32RequestedFormat=%02X\n", 220 pClientData->State.u32RequestedFormat)); 221 220 222 if (pClientData->State.u32RequestedFormat & VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT) 221 223 fFormat = VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT; … … 241 243 else if (pClientData->State.fHostMsgFormats) 242 244 { 243 LogFlowFunc(("vboxSvcClipboardReturnMsg: Formats %02X\n", pClientData->State.u32AvailableFormats)); 245 LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_REPORT_FORMATS: u32AvailableFormats=%02X\n", 246 pClientData->State.u32AvailableFormats)); 247 244 248 VBoxHGCMParmUInt32Set(&paParms[0], VBOX_SHARED_CLIPBOARD_HOST_MSG_REPORT_FORMATS); 245 249 VBoxHGCMParmUInt32Set(&paParms[1], pClientData->State.u32AvailableFormats); … … 249 253 { 250 254 /* No pending messages. */ 251 LogFlowFunc((" vboxSvcClipboardReturnMsg: nomessage\n"));255 LogFlowFunc(("No pending message\n")); 252 256 return false; 253 257 } … … 263 267 int rc = VINF_SUCCESS; 264 268 265 LogFlowFunc (("u32Msg=%RU32\n", u32Msg));269 LogFlowFuncEnter(); 266 270 267 271 if (VBoxSvcClipboardLock()) … … 271 275 case VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT: 272 276 { 273 LogFlowFunc((" Quit\n"));277 LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT\n")); 274 278 pClientData->State.fHostMsgQuit = true; 275 279 } break; 280 276 281 case VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA: 277 282 { … … 283 288 } 284 289 285 LogFlowFunc((" ReadData%02X\n", u32Formats));290 LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA: u32Formats=%02X\n", u32Formats)); 286 291 pClientData->State.u32RequestedFormat = u32Formats; 287 292 pClientData->State.fHostMsgReadData = true; 288 293 } break; 294 289 295 case VBOX_SHARED_CLIPBOARD_HOST_MSG_REPORT_FORMATS: 290 296 { … … 296 302 } 297 303 298 LogFlowFunc((" Formats%02X\n", u32Formats));304 LogFlowFunc(("VBOX_SHARED_CLIPBOARD_HOST_MSG_REPORT_FORMATS: u32Formats=%02X\n", u32Formats)); 299 305 pClientData->State.u32AvailableFormats = u32Formats; 300 306 pClientData->State.fHostMsgFormats = true; 301 307 } break; 308 302 309 default: 303 310 { 304 /* Invalid message. */305 LogFlowFunc(("invalid message %d\n", u32Msg));311 AssertMsgFailed(("Invalid message %RU32\n", u32Msg)); 312 rc = VERR_INVALID_PARAMETER; 306 313 } break; 307 314 } 308 315 309 if (pClientData->State.fAsync) 310 { 311 /* The client waits for a response. */ 312 bool fMessageReturned = vboxSvcClipboardReturnMsg(pClientData, pClientData->State.async.paParms); 313 314 /* Make a copy of the handle. */ 315 VBOXHGCMCALLHANDLE callHandle = pClientData->State.async.callHandle; 316 317 if (fMessageReturned) 318 { 319 /* There is a response. */ 320 pClientData->State.fAsync = false; 321 } 322 323 VBoxSvcClipboardUnlock(); 324 325 if (fMessageReturned) 326 { 327 LogFlowFunc(("CallComplete\n")); 328 g_pHelpers->pfnCallComplete(callHandle, VINF_SUCCESS); 329 } 316 if (RT_SUCCESS(rc)) 317 { 318 if (pClientData->State.fAsync) 319 { 320 /* The client waits for a response. */ 321 bool fMessageReturned = vboxSvcClipboardReturnMsg(pClientData, pClientData->State.async.paParms); 322 323 /* Make a copy of the handle. */ 324 VBOXHGCMCALLHANDLE callHandle = pClientData->State.async.callHandle; 325 326 if (fMessageReturned) 327 { 328 /* There is a response. */ 329 pClientData->State.fAsync = false; 330 } 331 332 VBoxSvcClipboardUnlock(); 333 334 if (fMessageReturned) 335 { 336 LogFlowFunc(("CallComplete\n")); 337 g_pHelpers->pfnCallComplete(callHandle, VINF_SUCCESS); 338 } 339 } 340 else 341 VBoxSvcClipboardUnlock(); 330 342 } 331 343 else 332 {333 344 VBoxSvcClipboardUnlock(); 334 }335 345 } 336 346 … … 458 468 int rc = VINF_SUCCESS; 459 469 460 LogFunc(("u32ClientID = %d, fn = %d, cParms = %d, pparms = %d\n",470 LogFunc(("u32ClientID=%RU32, fn=%RU32, cParms=%RU32, paParms=%p\n", 461 471 u32ClientID, u32Function, cParms, paParms)); 462 472 … … 469 479 { 470 480 /** @todo parameters other than 32 bit */ 471 LogFunc((" p parms[%d]: type %d value %d\n", i, paParms[i].type, paParms[i].u.uint32));481 LogFunc((" paParms[%d]: type %RU32 - value %RU32\n", i, paParms[i].type, paParms[i].u.uint32)); 472 482 } 473 483 #endif -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r79041 r79088 8254 8254 alock.release(); 8255 8255 8256 # ifdef VBOX_WITH_SHARED_CLIPBOARD8256 # ifdef VBOX_WITH_SHARED_CLIPBOARD 8257 8257 if (m_hHgcmSvcExtShrdClipboard) 8258 8258 { … … 8260 8260 m_hHgcmSvcExtShrdClipboard = NULL; 8261 8261 } 8262 # endif8263 # ifdef VBOX_WITH_DRAG_AND_DROP8262 # endif 8263 # ifdef VBOX_WITH_DRAG_AND_DROP 8264 8264 if (m_hHgcmSvcExtDragAndDrop) 8265 8265 { … … 8267 8267 m_hHgcmSvcExtDragAndDrop = NULL; 8268 8268 } 8269 # endif8269 # endif 8270 8270 8271 8271 m_pVMMDev->hgcmShutdown();
Note:
See TracChangeset
for help on using the changeset viewer.