Changeset 14207 in vbox for trunk/include/VBox
- Timestamp:
- Nov 14, 2008 1:25:15 PM (16 years ago)
- Location:
- trunk/include/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuest.h
r14021 r14207 721 721 } Pointer; 722 722 } u; 723 #ifdef __cplusplus 724 void SetUInt32(uint32_t u32) 725 { 726 type = VMMDevHGCMParmType_32bit; 727 u.value64 = 0; /* init unused bits to 0 */ 728 u.value32 = u32; 729 } 730 731 int GetUInt32(uint32_t *pu32) 732 { 733 if (type == VMMDevHGCMParmType_32bit) 734 { 735 *pu32 = u.value32; 736 return VINF_SUCCESS; 737 } 738 return VERR_INVALID_PARAMETER; 739 } 740 741 void SetUInt64(uint64_t u64) 742 { 743 type = VMMDevHGCMParmType_64bit; 744 u.value64 = u64; 745 } 746 747 int GetUInt64(uint64_t *pu64) 748 { 749 if (type == VMMDevHGCMParmType_64bit) 750 { 751 *pu64 = u.value64; 752 return VINF_SUCCESS; 753 } 754 return VERR_INVALID_PARAMETER; 755 } 756 757 void SetPtr(void *pv, uint32_t cb) 758 { 759 type = VMMDevHGCMParmType_LinAddr; 760 u.Pointer.size = cb; 761 u.Pointer.u.linearAddr = (uintptr_t)pv; 762 } 763 #endif 723 764 } HGCMFunctionParameter32; 724 765 … … 741 782 } Pointer; 742 783 } u; 784 #ifdef __cplusplus 785 void SetUInt32(uint32_t u32) 786 { 787 type = VMMDevHGCMParmType_32bit; 788 u.value64 = 0; /* init unused bits to 0 */ 789 u.value32 = u32; 790 } 791 792 int GetUInt32(uint32_t *pu32) 793 { 794 if (type == VMMDevHGCMParmType_32bit) 795 { 796 *pu32 = u.value32; 797 return VINF_SUCCESS; 798 } 799 return VERR_INVALID_PARAMETER; 800 } 801 802 void SetUInt64(uint64_t u64) 803 { 804 type = VMMDevHGCMParmType_64bit; 805 u.value64 = u64; 806 } 807 808 int GetUInt64(uint64_t *pu64) 809 { 810 if (type == VMMDevHGCMParmType_64bit) 811 { 812 *pu64 = u.value64; 813 return VINF_SUCCESS; 814 } 815 return VERR_INVALID_PARAMETER; 816 } 817 818 void SetPtr(void *pv, uint32_t cb) 819 { 820 type = VMMDevHGCMParmType_LinAddr; 821 u.Pointer.size = cb; 822 u.Pointer.u.linearAddr = (uintptr_t)pv; 823 } 824 #endif 743 825 } HGCMFunctionParameter64; 744 826 #else /* !VBOX_WITH_64_BITS_GUESTS */ … … 761 843 } Pointer; 762 844 } u; 845 #ifdef __cplusplus 846 void SetUInt32(uint32_t u32) 847 { 848 type = VMMDevHGCMParmType_32bit; 849 u.value64 = 0; /* init unused bits to 0 */ 850 u.value32 = u32; 851 } 852 853 int GetUInt32(uint32_t *pu32) 854 { 855 if (type == VMMDevHGCMParmType_32bit) 856 { 857 *pu32 = u.value32; 858 return VINF_SUCCESS; 859 } 860 return VERR_INVALID_PARAMETER; 861 } 862 863 void SetUInt64(uint64_t u64) 864 { 865 type = VMMDevHGCMParmType_64bit; 866 u.value64 = u64; 867 } 868 869 int GetUInt64(uint64_t *pu64) 870 { 871 if (type == VMMDevHGCMParmType_64bit) 872 { 873 *pu64 = u.value64; 874 return VINF_SUCCESS; 875 } 876 return VERR_INVALID_PARAMETER; 877 } 878 879 void SetPtr(void *pv, uint32_t cb) 880 { 881 type = VMMDevHGCMParmType_LinAddr; 882 u.Pointer.size = cb; 883 u.Pointer.u.linearAddr = (uintptr_t)pv; 884 } 885 #endif 763 886 } HGCMFunctionParameter; 764 887 #endif /* !VBOX_WITH_64_BITS_GUESTS */ … … 1247 1370 /* Parameters follow in form HGCMFunctionParameter aParms[cParms] */ 1248 1371 } VBoxGuestHGCMCallInfo; 1372 1373 typedef struct _VBoxGuestHGCMCallInfoTimeout 1374 { 1375 uint32_t u32Timeout; /**< IN How long to wait for completion before cancelling the call */ 1376 VBoxGuestHGCMCallInfo info; /** The rest of the call information. Placed after the timeout 1377 * so that the parameters follow as they would for a normal call. */ 1378 /* Parameters follow in form HGCMFunctionParameter aParms[cParms] */ 1379 } VBoxGuestHGCMCallInfoTimeout; 1249 1380 # pragma pack() 1250 1381 1251 # define VBOXGUEST_IOCTL_HGCM_CONNECT VBOXGUEST_IOCTL_CODE(16, sizeof(VBoxGuestHGCMConnectInfo)) 1252 # define VBOXGUEST_IOCTL_HGCM_DISCONNECT VBOXGUEST_IOCTL_CODE(17, sizeof(VBoxGuestHGCMDisconnectInfo)) 1253 # define VBOXGUEST_IOCTL_HGCM_CALL(Size) VBOXGUEST_IOCTL_CODE(18, (Size)) 1254 # define VBOXGUEST_IOCTL_CLIPBOARD_CONNECT VBOXGUEST_IOCTL_CODE(19, sizeof(uint32_t)) 1382 # define VBOXGUEST_IOCTL_HGCM_CONNECT VBOXGUEST_IOCTL_CODE(16, sizeof(VBoxGuestHGCMConnectInfo)) 1383 # define VBOXGUEST_IOCTL_HGCM_DISCONNECT VBOXGUEST_IOCTL_CODE(17, sizeof(VBoxGuestHGCMDisconnectInfo)) 1384 # define VBOXGUEST_IOCTL_HGCM_CALL(Size) VBOXGUEST_IOCTL_CODE(18, (Size)) 1385 # define VBOXGUEST_IOCTL_HGCM_CALL_TIMEOUT(Size) VBOXGUEST_IOCTL_CODE(20, (Size)) 1386 # define VBOXGUEST_IOCTL_CLIPBOARD_CONNECT VBOXGUEST_IOCTL_CODE(19, sizeof(uint32_t)) 1255 1387 1256 1388 # define VBOXGUEST_HGCM_CALL_PARMS(a) ((HGCMFunctionParameter *)((uint8_t *)(a) + sizeof (VBoxGuestHGCMCallInfo))) … … 1563 1695 VBGLR3DECL(void) VbglR3GuestPropEnumFree(PVBGLR3GUESTPROPENUM pHandle); 1564 1696 VBGLR3DECL(int) VbglR3GuestPropDelSet(uint32_t u32ClientId, char const * const *papszPatterns, size_t cPatterns); 1697 VBGLR3DECL(int) VbglR3GuestPropWait(uint32_t u32ClientId, const char *pszPatterns, void *pvBuf, uint32_t cbBuf, uint64_t u64Timestamp, uint32_t u32Timeout, char ** ppszName, char **ppszValue, uint64_t *pu64Timestamp, char **ppszFlags, uint32_t *pcbBufActual); 1565 1698 /** @} */ 1566 1699 #endif /* VBOX_WITH_GUEST_PROPS defined */ -
trunk/include/VBox/VBoxGuestLib.h
r11820 r14207 241 241 */ 242 242 DECLVBGL(int) VbglHGCMCall (VBGLHGCMHANDLE handle, VBoxGuestHGCMCallInfo *pData, uint32_t cbData); 243 244 /** 245 * Call to a service with timeout. 246 * 247 * @param handle Handle of the connection. 248 * @param pData Call request information structure, including function parameters. 249 * @param cbData Length in bytes of data. 250 * @param cMillies Timeout in milliseconds. Use RT_INDEFINITE_WAIT to wait forever. 251 * 252 * @return VBox status code. 253 */ 254 DECLVBGL(int) VbglHGCMCallTimeout (VBGLHGCMHANDLE handle, 255 VBoxGuestHGCMCallInfoTimeout *pData, uint32_t cbData); 243 256 /** @} */ 244 257
Note:
See TracChangeset
for help on using the changeset viewer.