VirtualBox

Changeset 15811 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 5, 2009 3:53:20 PM (16 years ago)
Author:
vboxsync
Message:

Support 32 bit IOCtls in the Windows 64 bit guest driver.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxGuest/VBoxGuest.cpp

    r15704 r15811  
    905905         * uses the same waiting code.
    906906         */
     907#ifdef RT_ARCH_AMD64
     908        case VBOXGUEST_IOCTL_HGCM_CONNECT_32:
     909#endif /* RT_ARCH_AMD64 */
    907910        case VBOXGUEST_IOCTL_HGCM_CONNECT:
    908911        {
     
    950953        } break;
    951954
     955#ifdef RT_ARCH_AMD64
     956        case VBOXGUEST_IOCTL_HGCM_DISCONNECT_32:
     957#endif /* RT_ARCH_AMD64 */
    952958        case VBOXGUEST_IOCTL_HGCM_DISCONNECT:
    953959        {
     
    991997        } break;
    992998
    993         case VBOXGUEST_IOCTL_HGCM_CALL(0): /* (The size isn't relevant on NT.) */
    994         {
     999#ifdef RT_ARCH_AMD64
     1000        case VBOXGUEST_IOCTL_HGCM_CALL_32(0): /* (The size isn't relevant on NT.) */
     1001        {
     1002            /* A 32 bit application call. */
    9951003            int rc;
    9961004
    997             dprintf(("VBoxGuest::VBoxGuestDeviceControl: VBOXGUEST_IOCTL_HGCM_CALL\n"));
     1005            dprintf(("VBoxGuest::VBoxGuestDeviceControl: VBOXGUEST_IOCTL_HGCM_CALL_32\n"));
    9981006
    9991007            Status = vboxHGCMVerifyIOBuffers (pStack,
     
    10061014            }
    10071015
     1016            /* @todo: Old guest OpenGL driver used the same IOCtl code for both 32 and 64 bit binaries.
     1017             *        This is a protection, and can be removed if there were no 64 bit driver.
     1018             */
     1019            if (!IoIs32bitProcess(pIrp))
     1020            {
     1021                Status = STATUS_UNSUCCESSFUL;
     1022                break;
     1023            }
     1024
    10081025            VBoxGuestHGCMCallInfo *ptr = (VBoxGuestHGCMCallInfo *)pBuf;
    10091026
    1010 # if ARCH_BITS == 64
    1011             if (IoIs32bitProcess(pIrp))
    1012                 rc = VbglHGCMCall32(ptr, VBoxHGCMCallback, pDevExt, RT_INDEFINITE_WAIT);
     1027            rc = VbglHGCMCall32(ptr, VBoxHGCMCallback, pDevExt, RT_INDEFINITE_WAIT);
     1028
     1029            if (RT_FAILURE(rc))
     1030            {
     1031                dprintf(("VBOXGUEST_IOCTL_HGCM_CALL_32: vbox rc = %Rrc\n", rc));
     1032                Status = STATUS_UNSUCCESSFUL;
     1033            }
    10131034            else
    1014 # endif
    1015                 rc = VbglHGCMCall (ptr, VBoxHGCMCallback, pDevExt, RT_INDEFINITE_WAIT);
     1035            {
     1036                cbOut = pStack->Parameters.DeviceIoControl.OutputBufferLength;
     1037            }
     1038
     1039        } break;
     1040#endif /* RT_ARCH_AMD64 */
     1041
     1042        case VBOXGUEST_IOCTL_HGCM_CALL(0): /* (The size isn't relevant on NT.) */
     1043        {
     1044            int rc;
     1045
     1046            dprintf(("VBoxGuest::VBoxGuestDeviceControl: VBOXGUEST_IOCTL_HGCM_CALL\n"));
     1047
     1048            Status = vboxHGCMVerifyIOBuffers (pStack,
     1049                                              sizeof (VBoxGuestHGCMCallInfo));
     1050
     1051            if (Status != STATUS_SUCCESS)
     1052            {
     1053                dprintf(("VBoxGuest::VBoxGuestDeviceControl: invalid parameter. Status: %p\n", Status));
     1054                break;
     1055            }
     1056
     1057            VBoxGuestHGCMCallInfo *ptr = (VBoxGuestHGCMCallInfo *)pBuf;
     1058
     1059            rc = VbglHGCMCall (ptr, VBoxHGCMCallback, pDevExt, RT_INDEFINITE_WAIT);
    10161060
    10171061            if (RT_FAILURE(rc))
Note: See TracChangeset for help on using the changeset viewer.

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