Changeset 6345 in vbox
- Timestamp:
- Jan 11, 2008 5:28:00 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 27247
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuest.h
r6281 r6345 977 977 # define VBOXGUEST_IOCTL_CODE(Function, Size) _IOWRN('V', (Function) | VBOXGUEST_IOCTL_FLAG, (Size)) 978 978 # define VBOXGUEST_IOCTL_CODE_FAST(Function) _IO( 'V', (Function) | VBOXGUEST_IOCTL_FLAG) 979 980 # define VBOXGUEST_IOCTL_SIZE(Code) (((Code) >> 16) & IOCPARM_MASK) 981 # define VBOXGUEST_IOCTL_NUMBER(Code) ((Code) & IOCPARM_MASK) 979 982 980 983 #elif 0 /* BSD style - needs some adjusting _IORW takes a type and not a size. */ -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.c
r6301 r6345 733 733 int rc = 0; 734 734 int requestType = 0; 735 if ( Cmd >= VBOXGUEST_IOCTL_VMMREQUEST(0) 736 && Cmd <= VBOXGUEST_IOCTL_VMMREQUEST(0xfff)) 735 if (VBOXGUEST_IOCTL_NUMBER(Cmd) == VBOXGUEST_IOCTL_NUMBER(VBOXGUEST_IOCTL_VMMREQUEST(0))) 737 736 { 738 737 cbBuf = sizeof(VMMDevRequestHeader); 739 738 requestType = 1; 740 LogFlow((DEVICE_NAME ":VBOXGUEST_IOCTL_VMMREQUEST "));739 LogFlow((DEVICE_NAME ":VBOXGUEST_IOCTL_VMMREQUEST\n")); 741 740 } 742 741 #ifdef VBOX_HGCM 743 else if ( Cmd >= VBOXGUEST_IOCTL_HGCM_CALL(0) 744 && Cmd <= VBOXGUEST_IOCTL_HGCM_CALL(0xfff)) 742 else if (VBOXGUEST_IOCTL_NUMBER(Cmd) == VBOXGUEST_IOCTL_NUMBER(VBOXGUEST_IOCTL_HGCM_CALL(0))) 745 743 { 746 744 cbBuf = sizeof(VBoxGuestHGCMCallInfo); 747 LogFlow((DEVICE_NAME ":VBOXGUEST_IOCTL_HGCM_CALL")); 745 requestType = 2; 746 LogFlow((DEVICE_NAME ":VBOXGUEST_IOCTL_HGCM_CALL", Cmd)); 748 747 } 749 748 #endif /* VBOX_HGCM */ 749 else if (VBOXGUEST_IOCTL_NUMBER(Cmd) == VBOXGUEST_IOCTL_NUMBER(VBOXGUEST_IOCTL_LOG(0))) 750 { 751 /** Untested Code. Will be tested soon. */ 752 cbBuf = VBOXGUEST_IOCTL_SIZE(Cmd); 753 LogFlow((DEVICE_NAME ":VBOXGUEST_IOCTL_LOG Cmd=%d cbBuf=%d", Cmd, cbBuf)); 754 char* pszLogMsg = RTMemTmpAlloc(cbBuf); 755 if (RT_UNLIKELY(!pszLogMsg)) 756 { 757 LogRel((DEVICE_NAME ":RTMemAlloc failed to alloc %d bytes\n", cbBuf)); 758 return ENOMEM; 759 } 760 rc = ddi_copyin((void *)pArg, pszLogMsg, cbBuf, Mode); 761 if (rc == 0) 762 Log(("%.*s", cbBuf, pszLogMsg)); 763 else 764 LogRel((DEVICE_NAME ":ddi_copyin failed. rc=%d\n", rc)); 765 RTMemTmpFree(pszLogMsg); 766 } 750 767 else 751 768 { … … 803 820 { 804 821 VMMDevRequestHeader Hdr; 805 rc = ddi_copyin((void *)pArg, &Hdr, sizeof(Hdr), Mode);822 rc = ddi_copyin((void *)pArg, &Hdr, sizeof(Hdr), Mode); 806 823 if (RT_UNLIKELY(rc)) 807 824 {
Note:
See TracChangeset
for help on using the changeset viewer.