Changeset 68570 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Aug 31, 2017 12:10:39 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 117787
- Location:
- trunk/src/VBox/Additions/common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-os2.cpp
r68550 r68570 52 52 #include "VBoxGuestInternal.h" 53 53 #include <VBox/version.h> 54 #include <iprt/assert.h> 54 55 #include <iprt/initterm.h> 55 #include <iprt/string.h>56 #include <iprt/spinlock.h>57 #include <iprt/process.h>58 #include <iprt/assert.h>59 56 #include <iprt/log.h> 60 57 #include <iprt/memobj.h> 61 58 #include <iprt/mem.h> 62 59 #include <iprt/param.h> 60 #include <iprt/process.h> 61 #include <iprt/spinlock.h> 62 #include <iprt/string.h> 63 63 64 64 … … 466 466 * @param u32Session The session handle (PVBOXGUESTSESSION). 467 467 * @param iFunction The requested function. 468 * @param pvData The input/output data buffer. The caller ensures that this 469 * cannot be swapped out, or that it's acceptable to take a 470 * page in fault in the current context. If the request doesn't 471 * take input or produces output, apssing NULL is okay. 472 * @param cbData The size of the data buffer. 473 * @param pcbDataReturned Where to store the amount of data that's returned. 474 * This can be NULL if pvData is NULL. 468 * @param pReqHdr The input/output data buffer. The caller 469 * ensures that this cannot be swapped out, or that 470 * it's acceptable to take a page in fault in the 471 * current context. If the request doesn't take 472 * input or produces output, apssing NULL is okay. 473 * @param cbReq The size of the data buffer. 475 474 * 476 475 * @remark This is called from the 16-bit thunker as well as directly from the 32-bit clients. 477 476 */ 478 DECLASM(int) VGDrvOS2IDCService(uint32_t u32Session, unsigned iFunction, void *pvData, size_t cbData, size_t *pcbDataReturned)477 DECLASM(int) VGDrvOS2IDCService(uint32_t u32Session, unsigned iFunction, PVBGLREQHDR pReqHdr, size_t cbReq) 479 478 { 480 479 PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)u32Session; … … 483 482 AssertMsgReturn(pSession->pDevExt == &g_DevExt, ("%p != %p\n", pSession->pDevExt, &g_DevExt), VERR_INVALID_HANDLE); 484 483 485 int rc; 486 switch (iFunction) 487 { 488 default: 489 rc = VGDrvCommonIoCtl(iFunction, &g_DevExt, pSession, pvData, cbData, pcbDataReturned); 490 break; 491 492 case VBOXGUEST_IOCTL_OS2_IDC_DISCONNECT: 493 pSession->sfn = 0; 494 VGDrvCommonCloseSession(&g_DevExt, pSession); 495 rc = VINF_SUCCESS; 496 break; 497 } 498 return rc; 484 return VGDrvCommonIoCtl(iFunction, &g_DevExt, pSession, pReqHdr, cbReq); 499 485 } 500 486 … … 569 555 */ 570 556 PVBGLREQHDR pReqHdr = (PVBGLREQHDR)pvParm; 571 rc = VGDrvCommonIoCtl(iFunction, &g_DevExt, pSession, p vParm, *pcbParm);557 rc = VGDrvCommonIoCtl(iFunction, &g_DevExt, pSession, pReqHdr, *pcbParm); 572 558 573 559 /* … … 581 567 return rc; 582 568 } 583 Assert FailedMsg(("KernVMLock(VMDHL_WRITE, %p, %#x, &p, NULL, NULL) -> %d\n", pvParm,*pcbParm,&ParmLock, rc));569 AssertMsgFailed(("KernVMLock(VMDHL_WRITE, %p, %#x, &p, NULL, NULL) -> %d\n", pvParm, *pcbParm, &ParmLock, rc)); 584 570 return VERR_LOCK_FAILED; 585 571 } -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestA-os2.asm
r68550 r68570 826 826 movzx ebx, word [ebp + 08h] 827 827 828 mov dword [ebx + VBGOS2IDC.u32Version ], V MMDEV_VERSION828 mov dword [ebx + VBGOS2IDC.u32Version ], VBGL_IOC_VERSION 829 829 mov dword [ebx + VBGOS2IDC.u32Session ], eax 830 830 mov dword [ebx + VBGOS2IDC.pfnServiceEP ], NAME(VGDrvOS2IDCService) … … 867 867 ; @param u32Session bp + 8h - The above session handle. 868 868 ; @param iFunction bp + 0ch - The requested function. 869 ; @param pvDatabp + 0eh - The input/output data buffer. The caller ensures that this869 ; @param fpReqHdr bp + 0eh - The input/output data buffer. The caller ensures that this 870 870 ; cannot be swapped out, or that it's acceptable to take a 871 871 ; page in fault in the current context. If the request doesn't 872 872 ; take input or produces output, passing NULL is okay. 873 ; @param cbData bp + 12h - The size of the data buffer. 874 ; @param pcbDataReturned bp + 14h - Where to store the amount of data that's returned. 875 ; This can be NULL if pvData is NULL. 876 ; 877 ; @cproto long far __cdecl VGDrvOS2IDCService16(uint32_t u32Session, uint16_t iFunction, void far *fpvData, uint16_t cbData, uint16_t far *pcbDataReturned); 873 ; @param cbReq bp + 12h - The size of the data buffer. 874 ; 875 ; @cproto long far __cdecl VGDrvOS2IDCService16(uint32_t u32Session, uint16_t iFunction, void far *fpReqHdr, uint16_t cbReq); 878 876 ; 879 877 GLOBALNAME VGDrvOS2IDCService16 … … 897 895 ; Create the call frame before switching. 898 896 ; 899 push dword 0 ; esp + 14h: &cbDataReturned (filled in after stack switch)900 897 movzx ecx, word [bp + 12h] 901 898 push ecx ; esp + 10h: cbData … … 929 926 call KernThunkStackTo32 930 927 931 ; update the cbDataReturned pointer932 lea eax, [esp + 18h]933 mov [esp + 14h], eax934 935 928 ; call the C code (don't cleanup the stack). 936 929 call NAME(VGDrvOS2IDCService) … … 944 937 segment CODE16 945 938 GLOBALNAME VGDrvOS2IDCService16_16 946 947 ; Set *pcbDataReturned.948 cmp word [bp + 14h + 2], 3949 jbe .no_pcbDataReturned950 xchg dx, bx951 mov cx, [esp + 18h]952 les bx, [bp + 14h]953 mov word [es:bx], cx954 xchg dx, bx955 .no_pcbDataReturned:956 939 957 940 VGDrvOS2IDCService16_Done: … … 988 971 mov ebp, esp 989 972 push edx ; bp - 4h 990 lea sp, [bp - 18h] ; allocate the call frame. 991 992 ; bp - 06h (dw): oops... 993 mov [bp - 08h], word 0 ; bp - 08h (dw): cbDataReturned 994 995 mov [bp - 0eh], cx ; bp - 0eh (dw): cbData (NOTE: out of order to free up CX) 996 lea cx, [bp - 08h] ; bp - 0ch (dd): &cbDataReturned 997 mov [bp - 0ah], cx 998 mov cx, ss 999 mov [bp - 0ch], cx 1000 mov [bp - 10h], bx ; bp - 10h (dd): pvData 1001 mov cx, es 1002 mov [bp - 12h], cx 1003 mov [bp - 14h], dl ; bp - 14h (dw): iFunction 1004 mov [bp - 13h], byte 0 1005 mov [bp - 18h], eax ; bp - 18h (dd): u32Session 1006 973 974 push cx ; cbData 975 push es 976 xor dh, dh 977 push dx 978 push eax 1007 979 call NAME(VGDrvOS2IDCService16) 1008 980 1009 mov cx, [ bp - 08h] ; cbDataReturned.981 mov cx, [es:bx + VBGLREQHDR.cbOut] 1010 982 1011 983 mov edx, [bp - 4] -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibIdc-os2.cpp
r68561 r68570 49 49 * Just check whether the connection was made or not. 50 50 */ 51 if ( g_VBoxGuestIDC.u32Version == V MMDEV_VERSION51 if ( g_VBoxGuestIDC.u32Version == VBGL_IOC_VERSION 52 52 && RT_VALID_PTR(g_VBoxGuestIDC.u32Session) 53 53 && RT_VALID_PTR(g_VBoxGuestIDC.pfnServiceEP)) 54 { 55 pHandle->s.pvSession = (void *)g_VBoxGuestIDC.u32Session; 56 return vbglR0IdcNativeCall(pHandle, VBGL_IOCTL_IDC_CONNECT, pReq); 57 } 58 pHandle->s.pvSession = NULL; 54 return g_VBoxGuestIDC.pfnServiceEP(g_VBoxGuestIDC.u32Session, VBGL_IOCTL_IDC_CONNECT, &pReq->Hdr, sizeof(*pReq)); 59 55 Log(("vbglDriverOpen: failed\n")); 60 56 return VERR_FILE_NOT_FOUND; … … 79 75 DECLR0VBGL(int) VbglR0IdcCallRaw(PVBGLIDCHANDLE pHandle, uintptr_t uReq, PVBGLREQHDR pReqHdr, uint32_t cbReq) 80 76 { 81 size_t cbRetIgn; 82 return g_VBoxGuestIDC.pfnServiceEP((uintptr_t)pHandle->s.pvSession, uReq, pReqHdr, cbReq, &cbRetIgn); 77 return g_VBoxGuestIDC.pfnServiceEP((uintptr_t)pHandle->s.pvSession, uReq, pReqHdr, cbReq); 83 78 } 84 79
Note:
See TracChangeset
for help on using the changeset viewer.