Changeset 3306 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Jun 26, 2007 11:50:54 PM (18 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxGuestLib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/SysHlp.cpp
r3192 r3306 27 27 28 28 #include <iprt/assert.h> 29 #if !defined(__WIN__) && !defined(__LINUX__) 30 #include <iprt/memobj.h> 31 #endif 32 29 33 30 34 int vbglLockLinear (void **ppvCtx, void *pv, uint32_t u32Size) … … 55 59 } 56 60 } 57 #else 61 62 #elif defined(__LINUX__) 58 63 NOREF(ppvCtx); 59 64 NOREF(pv); 60 65 NOREF(u32Size); 61 #endif /* __WIN__ */ 66 67 #else 68 /* Default to IPRT - this ASSUMES that it is USER addresses we're locking. */ 69 RTR0MEMOBJ MemObj; 70 rc = RTR0MemObjLockUser(&MemObj, pv, u32Size, NIL_RTR0PROCESS); 71 if (RT_SUCCESS(rc)) 72 *ppvCtx = MemObj; 73 else 74 *ppvCtx = NIL_RTR0MEMOBJ; 75 76 #endif 62 77 63 78 return rc; … … 77 92 IoFreeMdl (pMdl); 78 93 } 79 #else 94 95 #elif defined(__LINUX__) 80 96 NOREF(pvCtx); 81 #endif /* __WIN__ */ 97 98 #else 99 /* default to IPRT */ 100 RTR0MEMOBJ MemObj = (RTR0MEMOBJ)pvCtx; 101 int rc = RTR0MemObjFree(MemObj, false); 102 AssertRC(rc); 103 104 #endif 82 105 } 83 106 … … 91 114 #endif 92 115 93 #ifndef __WIN__ 94 # ifdef __cplusplus 95 extern "C" { 96 # endif 116 #ifdef __LINUX__ 117 __BEGIN_DECLS 97 118 extern DECLVBGL(void *) vboxadd_cmc_open (void); 98 119 extern DECLVBGL(void) vboxadd_cmc_close (void *); 99 120 extern DECLVBGL(int) vboxadd_cmc_call (void *opaque, uint32_t func, void *data); 100 # ifdef __cplusplus 101 } 102 # endif 103 #endif 121 __END_DECLS 122 #endif /* __LINUX__ */ 123 124 #ifdef __OS2__ 125 __BEGIN_DECLS 126 /* 127 * On OS/2 we'll do the connecting in the assembly code of the 128 * client driver, exporting a g_VBoxGuestIDC symbol containing 129 * the connection information obtained from the 16-bit IDC. 130 */ 131 extern VBOXGUESTOS2IDCCONNECT g_VBoxGuestIDC; 132 __END_DECLS 133 #endif 134 104 135 105 136 int vbglDriverOpen (VBGLDRIVER *pDriver) … … 138 169 139 170 #elif defined (__OS2__) 140 return VERR_NOT_IMPLEMENTED; 171 /* 172 * Just check whether the connection was made or not. 173 */ 174 if ( g_VBoxGuestIDC.u32Version == VMMDEV_VERSION 175 && VALID_PTR(g_VBoxGuestIDC.u32Session) 176 && VALID_PTR(g_VBoxGuestIDC.pfnServiceEP)) 177 { 178 pDriver->u32Session = g_VBoxGuestIDC.u32Session; 179 return VINF_SUCCESS; 180 } 181 pDriver->u32Session = UINT32_MAX; 182 Log(("vbglDriverOpen: failed\n")); 183 return VERR_FILE_NOT_FOUND; 141 184 142 185 #else … … 191 234 192 235 #elif defined (__OS2__) 193 return VERR_NOT_IMPLEMENTED; 236 if ( pDriver->u32Session 237 && pDriver->u32Session == g_VBoxGuestIDC.u32Session) 238 return g_VBoxGuestIDC.pfnServiceEP(pDriver->u32Session, u32Function, pvData, cbData, NULL); 239 240 Log(("vbglDriverIOCtl: No connection\n")); 241 return VERR_WRONG_ORDER; 194 242 195 243 #else … … 208 256 209 257 #elif defined (__OS2__) 210 258 pDriver->u32Session = 0; 211 259 212 260 #else -
trunk/src/VBox/Additions/common/VBoxGuestLib/SysHlp.h
r3192 r3306 55 55 void *opaque; 56 56 #elif defined (__OS2__) 57 uint32_t placeholder;57 uint32_t u32Session; /**< just for sanity checking. */ 58 58 #else 59 59 # error "Port me"
Note:
See TracChangeset
for help on using the changeset viewer.