- Timestamp:
- Oct 12, 2015 2:33:34 PM (9 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxGuestLib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.c
r58178 r58192 51 51 #define SHFL_CPARMS_SET_SYMLINKS 0 52 52 53 #define VBOX_INIT_CALL(a, b, c) \ 54 LogFunc(("%s, u32ClientID=%d\n", "SHFL_FN_" # b, \ 55 (c)->ulClientID)); \ 56 (a)->result = VINF_SUCCESS; \ 57 (a)->u32ClientID = (c)->ulClientID; \ 58 (a)->u32Function = SHFL_FN_##b; \ 53 #define VBOX_INIT_CALL(a, b, c) \ 54 LogFunc(("%s, u32ClientID=%d\n", "SHFL_FN_" # b, (c)->ulClientID)); \ 55 (a)->result = VINF_SUCCESS; \ 56 (a)->u32ClientID = (c)->ulClientID; \ 57 (a)->u32Function = SHFL_FN_##b; \ 59 58 (a)->cParms = SHFL_CPARMS_##b 60 59 61 60 62 61 63 DECLVBGL(int) vboxInit (void) 64 { 65 int rc = VINF_SUCCESS; 66 67 rc = VbglInitClient(); 68 return rc; 69 } 70 71 DECLVBGL(void) vboxUninit (void) 72 { 73 VbglTerminate (); 74 } 75 76 DECLVBGL(int) vboxConnect (PVBSFCLIENT pClient) 62 DECLVBGL(int) vboxInit(void) 63 { 64 return VbglInitClient(); 65 } 66 67 DECLVBGL(void) vboxUninit(void) 68 { 69 VbglTerminate(); 70 } 71 72 DECLVBGL(int) vboxConnect(PVBSFCLIENT pClient) 77 73 { 78 74 int rc; … … 86 82 strcpy (data.Loc.u.host.achName, "VBoxSharedFolders"); 87 83 88 rc = VbglHGCMConnect (&pClient->handle, &data); 89 84 rc = VbglHGCMConnect(&pClient->handle, &data); 90 85 /* Log(("VBOXSF: VBoxSF::vboxConnect: VbglHGCMConnect rc = %#x, result = %#x\n", 91 rc, data.result)); 92 */ 93 if (RT_SUCCESS (rc)) 94 { 86 rc, data.result)); */ 87 if (RT_SUCCESS(rc)) 95 88 rc = data.result; 96 } 97 98 if (RT_SUCCESS (rc)) 89 if (RT_SUCCESS(rc)) 99 90 { 100 91 pClient->ulClientID = data.u32ClientID; … … 104 95 } 105 96 106 DECLVBGL(void) vboxDisconnect 97 DECLVBGL(void) vboxDisconnect(PVBSFCLIENT pClient) 107 98 { 108 99 int rc; … … 117 108 data.u32ClientID = pClient->ulClientID; 118 109 119 rc = VbglHGCMDisconnect 110 rc = VbglHGCMDisconnect(pClient->handle, &data); 120 111 NOREF(rc); 121 112 /* Log(("VBOXSF: VBoxSF::vboxDisconnect: " 122 "VbglHGCMDisconnect rc = %#x, result = %#x\n", rc, data.result)); 123 */ 113 "VbglHGCMDisconnect rc = %#x, result = %#x\n", rc, data.result)); */ 124 114 return; 125 115 } 126 116 127 DECLVBGL(int) vboxCallQueryMappings (PVBSFCLIENT pClient, SHFLMAPPING paMappings[], 128 uint32_t *pcMappings) 129 { 130 int rc = VINF_SUCCESS; 131 117 DECLVBGL(int) vboxCallQueryMappings(PVBSFCLIENT pClient, SHFLMAPPING paMappings[], uint32_t *pcMappings) 118 { 119 int rc; 132 120 VBoxSFQueryMappings data; 133 121 … … 141 129 142 130 data.mappings.type = VMMDevHGCMParmType_LinAddr; 143 data.mappings.u.Pointer.size = sizeof 131 data.mappings.u.Pointer.size = sizeof(SHFLMAPPING) * *pcMappings; 144 132 data.mappings.u.Pointer.u.linearAddr = (uintptr_t)&paMappings[0]; 145 133 146 134 /* Log(("VBOXSF: in ifs difference %d\n", 147 (char *)&data.flags.type - (char *)&data.callInfo.cParms)); 148 */ 149 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 150 151 /* 152 Log(("VBOXSF: VBoxSF::vboxCallQueryMappings: " 153 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 154 */ 155 if (RT_SUCCESS (rc)) 156 { 157 rc = data.callInfo.result; 158 } 159 160 if (RT_SUCCESS (rc)) 161 { 135 (char *)&data.flags.type - (char *)&data.callInfo.cParms)); */ 136 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 137 /* Log(("VBOXSF: VBoxSF::vboxCallQueryMappings: " 138 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 139 if (RT_SUCCESS(rc)) 140 rc = data.callInfo.result; 141 if (RT_SUCCESS(rc)) 162 142 *pcMappings = data.numberOfMappings.u.value32; 163 } 164 165 return rc; 166 } 167 168 DECLVBGL(int) vboxCallQueryMapName (PVBSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size) 169 { 170 int rc = VINF_SUCCESS; 171 143 144 return rc; 145 } 146 147 DECLVBGL(int) vboxCallQueryMapName(PVBSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size) 148 { 149 int rc; 172 150 VBoxSFQueryMapName data; 173 151 … … 181 159 data.name.u.Pointer.u.linearAddr = (uintptr_t)pString; 182 160 183 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 184 161 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 185 162 /* Log(("VBOXSF: VBoxSF::vboxCallQueryMapName: " 186 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 187 */ 188 if (RT_SUCCESS (rc)) 189 { 190 rc = data.callInfo.result; 191 } 192 193 return rc; 194 } 195 196 DECLVBGL(int) vboxCallMapFolder(PVBSFCLIENT pClient, PSHFLSTRING szFolderName, 197 PVBSFMAP pMap) 198 { 199 int rc = VINF_SUCCESS; 200 163 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 164 if (RT_SUCCESS(rc)) 165 rc = data.callInfo.result; 166 167 return rc; 168 } 169 170 DECLVBGL(int) vboxCallMapFolder(PVBSFCLIENT pClient, PSHFLSTRING szFolderName, PVBSFMAP pMap) 171 { 172 int rc; 201 173 VBoxSFMapFolder data; 202 174 … … 204 176 205 177 data.path.type = VMMDevHGCMParmType_LinAddr; 206 data.path.u.Pointer.size = ShflStringSizeOfBuffer 178 data.path.u.Pointer.size = ShflStringSizeOfBuffer(szFolderName); 207 179 data.path.u.Pointer.u.linearAddr = (uintptr_t)szFolderName; 208 180 … … 220 192 #endif 221 193 222 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 223 194 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 224 195 /* Log(("VBOXSF: VBoxSF::vboxCallMapFolder: " 225 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 226 */ 227 if (RT_SUCCESS (rc)) 196 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 197 if (RT_SUCCESS(rc)) 228 198 { 229 199 pMap->root = data.root.u.value32; … … 247 217 OldData.delimiter.u.value32 = RTPATH_DELIMITER; 248 218 249 rc = VbglHGCMCall (pClient->handle, &OldData.callInfo, sizeof (OldData)); 250 251 if (RT_SUCCESS (rc)) 219 rc = VbglHGCMCall(pClient->handle, &OldData.callInfo, sizeof(OldData)); 220 if (RT_SUCCESS(rc)) 252 221 { 253 222 pMap->root = OldData.root.u.value32; … … 260 229 DECLVBGL(int) vboxCallUnmapFolder(PVBSFCLIENT pClient, PVBSFMAP pMap) 261 230 { 262 int rc = VINF_SUCCESS; 263 231 int rc; 264 232 VBoxSFUnmapFolder data; 265 233 … … 269 237 data.root.u.value32 = pMap->root; 270 238 271 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 272 239 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 273 240 /* Log(("VBOXSF: VBoxSF::vboxCallUnmapFolder: " 274 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 275 */ 276 if (RT_SUCCESS (rc)) 277 { 278 rc = data.callInfo.result; 279 } 280 return rc; 281 } 282 283 DECLVBGL(int) vboxCallCreate (PVBSFCLIENT pClient, PVBSFMAP pMap, 284 PSHFLSTRING pParsedPath, PSHFLCREATEPARMS pCreateParms) 241 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 242 if (RT_SUCCESS(rc)) 243 rc = data.callInfo.result; 244 return rc; 245 } 246 247 DECLVBGL(int) vboxCallCreate(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, PSHFLCREATEPARMS pCreateParms) 285 248 { 286 249 /** @todo copy buffers to physical or mapped memory. */ 287 int rc = VINF_SUCCESS; 288 250 int rc; 289 251 VBoxSFCreate data; 290 252 … … 299 261 300 262 data.parms.type = VMMDevHGCMParmType_LinAddr; 301 data.parms.u.Pointer.size = sizeof 263 data.parms.u.Pointer.size = sizeof(SHFLCREATEPARMS); 302 264 data.parms.u.Pointer.u.linearAddr = (uintptr_t)pCreateParms; 303 265 304 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 305 266 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 306 267 /* Log(("VBOXSF: VBoxSF::vboxCallCreate: " 307 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 308 */ 309 if (RT_SUCCESS (rc)) 310 { 311 rc = data.callInfo.result; 312 } 313 return rc; 314 } 315 316 DECLVBGL(int) vboxCallClose (PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE Handle) 317 { 318 int rc = VINF_SUCCESS; 319 268 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 269 if (RT_SUCCESS(rc)) 270 rc = data.callInfo.result; 271 return rc; 272 } 273 274 DECLVBGL(int) vboxCallClose(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE Handle) 275 { 276 int rc; 320 277 VBoxSFClose data; 321 278 … … 328 285 data.handle.u.value64 = Handle; 329 286 330 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 331 287 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 332 288 /* Log(("VBOXSF: VBoxSF::vboxCallClose: " 333 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 334 */ 335 if (RT_SUCCESS (rc)) 336 { 337 rc = data.callInfo.result; 338 } 339 289 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 290 if (RT_SUCCESS(rc)) 291 rc = data.callInfo.result; 340 292 return rc; 341 293 } … … 354 306 355 307 data.path.type = VMMDevHGCMParmType_LinAddr_In; 356 data.path.u.Pointer.size = ShflStringSizeOfBuffer 308 data.path.u.Pointer.size = ShflStringSizeOfBuffer(pParsedPath); 357 309 data.path.u.Pointer.u.linearAddr = (uintptr_t)pParsedPath; 358 310 … … 360 312 data.flags.u.value32 = flags; 361 313 362 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 363 314 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 364 315 /* Log(("VBOXSF: VBoxSF::vboxCallRemove: " 365 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 366 */ 316 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 367 317 if (RT_SUCCESS (rc)) 368 { 369 rc = data.callInfo.result; 370 } 371 372 return rc; 373 } 374 375 DECLVBGL(int) vboxCallRename (PVBSFCLIENT pClient, PVBSFMAP pMap, 376 PSHFLSTRING pSrcPath, PSHFLSTRING pDestPath, uint32_t flags) 377 { 378 int rc = VINF_SUCCESS; 379 318 rc = data.callInfo.result; 319 return rc; 320 } 321 322 DECLVBGL(int) vboxCallRename(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pSrcPath, PSHFLSTRING pDestPath, uint32_t flags) 323 { 324 int rc; 380 325 VBoxSFRename data; 381 326 … … 386 331 387 332 data.src.type = VMMDevHGCMParmType_LinAddr_In; 388 data.src.u.Pointer.size = ShflStringSizeOfBuffer 333 data.src.u.Pointer.size = ShflStringSizeOfBuffer(pSrcPath); 389 334 data.src.u.Pointer.u.linearAddr = (uintptr_t)pSrcPath; 390 335 391 336 data.dest.type = VMMDevHGCMParmType_LinAddr_In; 392 data.dest.u.Pointer.size = ShflStringSizeOfBuffer 337 data.dest.u.Pointer.size = ShflStringSizeOfBuffer(pDestPath); 393 338 data.dest.u.Pointer.u.linearAddr = (uintptr_t)pDestPath; 394 339 … … 396 341 data.flags.u.value32 = flags; 397 342 398 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 399 343 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 400 344 /* Log(("VBOXSF: VBoxSF::vboxCallRename: " 401 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 402 */ 345 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 403 346 if (RT_SUCCESS (rc)) 404 { 405 rc = data.callInfo.result; 406 } 347 rc = data.callInfo.result; 407 348 return rc; 408 349 } … … 411 352 uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked) 412 353 { 413 int rc = VINF_SUCCESS; 414 354 int rc; 415 355 VBoxSFRead data; 416 356 … … 430 370 data.buffer.u.Pointer.u.linearAddr = (uintptr_t)pBuffer; 431 371 432 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 433 372 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 434 373 /* Log(("VBOXSF: VBoxSF::vboxCallRead: " 435 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 436 */ 437 if (RT_SUCCESS (rc)) 374 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 375 if (RT_SUCCESS(rc)) 438 376 { 439 377 rc = data.callInfo.result; … … 492 430 uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked) 493 431 { 494 int rc = VINF_SUCCESS; 495 432 int rc; 496 433 VBoxSFWrite data; 497 434 … … 507 444 data.cb.type = VMMDevHGCMParmType_32bit; 508 445 data.cb.u.value32 = *pcbBuffer; 509 data.buffer.type = (fLocked)? VMMDevHGCMParmType_LinAddr_Locked_In : VMMDevHGCMParmType_LinAddr_In;446 data.buffer.type = fLocked ? VMMDevHGCMParmType_LinAddr_Locked_In : VMMDevHGCMParmType_LinAddr_In; 510 447 data.buffer.u.Pointer.size = *pcbBuffer; 511 448 data.buffer.u.Pointer.u.linearAddr = (uintptr_t)pBuffer; 512 449 513 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 514 450 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 515 451 /* Log(("VBOXSF: VBoxSF::vboxCallWrite: " 516 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 517 */ 518 if (RT_SUCCESS (rc)) 452 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 453 if (RT_SUCCESS(rc)) 519 454 { 520 455 rc = data.callInfo.result; … … 559 494 pPgLst->aPages[iPage] = PhysBuffer; 560 495 561 rc = VbglHGCMCall 562 if (RT_SUCCESS 496 rc = VbglHGCMCall(pClient->handle, &pData->callInfo, cbData); 497 if (RT_SUCCESS(rc)) 563 498 { 564 499 rc = pData->callInfo.result; … … 606 541 pPgLst->aPages[iPage] = paPages[iPage]; 607 542 608 rc = VbglHGCMCall 609 if (RT_SUCCESS 543 rc = VbglHGCMCall(pClient->handle, &pData->callInfo, cbData); 544 if (RT_SUCCESS(rc)) 610 545 { 611 546 rc = pData->callInfo.result; … … 619 554 DECLVBGL(int) vboxCallFlush(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile) 620 555 { 621 int rc = VINF_SUCCESS; 622 556 int rc; 623 557 VBoxSFFlush data; 624 558 … … 631 565 data.handle.u.value64 = hFile; 632 566 633 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 634 567 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 635 568 /* Log(("VBOXSF: VBoxSF::vboxCallFlush: " 636 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 637 */ 638 if (RT_SUCCESS (rc)) 639 { 640 rc = data.callInfo.result; 641 } 642 return rc; 643 } 644 645 DECLVBGL(int) vboxCallDirInfo ( 569 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 570 if (RT_SUCCESS(rc)) 571 rc = data.callInfo.result; 572 return rc; 573 } 574 575 DECLVBGL(int) vboxCallDirInfo( 646 576 PVBSFCLIENT pClient, 647 577 PVBSFMAP pMap, … … 654 584 uint32_t *pcFiles) 655 585 { 656 int rc = VINF_SUCCESS; 657 586 int rc; 658 587 VBoxSFList data; 659 588 … … 670 599 data.cb.u.value32 = *pcbBuffer; 671 600 data.path.type = VMMDevHGCMParmType_LinAddr_In; 672 data.path.u.Pointer.size = 673 (ParsedPath) ? ShflStringSizeOfBuffer(ParsedPath) : 0; 601 data.path.u.Pointer.size = ParsedPath ? ShflStringSizeOfBuffer(ParsedPath) : 0; 674 602 data.path.u.Pointer.u.linearAddr = (uintptr_t) ParsedPath; 675 603 … … 683 611 data.cFiles.u.value32 = 0; /* out parameters only */ 684 612 685 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 686 613 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 687 614 /* Log(("VBOXSF: VBoxSF::vboxCallDirInfo: " 688 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 689 */ 690 if (RT_SUCCESS (rc)) 691 { 692 rc = data.callInfo.result; 693 } 615 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 616 if (RT_SUCCESS(rc)) 617 rc = data.callInfo.result; 694 618 *pcbBuffer = data.cb.u.value32; 695 619 *pcFiles = data.cFiles.u.value32; … … 700 624 uint32_t flags, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer) 701 625 { 702 int rc = VINF_SUCCESS; 703 626 int rc; 704 627 VBoxSFInformation data; 705 628 … … 719 642 data.info.u.Pointer.u.linearAddr = (uintptr_t)pBuffer; 720 643 721 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 722 644 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 723 645 /* Log(("VBOXSF: VBoxSF::vboxCallFileInfo: " 724 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 725 */ 726 if (RT_SUCCESS (rc)) 646 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 647 if (RT_SUCCESS(rc)) 727 648 { 728 649 rc = data.callInfo.result; … … 735 656 uint64_t offset, uint64_t cbSize, uint32_t fLock) 736 657 { 737 int rc = VINF_SUCCESS; 738 658 int rc; 739 659 VBoxSFLock data; 740 660 … … 754 674 data.flags.u.value32 = fLock; 755 675 756 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 757 676 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 758 677 /* Log(("VBOXSF: VBoxSF::vboxCallLock: " 759 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 760 */ 678 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 761 679 if (RT_SUCCESS (rc)) 762 { 763 rc = data.callInfo.result; 764 } 765 return rc; 766 } 767 768 DECLVBGL(int) vboxCallSetUtf8 (PVBSFCLIENT pClient) 769 { 770 int rc = VINF_SUCCESS; 771 680 rc = data.callInfo.result; 681 return rc; 682 } 683 684 DECLVBGL(int) vboxCallSetUtf8(PVBSFCLIENT pClient) 685 { 686 int rc; 772 687 VBoxGuestHGCMCallInfo callInfo; 773 688 774 VBOX_INIT_CALL (&callInfo, SET_UTF8, pClient); 775 rc = VbglHGCMCall (pClient->handle, &callInfo, sizeof (callInfo)); 776 if (RT_SUCCESS (rc)) 777 { 689 VBOX_INIT_CALL(&callInfo, SET_UTF8, pClient); 690 rc = VbglHGCMCall(pClient->handle, &callInfo, sizeof(callInfo)); 691 if (RT_SUCCESS(rc)) 778 692 rc = callInfo.result; 779 } 780 return rc; 781 } 782 783 DECLVBGL(int) vboxReadLink (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, 784 uint32_t cbBuffer, uint8_t *pBuffer) 785 { 786 int rc = VINF_SUCCESS; 787 693 return rc; 694 } 695 696 DECLVBGL(int) vboxReadLink(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, uint32_t cbBuffer, uint8_t *pBuffer) 697 { 698 int rc; 788 699 VBoxSFReadLink data; 789 700 … … 801 712 data.buffer.u.Pointer.u.linearAddr = (uintptr_t)pBuffer; 802 713 803 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 804 714 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 805 715 /* Log(("VBOXSF: VBoxSF::vboxCallReadline: " 806 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 807 */ 716 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 808 717 if (RT_SUCCESS (rc)) 809 { 810 rc = data.callInfo.result; 811 } 812 return rc; 813 } 814 815 DECLVBGL(int) vboxCallSymlink (PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath, 816 PSHFLFSOBJINFO pBuffer) 817 { 818 int rc = VINF_SUCCESS; 819 718 rc = data.callInfo.result; 719 return rc; 720 } 721 722 DECLVBGL(int) vboxCallSymlink(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath, 723 PSHFLFSOBJINFO pBuffer) 724 { 725 int rc; 820 726 VBoxSFSymlink data; 821 727 … … 837 743 data.info.u.Pointer.u.linearAddr = (uintptr_t)pBuffer; 838 744 839 rc = VbglHGCMCall (pClient->handle, &data.callInfo, sizeof (data)); 840 745 rc = VbglHGCMCall(pClient->handle, &data.callInfo, sizeof(data)); 841 746 /* Log(("VBOXSF: VBoxSF::vboxCallSymlink: " 842 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); 843 */ 747 "VbglHGCMCall rc = %#x, result = %#x\n", rc, data.callInfo.result)); */ 844 748 if (RT_SUCCESS (rc)) 845 { 846 rc = data.callInfo.result; 847 } 848 return rc; 849 } 850 851 DECLVBGL(int) vboxCallSetSymlinks (PVBSFCLIENT pClient) 852 { 853 int rc = VINF_SUCCESS; 854 749 rc = data.callInfo.result; 750 return rc; 751 } 752 753 DECLVBGL(int) vboxCallSetSymlinks(PVBSFCLIENT pClient) 754 { 755 int rc; 855 756 VBoxGuestHGCMCallInfo callInfo; 856 757 857 VBOX_INIT_CALL (&callInfo, SET_SYMLINKS, pClient); 858 rc = VbglHGCMCall (pClient->handle, &callInfo, sizeof (callInfo)); 859 if (RT_SUCCESS (rc)) 860 { 758 VBOX_INIT_CALL(&callInfo, SET_SYMLINKS, pClient); 759 rc = VbglHGCMCall(pClient->handle, &callInfo, sizeof(callInfo)); 760 if (RT_SUCCESS(rc)) 861 761 rc = callInfo.result; 862 }863 762 return rc; 864 763 } -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.h
r56294 r58192 29 29 30 30 #include <VBox/VBoxGuestLib.h> 31 #if 0 /* aparently no longer needed (see below) */ 31 32 #ifndef _NTIFS_ 32 33 # ifdef RT_OS_WINDOWS … … 55 56 # endif 56 57 #endif 58 #endif 57 59 58 #if defined(RT_OS_WINDOWS) && 059 /** @todo remove this legacy and use VBox/log.h and/or iprt/log.h. */60 /* => Done. The next person who needs logging in Windows guests will have the61 * honour of making it work. */62 # ifdef DEBUG63 # define LOG_ENABLED64 # endif65 # include "VBoxGuestLog.h"66 #endif67 60 #if defined(RT_OS_WINDOWS) 68 61 # include <VBox/log.h> … … 87 80 88 81 82 #if 0 /* Apparently unused cruft from old windows shared folder driver? */ 89 83 #define VBSF_DRIVE_LETTER_FIRST L'A' 90 84 #define VBSF_DRIVE_LETTER_LAST L'Z' … … 133 127 struct _MRX_VBOX_DEVICE_EXTENSION; 134 128 typedef struct _MRX_VBOX_DEVICE_EXTENSION *PMRX_VBOX_DEVICE_EXTENSION; 129 #endif 135 130 136 DECLVBGL(int) vboxInit 137 DECLVBGL(void) vboxUninit 138 DECLVBGL(int) vboxConnect 139 DECLVBGL(void) vboxDisconnect 131 DECLVBGL(int) vboxInit(void); 132 DECLVBGL(void) vboxUninit(void); 133 DECLVBGL(int) vboxConnect(PVBSFCLIENT pClient); 134 DECLVBGL(void) vboxDisconnect(PVBSFCLIENT pClient); 140 135 141 DECLVBGL(int) vboxCallQueryMappings 136 DECLVBGL(int) vboxCallQueryMappings(PVBSFCLIENT pClient, SHFLMAPPING paMappings[], uint32_t *pcMappings); 142 137 143 DECLVBGL(int) vboxCallQueryMapName 138 DECLVBGL(int) vboxCallQueryMapName(PVBSFCLIENT pClient, SHFLROOT root, SHFLSTRING *pString, uint32_t size); 144 139 145 140 /** … … 166 161 * as additional information. 167 162 */ 168 DECLVBGL(int) vboxCallCreate 163 DECLVBGL(int) vboxCallCreate(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, PSHFLCREATEPARMS pCreateParms); 169 164 170 DECLVBGL(int) vboxCallClose 171 DECLVBGL(int) vboxCallRemove 172 DECLVBGL(int) vboxCallRename 173 DECLVBGL(int) vboxCallFlush 165 DECLVBGL(int) vboxCallClose(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE Handle); 166 DECLVBGL(int) vboxCallRemove(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pParsedPath, uint32_t flags); 167 DECLVBGL(int) vboxCallRename(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pSrcPath, PSHFLSTRING pDestPath, uint32_t flags); 168 DECLVBGL(int) vboxCallFlush(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile); 174 169 175 DECLVBGL(int) vboxCallRead 170 DECLVBGL(int) vboxCallRead(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked); 176 171 DECLVBGL(int) VbglR0SharedFolderReadPageList(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, 177 172 uint64_t offset, uint32_t *pcbBuffer, 178 173 uint16_t offFirstPage, uint16_t cPages, RTGCPHYS64 *paPages); 179 DECLVBGL(int) vboxCallWrite 174 DECLVBGL(int) vboxCallWrite(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, uint8_t *pBuffer, bool fLocked); 180 175 DECLVBGL(int) VbglR0SfWritePhysCont(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint32_t *pcbBuffer, RTCCPHYS PhysBuffer); 181 176 DECLVBGL(int) VbglR0SharedFolderWritePageList(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, … … 183 178 uint16_t offFirstPage, uint16_t cPages, RTGCPHYS64 *paPages); 184 179 185 DECLVBGL(int) vboxCallLock 180 DECLVBGL(int) vboxCallLock(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint64_t offset, uint64_t cbSize, uint32_t fLock); 186 181 187 DECLVBGL(int) vboxCallDirInfo 188 189 DECLVBGL(int) vboxCallFSInfo 182 DECLVBGL(int) vboxCallDirInfo(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile,PSHFLSTRING ParsedPath, uint32_t flags, 183 uint32_t index, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer, uint32_t *pcFiles); 184 DECLVBGL(int) vboxCallFSInfo(PVBSFCLIENT pClient, PVBSFMAP pMap, SHFLHANDLE hFile, uint32_t flags, uint32_t *pcbBuffer, PSHFLDIRINFO pBuffer); 190 185 191 DECLVBGL(int) vboxCallMapFolder 192 DECLVBGL(int) vboxCallUnmapFolder 193 DECLVBGL(int) vboxCallSetUtf8 186 DECLVBGL(int) vboxCallMapFolder(PVBSFCLIENT pClient, PSHFLSTRING szFolderName, PVBSFMAP pMap); 187 DECLVBGL(int) vboxCallUnmapFolder(PVBSFCLIENT pClient, PVBSFMAP pMap); 188 DECLVBGL(int) vboxCallSetUtf8(PVBSFCLIENT pClient); 194 189 195 DECLVBGL(int) vboxReadLink 196 DECLVBGL(int) vboxCallSymlink 197 DECLVBGL(int) vboxCallSetSymlinks 190 DECLVBGL(int) vboxReadLink(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING ParsedPath, uint32_t pcbBuffer, uint8_t *pBuffer); 191 DECLVBGL(int) vboxCallSymlink(PVBSFCLIENT pClient, PVBSFMAP pMap, PSHFLSTRING pNewPath, PSHFLSTRING pOldPath, PSHFLFSOBJINFO pBuffer); 192 DECLVBGL(int) vboxCallSetSymlinks(PVBSFCLIENT pClient); 198 193 199 194 #endif /* !___VBoxGuestLib_VBoxGuestR0LibSharedFolders_h */
Note:
See TracChangeset
for help on using the changeset viewer.