Changeset 6422 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jan 21, 2008 6:11:53 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 27388
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.c
r6411 r6422 725 725 * driver, i.e. the request is just a fixed size header containing the buffer pointer and size of the 726 726 * real request (SUPREQHDR). Trying to save the extra ddi_copyin isn't worth the effort and inflexibility. */ 727 #if 0 728 /* 729 * Read and validate the request wrapper. 730 */ 731 VBGLBIGREQ ReqWrap; 732 if (IOCPARM_LEN(Cmd) != sizeof(ReqWrap)) 733 { 734 Log((DEVICE_NAME ": VBoxAddSolarisIOCtl: bad request %#x\n", Cmd)); 735 return ENOTTY; 736 } 737 738 rc = ddi_copyin((void *)pArg, &ReqWrap, sizeof(ReqWrap), Mode); 739 if (RT_UNLIKELY(rc)) 740 { 741 Log((DEVICE_NAME ": VBoxAddSolarisIOCtl: ddi_copyin failed to read header pArg=%p Cmd=%d. rc=%d.\n", pArg, Cmd, rc)); 742 return EINVAL; 743 } 744 745 if (ReqWrap.u32Magic != VBGLBIGREQ_MAGIC) 746 { 747 Log((DEVICE_NAME ": VBoxAddSolarisIOCtl: bad magic %#x; pArg=%p Cmd=%d.\n", ReqWrap.u32Magic, pArg, Cmd)); 748 return EINVAL; 749 } 750 if (RT_UNLIKELY( ReqWrap.cbData == 0 751 || ReqWrap.cbData > _1M*16)) 752 { 753 Log((DEVICE_NAME ": VBoxAddSolarisIOCtl: bad size %#x; pArg=%p Cmd=%d.\n", ReqWrap.cbData, pArg, Cmd)); 754 return EINVAL; 755 } 756 757 #else 727 758 uint32_t cbBuf = 0; 728 759 int rc = 0; … … 842 873 cbBuf += Hdr.cParms * sizeof(HGCMFunctionParameter); 843 874 } 875 #endif 844 876 845 877 /* 846 878 * Read the request. 847 879 */ 880 #if 0 881 void *pvBuf = RTMemTmpAlloc(ReqWrap.cbData); 882 #else 848 883 void *pvBuf = RTMemTmpAlloc(cbBuf); 884 #endif 849 885 if (RT_UNLIKELY(!pvBuf)) 850 886 { … … 853 889 } 854 890 891 #if 0 892 rc = ddi_copyin((void *)pArg, (void *)(uintptr_t)ReqWrap.pvData, ReqWrap.cbData, Mode); 893 #else 855 894 rc = ddi_copyin((void *)pArg, pvBuf, cbBuf, Mode); 895 #endif 856 896 if (RT_UNLIKELY(rc)) 857 897 { … … 879 919 cbDataReturned = cbBuf; 880 920 } 921 #if 0 922 rc = ddi_copyout(pvBuf, (void *)(uintptr_t)ReqWrap.pvData, cbDataReturned, Mode); 923 #else 881 924 rc = ddi_copyout(pvBuf, (void *)pArg, cbDataReturned, Mode); 925 #endif 882 926 if (RT_UNLIKELY(rc)) 883 927 {
Note:
See TracChangeset
for help on using the changeset viewer.