VirtualBox

Changeset 68570 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Aug 31, 2017 12:10:39 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
117787
Message:

merging vbglioc r117736: OS/2 adjustments.

Location:
trunk/src/VBox/Additions/common
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-os2.cpp

    r68550 r68570  
    5252#include "VBoxGuestInternal.h"
    5353#include <VBox/version.h>
     54#include <iprt/assert.h>
    5455#include <iprt/initterm.h>
    55 #include <iprt/string.h>
    56 #include <iprt/spinlock.h>
    57 #include <iprt/process.h>
    58 #include <iprt/assert.h>
    5956#include <iprt/log.h>
    6057#include <iprt/memobj.h>
    6158#include <iprt/mem.h>
    6259#include <iprt/param.h>
     60#include <iprt/process.h>
     61#include <iprt/spinlock.h>
     62#include <iprt/string.h>
    6363
    6464
     
    466466 * @param   u32Session          The session handle (PVBOXGUESTSESSION).
    467467 * @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.
    475474 *
    476475 * @remark  This is called from the 16-bit thunker as well as directly from the 32-bit clients.
    477476 */
    478 DECLASM(int) VGDrvOS2IDCService(uint32_t u32Session, unsigned iFunction, void *pvData, size_t cbData, size_t *pcbDataReturned)
     477DECLASM(int) VGDrvOS2IDCService(uint32_t u32Session, unsigned iFunction, PVBGLREQHDR pReqHdr, size_t cbReq)
    479478{
    480479    PVBOXGUESTSESSION pSession = (PVBOXGUESTSESSION)u32Session;
     
    483482    AssertMsgReturn(pSession->pDevExt == &g_DevExt, ("%p != %p\n", pSession->pDevExt, &g_DevExt), VERR_INVALID_HANDLE);
    484483
    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);
    499485}
    500486
     
    569555                 */
    570556                PVBGLREQHDR pReqHdr = (PVBGLREQHDR)pvParm;
    571                 rc = VGDrvCommonIoCtl(iFunction, &g_DevExt, pSession, pvParm, *pcbParm);
     557                rc = VGDrvCommonIoCtl(iFunction, &g_DevExt, pSession, pReqHdr, *pcbParm);
    572558
    573559                /*
     
    581567                return rc;
    582568            }
    583             AssertFailedMsg(("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));
    584570            return VERR_LOCK_FAILED;
    585571        }
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestA-os2.asm

    r68550 r68570  
    826826    movzx   ebx, word [ebp + 08h]
    827827
    828     mov     dword [ebx + VBGOS2IDC.u32Version       ], VMMDEV_VERSION
     828    mov     dword [ebx + VBGOS2IDC.u32Version       ], VBGL_IOC_VERSION
    829829    mov     dword [ebx + VBGOS2IDC.u32Session       ], eax
    830830    mov     dword [ebx + VBGOS2IDC.pfnServiceEP     ], NAME(VGDrvOS2IDCService)
     
    867867; @param   u32Session          bp +  8h - The above session handle.
    868868; @param   iFunction           bp + 0ch - The requested function.
    869 ; @param   pvData              bp + 0eh - The input/output data buffer. The caller ensures that this
     869; @param   fpReqHdr            bp + 0eh - The input/output data buffer. The caller ensures that this
    870870;                                         cannot be swapped out, or that it's acceptable to take a
    871871;                                         page in fault in the current context. If the request doesn't
    872872;                                         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);
    878876;
    879877GLOBALNAME VGDrvOS2IDCService16
     
    897895    ; Create the call frame before switching.
    898896    ;
    899     push    dword 0                     ; esp + 14h:    &cbDataReturned (filled in after stack switch)
    900897    movzx   ecx, word [bp + 12h]         
    901898    push    ecx                         ; esp + 10h:    cbData
     
    929926    call    KernThunkStackTo32
    930927
    931     ; update the cbDataReturned pointer
    932     lea     eax, [esp + 18h]
    933     mov     [esp + 14h], eax
    934 
    935928    ; call the C code (don't cleanup the stack).
    936929    call    NAME(VGDrvOS2IDCService)
     
    944937segment CODE16
    945938GLOBALNAME VGDrvOS2IDCService16_16
    946 
    947     ; Set *pcbDataReturned.
    948     cmp     word [bp + 14h + 2], 3
    949     jbe     .no_pcbDataReturned
    950     xchg    dx, bx
    951     mov     cx, [esp + 18h]
    952     les     bx, [bp + 14h]
    953     mov     word [es:bx], cx
    954     xchg    dx, bx
    955 .no_pcbDataReturned:
    956939
    957940VGDrvOS2IDCService16_Done:
     
    988971    mov     ebp, esp
    989972    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
    1007979    call    NAME(VGDrvOS2IDCService16)
    1008980
    1009     mov     cx, [bp - 08h]              ; cbDataReturned.
     981    mov     cx, [es:bx + VBGLREQHDR.cbOut]
    1010982
    1011983    mov     edx, [bp - 4]
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibIdc-os2.cpp

    r68561 r68570  
    4949     * Just check whether the connection was made or not.
    5050     */
    51     if (   g_VBoxGuestIDC.u32Version == VMMDEV_VERSION
     51    if (   g_VBoxGuestIDC.u32Version == VBGL_IOC_VERSION
    5252        && RT_VALID_PTR(g_VBoxGuestIDC.u32Session)
    5353        && 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));
    5955    Log(("vbglDriverOpen: failed\n"));
    6056    return VERR_FILE_NOT_FOUND;
     
    7975DECLR0VBGL(int) VbglR0IdcCallRaw(PVBGLIDCHANDLE pHandle, uintptr_t uReq, PVBGLREQHDR pReqHdr, uint32_t cbReq)
    8076{
    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);
    8378}
    8479
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette